From b0792a5c548c600443edbeaa3c4b0612e0eb4045 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 24 Sep 2010 09:25:26 +0200 Subject: Doc: Implementing new search display --- doc/src/template/scripts/functions.js | 223 ++++++++++++++++------------ tools/qdoc3/test/qt-html-templates.qdocconf | 9 +- 2 files changed, 138 insertions(+), 94 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index faa4ca4..5bf8323 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -1,38 +1,57 @@ +// Removing search results +function hideSearchResults() { + $('#resultdialog').removeClass('active'); + $("#resultlist").removeClass().addClass('all'); + $("#resultlinks").removeClass().addClass('all'); + $("#searchcount").removeClass().addClass('all'); +} +// Closing search result box +$('#resultclose').click(function(e) { + e.preventDefault(); + hideSearchResults(); +}); + +$(document.body).click(function() { +}); + /* START non link areas where cursor should change to pointing hand */ $('.t_button').mouseover(function() { $('.t_button').css('cursor','pointer'); - /*document.getElementById(this.id).style.cursor='pointer';*/ }); /* END non link areas */ +// Font size small $('#smallA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','smaller'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller'); $('.t_button').removeClass('active') $(this).addClass('active') }); +// Font size reset $('#medA').click(function() { - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content h1').css('font','600 18px/1.2 Arial'); - $('.content h2').css('font','600 16px/1.2 Arial'); - $('.content h3').css('font','600 14px/1.2 Arial'); - $('.content p').css('font','13px/20px Verdana'); - $('.content li').css('font','400 13px/1 Verdana'); - $('.content li').css('line-height','14px'); - $('.content .toc li').css('font', 'normal 10px/1.2 Verdana'); - $('.content table').css('font','13px/1.2 Verdana'); - $('.content .heading').css('font','600 16px/1 Arial'); - $('.content .indexboxcont li').css('font','600 13px/1 Verdana'); + $('.mainContent .heading').css('font','600 16px/1 Arial'); + $('.mainContent h1').css('font','600 18px/1.2 Arial'); + $('.mainContent h2').css('font','600 16px/1.2 Arial'); + $('.mainContent h3').css('font','600 14px/1.2 Arial'); + $('.mainContent p').css('font','13px/20px Verdana'); + $('.mainContent li').css('font','400 13px/1 Verdana'); + $('.mainContent li').css('line-height','14px'); + $('.mainContent .toc li').css('font', 'normal 10px/1.2 Verdana'); + $('.mainContent table').css('font','13px/1.2 Verdana'); + $('.mainContent .heading').css('font','600 16px/1 Arial'); + $('.mainContent .indexboxcont li').css('font','600 13px/1 Verdana'); $('.t_button').removeClass('active') $(this).addClass('active') }); +// Font size large $('#bigA').click(function() { - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('font-size','large'); - $('.content .heading,.content h1, .content h2, .content h3, .content p, .content li, .content table').css('line-height','25px'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large'); + $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px'); $('.t_button').removeClass('active') $(this).addClass('active') }); +// Show page content after closing feedback box $('.feedclose').click(function() { $('.bd').show(); $('.hd').show(); @@ -41,6 +60,7 @@ $('.feedclose').click(function() { $('#blurpage').hide(); }); +// Hide page content and show feedback box $('.feedback').click(function() { $('.bd').hide(); $('.hd').hide(); @@ -48,71 +68,93 @@ $('.feedback').click(function() { $('#feedbackBox').show(); $('#blurpage').show(); }); -var lookupCount = 0; -var articleCount = 0; -var exampleCount = 0; -var qturl = ""; // change from "http://doc.qt.nokia.com/4.6/" to 0 so we can have relative links +// Setting URL - in this case relative to root +var qturl = ""; + +// Process data sent back from the server. The data is structured as a XML. +/* +XML structure handled by function processNokiaData() + - container for each page returned + - contains keywords + - contains page title/header content + - contains page URL - URL relative to root + - contains page type - APIPage/Article/Example + +*/ + function processNokiaData(response){ var propertyTags = response.getElementsByTagName('page'); - for (var i=0; i< propertyTags.length; i++) { - var linkStart = "
  • " + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd; - $('#ul001').append(full_li_element); - $('#ul001 .defaultLink').css('display','none'); - - } - } - - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Article'){ - articleCount++; - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - - $('#ul002').append(full_li_element); - $('#ul002 .defaultLink').css('display','none'); - - } - } - if(propertyTags[i].getElementsByTagName('pageType')[0].firstChild.nodeValue == 'Example'){ - exampleCount++; - - - for (var j=0; j< propertyTags[i].getElementsByTagName('pageWords').length; j++){ - full_li_element = linkStart + propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; - full_li_element =full_li_element + "'>" + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + linkEnd ; - - $('#ul003').append(full_li_element); - $('#ul003 .defaultLink').css('display','none'); - - } - } - if(i==propertyTags.length){$('#pageType').removeClass('loading');} - - } - if(lookupCount > 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('
  • Found ' + lookupCount + ' hits
  • ');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} - if(articleCount > 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('
  • Found ' + articleCount + ' hits
  • ');$('#ul002 li').css('display','block');} - if(exampleCount > 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('
  • Found ' + articleCount + ' hits
  • ');$('#ul003 li').css('display','block');} - - if(lookupCount == 0){$('#ul001 .menuAlert').remove();$('#ul001').prepend('
  • Found no result
  • ');$('#ul001 li').css('display','block');$('.sidebar .search form input').removeClass('loading');} - if(articleCount == 0){$('#ul002 .menuAlert').remove();$('#ul002').prepend('
  • Found no result
  • ');$('#ul002 li').css('display','block');} - if(exampleCount == 0){$('#ul003 .menuAlert').remove();$('#ul003').prepend('
  • Found no result
  • ');$('#ul003 li').css('display','block');} - // reset count variables; - lookupCount=0; - articleCount = 0; - exampleCount = 0; + var apiCount = 0; + var articleCount = 0; + var exampleCount = 0; + var full_li_element; + + $('#resultlist li').remove(); + + + for (var i=0; i'; + $('#resultlist').append(full_li_element); + } + } + + if (propertyTags.length > 0) { + $('#resultdialog').addClass('active'); + $('#resultcount').html(propertyTags.length); + $('#apicount').html(apiCount); + $('#articlecount').html(articleCount); + $('#examplecount').html(exampleCount); + } + + // Filtering results in display + $('p#resultlinks a').click(function(e) { + e.preventDefault(); + // Displays API ref pages + if (this.id == "showapiresults") { + $("#resultlist").removeClass().addClass('api'); + $("#resultlinks").removeClass().addClass('api'); + $("#searchcount").removeClass().addClass('api'); + } + // Displays Articles + else if (this.id == "showarticleresults") { + $("#resultlist").removeClass().addClass('article'); + $("#resultlinks").removeClass().addClass('article'); + $("#searchcount").removeClass().addClass('article'); + } + // Displays Examples + if (this.id == "showexampleresults") { + $("#resultlist").removeClass().addClass('example'); + $("#resultlinks").removeClass().addClass('example'); + $("#searchcount").removeClass().addClass('example'); + } + // Displays All + if (this.id == "showallresults") { + $("#resultlist").removeClass().addClass('all'); + $("#resultlinks").removeClass().addClass('all'); + $("#searchcount").removeClass().addClass('all'); + } + }); } + //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; function CheckEmptyAndLoadList() @@ -129,27 +171,22 @@ function CheckEmptyAndLoadList() var value = document.getElementById('pageType').value; if((blankRE.test(value)) || (value.length < 3)) { - //empty inputbox - // load default li elements into the ul if empty - // loadAllList(); // replaced + + + $('.defaultLink').css('display','block'); - // $('.liveResult').css('display','none'); + + $('#resultdialog').removeClass('active'); + $('#resultlist li').remove(); }else{ - $('.defaultLink').css('display','none'); + } } -/* -$(window).resize(function(){ -if($(window).width()<400) - $('body').addClass('offline'); -else - $('body').removeClass('offline'); - }); - */ -// Loads on doc ready + +// Loads on doc ready - prepares search $(document).ready(function () { - //alert(pageUrl); - //$('#pageUrl').attr('foo',pageUrl); + + var pageTitle = $('title').html(); var currentString = $('#pageType').val() ; if(currentString.length < 1){ @@ -165,14 +202,14 @@ else $('.searching').remove(); CheckEmptyAndLoadList(); $('.report').remove(); - // debug$('.content').prepend('
  • too short or blank
  • '); // debug + return; } if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { $('#pageType').addClass('loading'); $('.searching').remove(); - $('.list ul').prepend(''); + $.ajax({ contentType: "application/x-www-form-urlencoded", url: 'http://' + location.host + '/nokiasearch/GetDataServlet', @@ -184,7 +221,7 @@ else $('.liveResult').remove(); $('.searching').remove(); $('#pageType').removeClass('loading'); - $('.list ul').prepend(''); + processNokiaData(response); } diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 44aa918..0d6cb8d 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -71,6 +71,13 @@ HTML.postheader = "
    \n" \ "
    \n" \ "
    \n" \ " \n" \ + "
    \n" \ + " Close \n" \ + "

    All | API | Articles | Examples

    \n" \ + "

     results:

    \n" \ + "
      \n" \ + "
    \n" \ + "
    \n" \ "
    \n" \ "
    \n" \ "
    \n" \ @@ -135,7 +142,7 @@ HTML.postpostheader = " \n" \ " \n" \ " \n" \ " \n" \ - "
    \n" + "
    \n" HTML.footer = "" \ "
    \n" \ -- cgit v0.12 From 38449f8700da5c673b95a394cf9b7543904cb10c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 Sep 2010 00:03:43 +0300 Subject: Reference to QStringList::find() is incorrect, should be QStringList::filter(). Task-number: QTBUG-9248 --- 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 5be885b..dba53af 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -565,7 +565,7 @@ const QString::Null QString::null = { }; and join a list of strings into a single string with an optional separator using QStringList::join(). You can obtain a list of strings from a string list that contain a particular substring or - that match a particular QRegExp using the QStringList::find() + that match a particular QRegExp using the QStringList::filter() function. : \section1 Querying String Data -- cgit v0.12 From 5b7c9baea08125a51e7ecb318e4579f0fe4eef0c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 Sep 2010 00:04:34 +0300 Subject: Remove obsolete reference to qregexp.tex. According to history, this file hasn't really been maintained since 3.x times, and hasn't existed in the source tree for quite a while. --- src/corelib/tools/qregexp.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 36827d0..a8bf38f 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -74,10 +74,6 @@ int qFindString(const QChar *haystack, int haystackLen, int from, #define RXERR_INTERVAL QT_TRANSLATE_NOOP("QRegExp", "invalid interval") #define RXERR_CATEGORY QT_TRANSLATE_NOOP("QRegExp", "invalid category") -/* - WARNING! Be sure to read qregexp.tex before modifying this file. -*/ - /*! \class QRegExp \reentrant -- cgit v0.12 From 59949ff908995158462d456c14d4a3a10b19418e Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 28 Sep 2010 01:43:36 +0300 Subject: Fix a link that no longer exists in documentation. Best to keep them up to date, even though that link isn't really used for anything except to make a point. Task-number: QTWEBSITE-13 --- src/corelib/global/qnamespace.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 5cd7f0e..87af61a 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2767,7 +2767,7 @@ \value ElideNone Ellipsis should NOT appear in the text. Qt::ElideMiddle is normally the most appropriate choice for URLs (e.g., - "\l{http://qt.nokia.com/careers/movingto/brisbane/}{http://qt.nok...ovingto/brisbane/}"), + "\l{http://bugreports.qt.nokia.com/browse/QTWEBSITE-13}{http://bugreports.qt.../QTWEBSITE-13/}"), whereas Qt::ElideRight is appropriate for other strings (e.g., "\l{http://qt.nokia.com/doc/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). -- cgit v0.12 From a21b6be2e97b2678111930bc04eaa843b42fa22b Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Tue, 28 Sep 2010 11:39:38 +0200 Subject: Doc: Added lisence header to snippet --- doc/src/snippets/widgetprinting.cpp | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/src/snippets/widgetprinting.cpp b/doc/src/snippets/widgetprinting.cpp index b3d5b7c..47839d8 100644 --- a/doc/src/snippets/widgetprinting.cpp +++ b/doc/src/snippets/widgetprinting.cpp @@ -1,3 +1,42 @@ +/**************************************************************************** +** +** 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 documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ #include -- cgit v0.12 From d462d0af6fd4ad2fa21ab2f5364754fcb1a9af50 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 28 Sep 2010 11:45:59 +0200 Subject: Doc: fixing bugs in slim-fit style --- doc/src/template/style/narrow.css | 6 +++--- tools/qdoc3/test/qt-html-templates.qdocconf | 31 ----------------------------- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index de5b0a0..00d28b9 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -6,7 +6,7 @@ } .narrow a { - color: #44a51c; + color: #00732f; } .narrow .header, .narrow .header .content, .narrow .footer, .narrow .wrapper { @@ -45,7 +45,7 @@ { width: auto; height: auto; - color: #363534; + color: #00732f; position: static; float: left; margin-left: 25px; @@ -163,7 +163,7 @@ } .narrow .wrap .breadcrumb ul li a { - color: #44a51c; + color: #00732f; } .narrow .wrap .breadcrumb ul li.last a { diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 44aa918..9609714 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -26,37 +26,6 @@ HTML.postheader = "
    \n" \ " \n" \ " \n" \ "
    \n" \ - " \n" \ "
    \n" \ "
    \n" \ "
    \n" \ -- cgit v0.12 From 5b053a355a6186fdcfa26d3337ad9eaebce00b01 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 28 Sep 2010 13:15:27 +0200 Subject: Doc: add style to new search results --- doc/src/template/style/style.css | 80 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 614e296..c172e23 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -528,6 +528,8 @@ height:21px; padding:2px 0 0 5px; width:167px; + _height: 23px; + _width: 169px; } .sidebar .search form input#pageType @@ -645,6 +647,81 @@ .floatingResult:hover{ } + + #resultdialog { + display: none; + position: absolute; + *left: 30px; + _left: 0; + *top: 35px; + _top: 30px; + _zoom: 1; + background-color: #fff; + border: 1px solid #666; + z-index: 4; + margin-top: 5px; + _margin: 0 0 0 -20px; + padding: 10px; + width: 220px; + _width: 196px; + height: 250px; + overflow: auto; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + border-radius: .5em; + -webkit-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + -moz-box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + box-shadow: 0 4px 6px 0 rgba(0,0,0,.2); + } + + #resultdialog.active { + display: block; + } + + #resultdialog #resultclose { + float: right; + } + + #resultdialog p, + #resultdialog ul { + clear: both; + margin: 3px 0; + } + + p#searchcount span { + display: none; + } + + p#searchcount.all span#resultcount, + p#searchcount.api span#apicount, + p#searchcount.article span#articlecount, + p#searchcount.example span#examplecount { + display: inline; + } + + #resultlist li { + display: none; + } + + #resultlist.api li.api, + #resultlist.article li.article, + #resultlist.example li.example, + #resultlist.all li { + display: block; + } + + #resultlinks.api a#showapiresults, + #resultlinks.api a#showapiresults:hover, + #resultlinks.article a#showarticleresults, + #resultlinks.article a#showarticleresults:hover, + #resultlinks.example a#showexampleresults, + #resultlinks.example a#showexampleresults:hover, + #resultlinks.all a#showallresults, + #resultlinks.all a#showallresults:hover { + color: #B0ADAB; + } + + /* end sidebar elements */ /* content elements */ .wrap @@ -1344,7 +1421,8 @@ .creator .wrapper .hd, .creator .wrapper .ft, .creator .sidebar, - .creator .wrap .feedback + .creator .wrap .feedback, + .creator #resultdialog { display:none; } -- cgit v0.12 From 148e78525f76d3d716fd98af2a018cd08da541ab Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 28 Sep 2010 13:44:19 +0200 Subject: Doc: fixing slim fit style - search box. --- doc/src/template/style/narrow.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index 00d28b9..8e42a0d 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -203,11 +203,7 @@ *border: 1px solid #fff; *height: 17px; _height: 18px; - /* to be fixed */ - display: none; - /* to be fixed */ } - .narrow .indexbox .indexIcon { display: none; } @@ -268,3 +264,6 @@ } /* end narrow mode */ + .creator #narrowsearch, .creator #narrowmenu{ + display:none; + } -- cgit v0.12 From 8c65dc25962e167237c2573979b1dfff88c29326 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 29 Sep 2010 16:05:51 +0200 Subject: Doc: Implementing new doc search dialog. Removing search results from menus and including them in a floating dialog div element --- doc/src/template/scripts/functions.js | 87 ++++++++++++++++----------- doc/src/template/scripts/narrow.js | 108 ++++++++++++++++++++++++---------- doc/src/template/style/style.css | 45 +++++++------- 3 files changed, 152 insertions(+), 88 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 5bf8323..0bb88a8 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -1,11 +1,12 @@ // Removing search results function hideSearchResults() { +/* hiding search results as the user clicks on the different categories */ $('#resultdialog').removeClass('active'); $("#resultlist").removeClass().addClass('all'); $("#resultlinks").removeClass().addClass('all'); $("#searchcount").removeClass().addClass('all'); } -// Closing search result box +/* closing the searhc result dialog */ $('#resultclose').click(function(e) { e.preventDefault(); hideSearchResults(); @@ -19,14 +20,14 @@ $('.t_button').mouseover(function() { $('.t_button').css('cursor','pointer'); }); /* END non link areas */ -// Font size small +/* Changing font size to smaller */ $('#smallA').click(function() { $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','smaller'); $('.t_button').removeClass('active') $(this).addClass('active') }); -// Font size reset +/* Reset font size */ $('#medA').click(function() { $('.mainContent .heading').css('font','600 16px/1 Arial'); $('.mainContent h1').css('font','600 18px/1.2 Arial'); @@ -42,8 +43,7 @@ $('#medA').click(function() { $('.t_button').removeClass('active') $(this).addClass('active') }); - -// Font size large +/* Changing font size to bigger */ $('#bigA').click(function() { $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('font-size','large'); $('.mainContent .heading,.mainContent h1, .mainContent h2, .mainContent h3, .mainContent p, .mainContent li, .mainContent table').css('line-height','25px'); @@ -51,7 +51,7 @@ $('#bigA').click(function() { $(this).addClass('active') }); -// Show page content after closing feedback box +/* Show page content after closing feedback box */ $('.feedclose').click(function() { $('.bd').show(); $('.hd').show(); @@ -60,7 +60,7 @@ $('.feedclose').click(function() { $('#blurpage').hide(); }); -// Hide page content and show feedback box +/* Hide page content and show feedback box */ $('.feedback').click(function() { $('.bd').hide(); $('.hd').hide(); @@ -68,9 +68,11 @@ $('.feedback').click(function() { $('#feedbackBox').show(); $('#blurpage').show(); }); -// Setting URL - in this case relative to root +/* Default search URL */ var qturl = ""; +/* The next function handles the response data (in xml) returned by the search engine */ + // Process data sent back from the server. The data is structured as a XML. /* XML structure handled by function processNokiaData() @@ -84,47 +86,62 @@ XML structure handled by function processNokiaData() function processNokiaData(response){ +/* fetch the responce from the server using page as the root element */ var propertyTags = response.getElementsByTagName('page'); - - var apiCount = 0; + /* reset counters */ + var lookupCount = 0; var articleCount = 0; var exampleCount = 0; - var full_li_element; +/* remove any old results */ $('#resultlist li').remove(); + /* running through the elements in the xml structure */ for (var i=0; i'; - $('#resultlist').append(full_li_element); - } + /* adding the URL attribute*/ + full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; + /* adding the link title and closing the link and list elements */ + full_li_element += '">' + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + ''; + /* appending the list element to the #resultlist div*/ + $('#resultlist').append(full_li_element); + } } + /* if the result is not empty */ if (propertyTags.length > 0) { + /* add class name active to show the dialog */ $('#resultdialog').addClass('active'); + /* setting number of hits*/ $('#resultcount').html(propertyTags.length); $('#apicount').html(apiCount); $('#articlecount').html(articleCount); $('#examplecount').html(exampleCount); } + // Filtering results in display $('p#resultlinks a').click(function(e) { e.preventDefault(); @@ -157,8 +174,11 @@ function processNokiaData(response){ //build regular expression object to find empty string or any number of blank var blankRE=/^\s*$/; + + function CheckEmptyAndLoadList() { + /* Start Extracting information for feedback and adding this to the feedback form */ var pageUrl = window.location.href; var pageVal = $('title').html(); $('#feedUrl').remove(); @@ -166,50 +186,52 @@ function CheckEmptyAndLoadList() $('.menuAlert').remove(); $('#feedform').append(''); $('#feedform').append(''); - $('.liveResult').remove(); - $('.defaultLink').css('display','block'); + /* End Extracting information for feedback and adding this to the feedback form */ + + /* extracts search query */ var value = document.getElementById('pageType').value; + /* if the search is less than three chars long remove class names and remove elements from old search*/ if((blankRE.test(value)) || (value.length < 3)) { - - - - $('.defaultLink').css('display','block'); - $('#resultdialog').removeClass('active'); $('#resultlist li').remove(); - }else{ - } } // Loads on doc ready - prepares search $(document).ready(function () { - - + /* fetch page title*/ var pageTitle = $('title').html(); + /* getting content from search box */ var currentString = $('#pageType').val() ; + /* if the search box is not empty run CheckEmptyAndLoadList*/ if(currentString.length < 1){ - $('.defaultLink').css('display','block'); CheckEmptyAndLoadList(); } + /* on key-up in the search box execute the following */ $('#pageType').keyup(function () { + /* extract the search box content */ var searchString = $('#pageType').val() ; + /* if the string is less than three characters */ if ((searchString == null) || (searchString.length < 3)) { + /* remove classes and elements*/ $('#pageType').removeClass('loading'); - $('.liveResult').remove(); $('.searching').remove(); + /* run CheckEmptyAndLoadList */ CheckEmptyAndLoadList(); - $('.report').remove(); + $('.report').remove(); return; } + /* if timer checks out */ if (this.timer) clearTimeout(this.timer); this.timer = setTimeout(function () { + /* add loading image by adding loading class */ $('#pageType').addClass('loading'); $('.searching').remove(); + /* run the actual search */ $.ajax({ contentType: "application/x-www-form-urlencoded", url: 'http://' + location.host + '/nokiasearch/GetDataServlet', @@ -217,8 +239,7 @@ function CheckEmptyAndLoadList() dataType:'xml', type: 'post', success: function (response, textStatus) { - - $('.liveResult').remove(); + /* on success remove loading img */ $('.searching').remove(); $('#pageType').removeClass('loading'); @@ -226,6 +247,6 @@ function CheckEmptyAndLoadList() } }); - }, 500); + }, 500); /* timer set to 500 ms */ }); - }); + }); \ No newline at end of file diff --git a/doc/src/template/scripts/narrow.js b/doc/src/template/scripts/narrow.js index 35c81bf..a5e8b97 100644 --- a/doc/src/template/scripts/narrow.js +++ b/doc/src/template/scripts/narrow.js @@ -1,17 +1,15 @@ +/* This function generates menus and search box in narrow/slim fit mode */ var narrowInit = function() { - /* TODO: - Could probably be more efficient, not hardcoding each element to be created - */ - // 1: Create search form + /* 1: Create search form */ var narrowSearch = $('
    '); var searchform = $("#qtdocsearch"); narrowSearch.append(searchform); $("#qtdocheader .content .qtref").after(narrowSearch); - // 2: Create dropdowns + /* 2: Create dropdowns */ var narrowmenu = $('
      '); - // Lookup + /* Lookup */ var lookuptext = $("#lookup h2").attr("title"); $("#lookup ul").removeAttr("id"); $("#lookup ul li").removeAttr("class"); @@ -24,7 +22,7 @@ var narrowInit = function() { lookuplist.append(lookupul); narrowmenu.append(lookuplist); - // Topics + /* Topics */ var topicstext = $("#topics h2").attr("title"); $("#topics ul").removeAttr("id"); $("#topics ul li").removeAttr("class"); @@ -37,7 +35,7 @@ var narrowInit = function() { topicslist.append(topicsul); narrowmenu.append(topicslist); - // Examples + /* Examples */ var examplestext = $("#examples h2").attr("title"); $("#examples ul").removeAttr("id"); $("#examples ul li").removeAttr("class"); @@ -58,32 +56,78 @@ var narrowInit = function() { }); } +/* Executes on doc ready */ $(document).ready(function(){ -/* if ($('body').hasClass('narrow')) { - narrowInit(); - } - */ - if($(window).width()<600) { - $('body').addClass('narrow'); - - if ($("#narrowsearch").length == 0) { - narrowInit(); - } - } - else { - $('body').removeClass('narrow'); + /* check if body has the narrow class */ + if ($('body').hasClass('narrow')) { + /* run narrowInit */ + narrowInit(); + } + + /* messure window width and add class if it is smaller than 600 px */ + if($(window).width()<600) { + $('body').addClass('narrow'); + /* if the search box contains */ + if ($("#narrowsearch").length == 0) { + /* run narrowInit */ + narrowInit(); + } + } + else { /* if the window is wider than 600 px, narrow is removed */ + $('body').removeClass('narrow'); + if ($("#narrowsearch").length == 0) { + } + } +}); +/* binding resize event to this funciton */ +$(window).bind('resize', function () { + /* if the window is wider than 600 px, narrow class is added */ + if($(window).width()<600) { + $('body').addClass('narrow'); + if ($("#narrowsearch").length == 0) { + narrowInit(); + } + } + else { + /* else we remove the narrow class */ + $('body').removeClass('narrow'); } }); -$(window).bind('resize', function () { - if($(window).width()<600) { - $('body').addClass('narrow'); + $('#narrowsearch').keyup(function () { + /* extract the search box content */ + var searchString = $('#narrowsearch').val(); + /* if the string is less than three characters */ + if ((searchString == null) || (searchString.length < 3)) { + /* remove classes and elements*/ + $('#narrowsearch').removeClass('loading'); + $('.searching').remove(); + /* run CheckEmptyAndLoadList */ + CheckEmptyAndLoadList(); + + $('.report').remove(); + return; + } + /* if timer checks out */ + if (this.timer) clearTimeout(this.timer); + this.timer = setTimeout(function () { + /* add loading image by adding loading class */ + $('#narrowsearch').addClass('loading'); + $('.searching').remove(); - if ($("#narrowsearch").length == 0) { - narrowInit(); - } - } - else { - $('body').removeClass('narrow'); - } -}); \ No newline at end of file + /* run the actual search */ + $.ajax({ + contentType: "application/x-www-form-urlencoded", + url: 'http://' + location.host + '/nokiasearch/GetDataServlet', + data: 'searchString='+searchString, + dataType:'xml', + type: 'post', + success: function (response, textStatus) { + /* on success remove loading img */ + $('.searching').remove(); + $('#narrowsearch').removeClass('loading'); + processNokiaData(response); + } + }); + }, 500); /* timer set to 500 ms */ + }); \ No newline at end of file diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index c172e23..5833266 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -528,8 +528,6 @@ height:21px; padding:2px 0 0 5px; width:167px; - _height: 23px; - _width: 169px; } .sidebar .search form input#pageType @@ -629,25 +627,11 @@ background:url("../images/spinner.gif") no-repeat scroll right center transparent; } -.floatingResult{ - z-index:1; - position:relative; - padding-top:0px; - background-color:white; - border:solid 1px black; - height:250px; - width:600px; - overflow-x:hidden; - overflow-y:auto; -} - - .floatingResult:hover{ - display:block; - } - .floatingResult:hover{ + .sidebar .search form { + _height: 23px; + _width: 169px; } - - + #resultdialog { display: none; position: absolute; @@ -720,7 +704,23 @@ #resultlinks.all a#showallresults:hover { color: #B0ADAB; } - + .floatingResult{ + z-index:1; + position:relative; + padding-top:0px; + background-color:white; + border:solid 1px black; + height:250px; + width:600px; + overflow-x:hidden; + overflow-y:auto; + } + + .floatingResult:hover{ + display:block; + } + .floatingResult:hover{ + } /* end sidebar elements */ /* content elements */ @@ -1421,8 +1421,7 @@ .creator .wrapper .hd, .creator .wrapper .ft, .creator .sidebar, - .creator .wrap .feedback, - .creator #resultdialog + .creator .wrap .feedback { display:none; } -- cgit v0.12 From 1e2958e7a12de7cba30b02657c02320945bb1e3d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 1 Oct 2010 10:18:03 +1000 Subject: Documentation: input to Qt.rgba should be from 0-1, not 0-255. --- src/declarative/qml/qdeclarativeengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 724553f..bbd3ac1 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -207,7 +207,7 @@ For example: import QtQuick 1.0 Text { - color: Qt.rgba(255, 0, 0, 1) + color: Qt.rgba(1, 0, 0, 1) text: Qt.md5("hello, world") } \endqml -- cgit v0.12 From 394651a222b9b200b793dbf86fadc52b5a546915 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 1 Oct 2010 10:36:34 +1000 Subject: Apply the QStaticText text-caching strategy for QML QML cannot use QStaticText directly as it doesn't support caching a QTextLayout. QDeclarativeTextLayout is basically a copy of QStaticText that adds this support. Currently this feature is disabled by default (enable with QML_DISABLE_IMAGE_CACHE=1) while we double check the perf consequences of this change. Task-number: QTBUG-14050 --- src/declarative/declarative.pro | 4 + src/declarative/graphicsitems/graphicsitems.pri | 7 +- src/declarative/graphicsitems/qdeclarativetext.cpp | 36 ++- .../graphicsitems/qdeclarativetext_p_p.h | 19 +- .../graphicsitems/qdeclarativetextlayout.cpp | 308 +++++++++++++++++++++ .../graphicsitems/qdeclarativetextlayout_p.h | 23 ++ 6 files changed, 369 insertions(+), 28 deletions(-) create mode 100644 src/declarative/graphicsitems/qdeclarativetextlayout.cpp create mode 100644 src/declarative/graphicsitems/qdeclarativetextlayout_p.h diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index 510e7a5..299ca06 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -26,3 +26,7 @@ include(qml/qml.pri) include(debugger/debugger.pri) symbian:TARGET.UID3=0x2001E623 + +DEFINES += QT_NO_OPENTYPE +INCLUDEPATH += ../3rdparty/harfbuzz/src + diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri index d420595..ffdeb29 100644 --- a/src/declarative/graphicsitems/graphicsitems.pri +++ b/src/declarative/graphicsitems/graphicsitems.pri @@ -49,7 +49,8 @@ HEADERS += \ $$PWD/qdeclarativelistview_p.h \ $$PWD/qdeclarativelayoutitem_p.h \ $$PWD/qdeclarativeitemchangelistener_p.h \ - $$PWD/qdeclarativegraphicswidget_p.h + $$PWD/qdeclarativegraphicswidget_p.h \ + $$PWD/qdeclarativetextlayout_p.h SOURCES += \ $$PWD/qdeclarativeitemsmodule.cpp \ @@ -81,4 +82,6 @@ SOURCES += \ $$PWD/qdeclarativevisualitemmodel.cpp \ $$PWD/qdeclarativelistview.cpp \ $$PWD/qdeclarativelayoutitem.cpp \ - $$PWD/qdeclarativegraphicswidget.cpp + $$PWD/qdeclarativegraphicswidget.cpp \ + $$PWD/qdeclarativetextlayout.cpp + diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 1f4c1c7..c2dd850 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -82,6 +82,19 @@ private: static QSet errors; }; +DEFINE_BOOL_CONFIG_OPTION(disableImageCache, QML_DISABLE_IMAGE_CACHE); + +QDeclarativeTextPrivate::QDeclarativeTextPrivate() +: color((QRgb)0), style(QDeclarativeText::Normal), + hAlign(QDeclarativeText::AlignLeft), vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone), + imgDirty(true), dirty(true), richText(false), singleline(false), cache(true), internalWidthUpdate(false), doc(0), + format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap) +{ + cache = !disableImageCache(); + QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton; + QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; +} + QTextDocumentWithImageResources::QTextDocumentWithImageResources(QDeclarativeText *parent) : QTextDocument(parent), outstanding(0) { @@ -145,7 +158,6 @@ void QTextDocumentWithImageResources::requestFinished() void QTextDocumentWithImageResources::setText(const QString &text) { if (!m_resources.isEmpty()) { - qWarning("CLEAR"); qDeleteAll(m_resources); m_resources.clear(); outstanding = 0; @@ -792,7 +804,7 @@ void QDeclarativeTextPrivate::updateSize() //setup instance of QTextLayout for all cases other than richtext if (!richText) { - size = setupTextLayout(&layout); + size = setupTextLayout(); if (cachedLayoutSize != size) { q->prepareGeometryChange(); cachedLayoutSize = size; @@ -907,10 +919,10 @@ void QDeclarativeTextPrivate::drawOutline(int yOffset) imgCache = img; } -QSize QDeclarativeTextPrivate::setupTextLayout(QTextLayout *layout) +QSize QDeclarativeTextPrivate::setupTextLayout() { Q_Q(QDeclarativeText); - layout->setCacheEnabled(true); + layout.setCacheEnabled(true); int height = 0; qreal widthUsed = 0; @@ -920,25 +932,25 @@ QSize QDeclarativeTextPrivate::setupTextLayout(QTextLayout *layout) if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid()) lineWidth = q->width(); - QTextOption textOption = layout->textOption(); + QTextOption textOption = layout.textOption(); textOption.setWrapMode(QTextOption::WrapMode(wrapMode)); - layout->setTextOption(textOption); + layout.setTextOption(textOption); - layout->beginLayout(); + layout.beginLayout(); while (1) { - QTextLine line = layout->createLine(); + QTextLine line = layout.createLine(); if (!line.isValid()) break; if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid()) line.setLineWidth(lineWidth); } - layout->endLayout(); + layout.endLayout(); int x = 0; - for (int i = 0; i < layout->lineCount(); ++i) { - QTextLine line = layout->lineAt(i); + for (int i = 0; i < layout.lineCount(); ++i) { + QTextLine line = layout.lineAt(i); widthUsed = qMax(widthUsed, line.naturalTextWidth()); line.setPosition(QPointF(0, height)); height += int(line.height()); @@ -1000,7 +1012,7 @@ void QDeclarativeTextPrivate::drawWrappedText(QPainter *p, const QPointF &pos, b else p->setPen(color); p->setFont(font); - layout.draw(p, pos); + layout.draw(p , pos); } QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle) diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h index 48552a7..ba1ec78 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h @@ -55,6 +55,7 @@ #include "qdeclarativeitem.h" #include "private/qdeclarativeitem_p.h" +#include "private/qdeclarativetextlayout_p.h" #include @@ -65,22 +66,12 @@ QT_BEGIN_NAMESPACE class QTextLayout; class QTextDocumentWithImageResources; +#define QML_NO_TEXT_CACHE class QDeclarativeTextPrivate : public QDeclarativeItemPrivate { Q_DECLARE_PUBLIC(QDeclarativeText) public: - QDeclarativeTextPrivate() - : color((QRgb)0), style(QDeclarativeText::Normal), - hAlign(QDeclarativeText::AlignLeft), vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone), - imgDirty(true), dirty(true), richText(false), singleline(false), cache(true), internalWidthUpdate(false), doc(0), - format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap) - { -#if defined(QML_NO_TEXT_CACHE) - cache = false; -#endif - QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton; - QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; - } + QDeclarativeTextPrivate(); ~QDeclarativeTextPrivate(); @@ -101,7 +92,7 @@ public: QPixmap wrappedTextImage(bool drawStyle); void drawWrappedText(QPainter *p, const QPointF &pos, bool drawStyle); QPixmap richTextImage(bool drawStyle); - QSize setupTextLayout(QTextLayout *layout); + QSize setupTextLayout(); QString text; QFont font; @@ -121,7 +112,7 @@ public: bool cache:1; bool internalWidthUpdate:1; QTextDocumentWithImageResources *doc; - QTextLayout layout; + QDeclarativeTextLayout layout; QSize cachedLayoutSize; QDeclarativeText::TextFormat format; QDeclarativeText::WrapMode wrapMode; diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp new file mode 100644 index 0000000..5972f92 --- /dev/null +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -0,0 +1,308 @@ +#include "qdeclarativetextlayout_p.h" +#include +#include +#include +#include +#include + +class QDeclarativeTextLayoutPrivate +{ +public: + QDeclarativeTextLayoutPrivate() + : cached(false) {} + + QPointF position; + + bool cached; + QVector items; + QVector positions; + QVector glyphs; + QVector chars; +}; + +Q_GUI_EXPORT extern int qt_defaultDpiX(); +Q_GUI_EXPORT extern int qt_defaultDpiY(); + +namespace { +class DrawTextItemRecorder: public QPaintEngine +{ + public: + DrawTextItemRecorder(bool untransformedCoordinates, bool useBackendOptimizations) + : m_inertText(0), m_dirtyPen(false), m_useBackendOptimizations(useBackendOptimizations), + m_untransformedCoordinates(untransformedCoordinates) + { + } + + virtual void updateState(const QPaintEngineState &newState) + { + if (newState.state() & QPaintEngine::DirtyPen) + m_dirtyPen = true; + } + + virtual void drawTextItem(const QPointF &position, const QTextItem &textItem) + { + int glyphOffset = m_inertText->glyphs.size(); // Store offset into glyph pool + int positionOffset = m_inertText->glyphs.size(); // Offset into position pool + int charOffset = m_inertText->chars.size(); + + const QTextItemInt &ti = static_cast(textItem); + + bool needFreshCurrentItem = true; + if (!m_inertText->items.isEmpty()) { + QStaticTextItem &last = m_inertText->items[m_inertText->items.count() - 1]; + + if (last.fontEngine == ti.fontEngine && last.font == ti.font() && + (!m_dirtyPen || last.color == state->pen().color())) { + needFreshCurrentItem = false; + + last.numChars += ti.num_chars; + last.numGlyphs += ti.glyphs.numGlyphs; + + } + } + + if (needFreshCurrentItem) { + QStaticTextItem currentItem; + + currentItem.fontEngine = ti.fontEngine; + currentItem.font = ti.font(); + currentItem.charOffset = charOffset; + currentItem.numChars = ti.num_chars; + currentItem.numGlyphs = ti.glyphs.numGlyphs; + currentItem.glyphOffset = glyphOffset; + currentItem.positionOffset = positionOffset; + currentItem.useBackendOptimizations = m_useBackendOptimizations; + if (m_dirtyPen) + currentItem.color = state->pen().color(); + + m_inertText->items.append(currentItem); + } + + QTransform matrix = m_untransformedCoordinates ? QTransform() : state->transform(); + matrix.translate(position.x(), position.y()); + + QVarLengthArray glyphs; + QVarLengthArray positions; + ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); + + int size = glyphs.size(); + Q_ASSERT(size == ti.glyphs.numGlyphs); + Q_ASSERT(size == positions.size()); + + m_inertText->glyphs.resize(m_inertText->glyphs.size() + size); + m_inertText->positions.resize(m_inertText->glyphs.size()); + m_inertText->chars.resize(m_inertText->chars.size() + ti.num_chars); + + glyph_t *glyphsDestination = m_inertText->glyphs.data() + glyphOffset; + qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * ti.glyphs.numGlyphs); + + QFixedPoint *positionsDestination = m_inertText->positions.data() + positionOffset; + qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * ti.glyphs.numGlyphs); + + QChar *charsDestination = m_inertText->chars.data() + charOffset; + qMemCopy(charsDestination, ti.chars, sizeof(QChar) * ti.num_chars); + + } + + virtual void drawPolygon(const QPointF *, int , PolygonDrawMode ) + { + /* intentionally empty */ + } + + virtual bool begin(QPaintDevice *) { return true; } + virtual bool end() { return true; } + virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &) {} + virtual Type type() const + { + return User; + } + + void begin(QDeclarativeTextLayoutPrivate *t) { + m_inertText = t; + m_dirtyPen = false; + } + + private: + QDeclarativeTextLayoutPrivate *m_inertText; + + bool m_dirtyPen; + bool m_useBackendOptimizations; + bool m_untransformedCoordinates; +}; + +class DrawTextItemDevice: public QPaintDevice +{ + public: + DrawTextItemDevice(bool untransformedCoordinates, bool useBackendOptimizations) + { + m_paintEngine = new DrawTextItemRecorder(untransformedCoordinates, + useBackendOptimizations); + } + + ~DrawTextItemDevice() + { + delete m_paintEngine; + } + + void begin(QDeclarativeTextLayoutPrivate *t) { + m_paintEngine->begin(t); + } + + int metric(PaintDeviceMetric m) const + { + int val; + switch (m) { + case PdmWidth: + case PdmHeight: + case PdmWidthMM: + case PdmHeightMM: + val = 0; + break; + case PdmDpiX: + case PdmPhysicalDpiX: + val = qt_defaultDpiX(); + break; + case PdmDpiY: + case PdmPhysicalDpiY: + val = qt_defaultDpiY(); + break; + case PdmNumColors: + val = 16777216; + break; + case PdmDepth: + val = 24; + break; + default: + val = 0; + qWarning("DrawTextItemDevice::metric: Invalid metric command"); + } + return val; + } + + virtual QPaintEngine *paintEngine() const + { + return m_paintEngine; + } + + private: + DrawTextItemRecorder *m_paintEngine; +}; + +struct InertTextPainter { + InertTextPainter() + : device(true, true), painter(&device) {} + + DrawTextItemDevice device; + QPainter painter; +}; +} + +Q_GLOBAL_STATIC(InertTextPainter, inertTextPainter); + +/*! +\class QDeclarativeTextLayout +\brief The QDeclarativeTextLayout class is a version of QStaticText that works with QTextLayouts. +\internal + +This class is basically a copy of the QStaticText code, but it is adapted to source its text from +QTextLayout. + +It is also considerably faster to create a QDeclarativeTextLayout than a QStaticText because it uses +a single, shared QPainter instance. QStaticText by comparison creates a new QPainter per instance. +As a consequence this means that QDeclarativeTextLayout is not re-enterant. Adding a lock around +the shared painter solves this, and only introduces a minor performance penalty, but is unnecessary +for QDeclarativeTextLayout's current use (QDeclarativeText is already tied to the GUI thread). +*/ + +QDeclarativeTextLayout::QDeclarativeTextLayout() +: d(0) +{ +} + +QDeclarativeTextLayout::QDeclarativeTextLayout(const QString &text) +: QTextLayout(text), d(0) +{ +} + +QDeclarativeTextLayout::~QDeclarativeTextLayout() +{ + if (d) delete d; +} + +void QDeclarativeTextLayout::beginLayout() +{ + if (d && d->cached) { + d->cached = false; + d->items.clear(); + d->positions.clear(); + d->glyphs.clear(); + d->chars.clear(); + d->position = QPointF(); + } + QTextLayout::beginLayout(); +} + +void QDeclarativeTextLayout::prepare() +{ + if (!d || !d->cached) { + + if (!d) + d = new QDeclarativeTextLayoutPrivate; + + InertTextPainter *itp = inertTextPainter(); + itp->device.begin(d); + QTextLayout::draw(&itp->painter, QPointF(0, 0)); + + glyph_t *glyphPool = d->glyphs.data(); + QFixedPoint *positionPool = d->positions.data(); + QChar *charPool = d->chars.data(); + + int itemCount = d->items.count(); + for (int ii = 0; ii < itemCount; ++ii) { + QStaticTextItem &item = d->items[ii]; + item.glyphs = glyphPool + item.glyphOffset; + item.glyphPositions = positionPool + item.positionOffset; + item.chars = charPool + item.charOffset; + } + + d->cached = true; + } +} + +void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) +{ + QPainterPrivate *priv = QPainterPrivate::get(painter); + + if (!priv->extended) { + QTextLayout::draw(painter, p); + return; + } + + prepare(); + + int itemCount = d->items.count(); + + if (p != d->position) { + QFixed fx = QFixed::fromReal(p.x()); + QFixed fy = QFixed::fromReal(p.y()); + QFixed oldX = QFixed::fromReal(d->position.x()); + QFixed oldY = QFixed::fromReal(d->position.y()); + for (int item = 0; item < itemCount; ++item) { + QStaticTextItem &textItem = d->items[item]; + + for (int ii = 0; ii < textItem.numGlyphs; ++ii) { + textItem.glyphPositions[ii].x += fx - oldX; + textItem.glyphPositions[ii].y += fy - oldY; + } + textItem.userDataNeedsUpdate = true; + } + + d->position = p; + } + + for (int ii = 0; ii < itemCount; ++ii) { + QStaticTextItem &item = d->items[ii]; + priv->extended->drawStaticTextItem(&item); + } +} + diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h new file mode 100644 index 0000000..1a4473d --- /dev/null +++ b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h @@ -0,0 +1,23 @@ +#ifndef QDECLARATIVETEXTLAYOUT_P_H +#define QDECLARATIVETEXTLAYOUT_P_H + +#include + +class QDeclarativeTextLayoutPrivate; +class QDeclarativeTextLayout : public QTextLayout +{ +public: + QDeclarativeTextLayout(); + QDeclarativeTextLayout(const QString &); + ~QDeclarativeTextLayout(); + + void beginLayout(); + + void prepare(); + void draw(QPainter *, const QPointF & = QPointF()); + +private: + QDeclarativeTextLayoutPrivate *d; +}; + +#endif // QDECLARATIVETEXTLAYOUT_P_H -- cgit v0.12 From 2e078ddc87277e47f3e9b7a21d1197b0d7309d2d Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 1 Oct 2010 11:45:02 +1000 Subject: Doc: remove unfinished and confusing mention to focus panels. --- doc/src/declarative/focus.qdoc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index 56ea165..0310cee 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -301,14 +301,4 @@ actually performs the work of handling the \e {Return} key. All of the QML view classes, such as \l PathView and \l GridView, behave in a similar manner to allow key handling in their respective delegates. - -\section1 Focus Panels - -Traditional UIs are composed of many top-level windows. Windows actually -perform two tasks - they act as the visual bounds for a widget, and they segment -focus. Each window has a separate focused widget, that becomes (to mix -terminologies) the \e {active focus} widget when the window is the active -window. - -### Focus panels do basically the same thing. */ -- cgit v0.12 From 183243963d523beaf4fdff6b9a7dcb679ebbc71f Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 1 Oct 2010 13:36:20 +1000 Subject: Doc: typographical and spelling errors. --- doc/src/declarative/advtutorial.qdoc | 4 ++-- doc/src/declarative/extending.qdoc | 8 ++++---- doc/src/declarative/focus.qdoc | 4 ++-- doc/src/declarative/modules.qdoc | 4 ++-- doc/src/declarative/propertybinding.qdoc | 2 +- doc/src/declarative/qdeclarativeintro.qdoc | 4 ++-- doc/src/declarative/qdeclarativeperformance.qdoc | 4 ++-- doc/src/declarative/qdeclarativesecurity.qdoc | 2 +- doc/src/declarative/qdeclarativestates.qdoc | 2 +- doc/src/declarative/qml-intro.qdoc | 2 +- doc/src/declarative/qtbinding.qdoc | 4 ++-- doc/src/declarative/qtprogrammers.qdoc | 6 +++--- doc/src/declarative/scope.qdoc | 2 +- doc/src/getting-started/gettingstartedqml.qdoc | 8 ++++---- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 1341bbb..2ca9418 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -423,9 +423,9 @@ Here is the \c saveHighScore() function in \c samegame.js: First we call \c sendHighScore() (explained in the section below) if it is possible to send the high scores to an online database. -Then, we use the \l{Offline Storage API} to maintain a persistant SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabase() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrival, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. +Then, we use the \l{Offline Storage API} to maintain a persistent SQL database unique to this application. We create an offline storage database for the high scores using \c openDatabase() and prepare the data and SQL query that we want to use to save it. The offline storage API uses SQL queries for data manipulation and retrieval, and in the \c db.transaction() call we use three SQL queries to initialize the database (if necessary), and then add to and retrieve high scores. To use the returned data, we turn it into a string with one line per row returned, and show a dialog containing that string. -This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could beter present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database. +This is one way of storing and displaying high scores locally, but certainly not the only way. A more complex alternative would be to create a high score dialog component, and pass it the results for processing and display (instead of reusing the \c Dialog). This would allow a more themeable dialog that could better present the high scores. If your QML is the UI for a C++ application, you could also have passed the score to a C++ function to store it locally in a variety of ways, including a simple format without SQL or in another SQL database. \section3 Storing high scores online diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 0cc989d..230446b 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -719,7 +719,7 @@ it in two steps, like this: \endcode If a default value is not supplied or set later in the file, each type has a -default value for when none is explictly set. Below are the default values +default value for when none is explicitly set. Below are the default values of some of the types. For the remaining types the default values are undefined. \table @@ -823,7 +823,7 @@ A property alias declaration looks a lot like a property definition: As the aliasing property has the same type as the aliased property, an explicit type is omitted, and the special "alias" keyword is used. Instead of a default -value, a property alias includes a compulsary alias reference. The alias +value, a property alias includes a compulsory alias reference. The alias reference is used to locate the aliased property. While similar to a property binding, the alias reference syntax is highly restricted. @@ -993,7 +993,7 @@ Return values of type QVariant are also supported via Q_RETURN_ARG. \target components A component is a reusable type with a well-defined interface built entirely in -QML. Components appear as regular QML elements, and can be used interchangably +QML. Components appear as regular QML elements, and can be used interchangeably with core types. Components allow developers to create new types to be reused in other projects without the use of C++. Components can also help to reduce duplication inside one project by limiting the need for large numbers of @@ -1086,7 +1086,7 @@ Methods and signals may be added in the same way. As all external methods, signals and properties are accessible to external users, developers should ensure that setting these properties does not have -any undesirable side-effects. For most resiliance, root level properties should +any undesirable side-effects. For most resilience, root level properties should only be used for literal default values. When a root level property must be used inside the component - such as the children property - property aliases can be used to redirect this property to a "safe" location for external users. diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index 0310cee..c3c94c5 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -120,7 +120,7 @@ hand side of the following table shows what we would like to be able to write. Here we create two instances of our previously defined component, and set the second one to have focus. The intention is that when the \e A, \e B, or \e C keys are pressed, the second of the two components receives the event and -reponds accordingly. +responds accordingly. \table \row @@ -276,7 +276,7 @@ Focus scopes allow focus to allocation to be easily partitioned. Several QML items use it to this effect. \l ListView, for example, is itself a focus scope. Generally this isn't -noticable as \l ListView doesn't usually have manually added visual children. +noticeable as \l ListView doesn't usually have manually added visual children. By being a focus scope, \l ListView can focus the current list item without worrying about how that will effect the rest of the application. This allows the current item delegate to react to key presses. diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc index 044c1e7..25a61c9 100644 --- a/doc/src/declarative/modules.qdoc +++ b/doc/src/declarative/modules.qdoc @@ -233,7 +233,7 @@ internal plugin [] \endcode -\bold {# } lines are used for comments. They are ignored by the QML engine. +\bold {# } lines are used for comments. They are ignored by the QML engine. \bold { [] } lines are used to add QML files as types. is the type being made available, the optional is a version @@ -246,7 +246,7 @@ the \c qmldir file. Types which you do not wish to export to users of your modul may be marked with the \c internal keyword: \bold {internal }. The same type can be provided by different files in different versions, in which -case later versions (eg. 1.2) must precede earlier versions (eg. 1.0), +case later versions (e.g. 1.2) must precede earlier versions (e.g. 1.0), since the \e first name-version match is used and a request for a version of a type can be fulfilled by one defined in an earlier version of the module. If a user attempts to import a version earlier than the earliest provided or later than the latest provided, diff --git a/doc/src/declarative/propertybinding.qdoc b/doc/src/declarative/propertybinding.qdoc index 314bf67..f58d8fe 100644 --- a/doc/src/declarative/propertybinding.qdoc +++ b/doc/src/declarative/propertybinding.qdoc @@ -48,7 +48,7 @@ Rectangle { QML extends a standards compliant JavaScript engine, so any valid JavaScript expression can be used as a property binding. Bindings can access object properties, make function calls and even use builtin JavaScript objects like \e {Date} and \e {Math}. Assigning a constant value to a -property can even be thought of as a binding - afterall, a constant is a valid JavaScript +property can even be thought of as a binding - after all, a constant is a valid JavaScript expression! Here are some examples of more complex bindings: \code diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc index 9d89edf..c97240c 100644 --- a/doc/src/declarative/qdeclarativeintro.qdoc +++ b/doc/src/declarative/qdeclarativeintro.qdoc @@ -173,7 +173,7 @@ Item { } \endcode -QML properties are what is known as \e typesafe. That is, they only allow you to assign a value that +QML properties are what is known as \e type-safe. That is, they only allow you to assign a value that matches the property type. For example, the \c x property of item is a real, and if you try to assign a string to it you will get an error. @@ -189,7 +189,7 @@ Each object can be given a special unique property called an \e id. No other obj same \l{QML Documents}{QML document} can have the same \c id value. Assigning an id enables the object to be referred to by other objects and scripts. -The first Rectangle element below has an \e id, "myRect". The second Rectange element defines its +The first Rectangle element below has an \e id, "myRect". The second Rectangle element defines its own width by referring to \tt myRect.width, which means it will have the same \tt width value as the first Rectangle element. diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc index be8c029..061a71c 100644 --- a/doc/src/declarative/qdeclarativeperformance.qdoc +++ b/doc/src/declarative/qdeclarativeperformance.qdoc @@ -51,7 +51,7 @@ Rectangle { x: 20 width: 200; height: 200 } -Rectange { +Rectangle { id: rect2 x: rect1.x y: rect1.y + rect1.height @@ -68,7 +68,7 @@ Rectangle { x: 20 width: 200; height: 200 } -Rectange { +Rectangle { id: rect2 height: 200 anchors.left: rect1.left diff --git a/doc/src/declarative/qdeclarativesecurity.qdoc b/doc/src/declarative/qdeclarativesecurity.qdoc index 199e2da..7395af3 100644 --- a/doc/src/declarative/qdeclarativesecurity.qdoc +++ b/doc/src/declarative/qdeclarativesecurity.qdoc @@ -48,7 +48,7 @@ import "http://evil.com/evil.js" as Evil is equivalent to downloading "http://evil.com/evil.exe" and running it. The JavaScript execution environment of QML does not try to stop any particular accesses, including local file system access, just as for any native Qt application, so the "doEvil" function could do the same things -as a native Qt application, a Python application, a Perl script, ec. +as a native Qt application, a Python application, a Perl script, etc. As with any application accessing other content beyond it's control, a QML application should perform appropriate checks on untrusted data it loads. diff --git a/doc/src/declarative/qdeclarativestates.qdoc b/doc/src/declarative/qdeclarativestates.qdoc index 274040a..148726f 100644 --- a/doc/src/declarative/qdeclarativestates.qdoc +++ b/doc/src/declarative/qdeclarativestates.qdoc @@ -221,7 +221,7 @@ Rectangle { This \l Transition defines that if any \c x or \c y properties have changed during a state change within this item, their values should be animated over 500 -millliseconds. +milliseconds. See the \l Transitions documentation for more information. diff --git a/doc/src/declarative/qml-intro.qdoc b/doc/src/declarative/qml-intro.qdoc index b77611c..18fa439 100644 --- a/doc/src/declarative/qml-intro.qdoc +++ b/doc/src/declarative/qml-intro.qdoc @@ -262,7 +262,7 @@ myRectangle.top // Correct We can transform a graphical object to get additional effects. Rotate a piece of text by 180 degrees to display upside-down text. Rotate an image by 90 degrees to lay it on its side. These transformations require -additonal information. +additional information. For rotation, the additional information includes: the origin relative to the object being rotated, the axis of rotation, and the angle in degrees to diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index 35a05d2..53db5c7 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -134,7 +134,7 @@ the window text will update accordingly. To detect when a C++ property value - in this case the \c CustomPalette's \c text property - changes, the property must have a corresponding NOTIFY signal. The NOTIFY signal specifies a signal that is emitted whenever the property changes value. Implementers should take care to only emit the -signal if the value \e changes to prevent loops from occuring. Accessing a property from a +signal if the value \e changes to prevent loops from occurring. Accessing a property from a binding that does not have a NOTIFY signal will cause QML to issue a warning at runtime. \section2 Dynamic Structured Data @@ -256,7 +256,7 @@ For example: \snippet doc/src/snippets/declarative/qtbinding/resources/main.qml 0 Note that the resource system cannot be accessed from QML directly. If the main QML file is -loaded as a resource, all files specifed as relative paths in QML will also be loaded from +loaded as a resource, all files specified as relative paths in QML will also be loaded from the resource system. Using the resource system is completely transparent to the QML layer. This also means that if the main QML file is not loaded as a resource then files in the resource system cannot be accessed from QML. diff --git a/doc/src/declarative/qtprogrammers.qdoc b/doc/src/declarative/qtprogrammers.qdoc index c0639db..69e6358 100644 --- a/doc/src/declarative/qtprogrammers.qdoc +++ b/doc/src/declarative/qtprogrammers.qdoc @@ -32,7 +32,7 @@ \section1 Overview -While QML does not require Qt knowledge to use, if you \e are already familar with Qt, +While QML does not require Qt knowledge to use, if you \e are already familiar with Qt, much of your knowledge is directly relevant to learning and using QML. Of course, an application with a UI defined in QML also uses Qt for all the non-UI logic. @@ -103,7 +103,7 @@ So, to implement your reusable button, you would simply build a QML component. Parent widgets each provide a generic way to interface to one or more arbitrary other widgets. A QTabWidget provides an interface to multiple "pages", one of which is visible at any time, -and a mechnism for selecting among them (the QTabBar). A QScollArea provides scrollbars around +and a mechanism for selecting among them (the QTabBar). A QScollArea provides scrollbars around a widget that is otherwise too large to fit in available space. Nearly all such components can be created directly in QML. Only a few cases @@ -115,7 +115,7 @@ needs to be divided up into pages. A significant difference in the parenting concept with QML compare to QWidgets is that while child items are positioned relative to their parents, -there is no requirement that they be wholy contained ("clipped") to +there is no requirement that they be wholly contained ("clipped") to the parent (although the clipped property of the child Item does allow this where it is needed). This difference has rather far-reaching consequences, for example: diff --git a/doc/src/declarative/scope.qdoc b/doc/src/declarative/scope.qdoc index 5501242..17f8632 100644 --- a/doc/src/declarative/scope.qdoc +++ b/doc/src/declarative/scope.qdoc @@ -174,7 +174,7 @@ PathView { } \endcode -If the \l Image element omitted the \c root prefix, it would inadvertantly access +If the \l Image element omitted the \c root prefix, it would inadvertently access the unset \c {PathView.scale} attached property on itself. \section1 Component Scope diff --git a/doc/src/getting-started/gettingstartedqml.qdoc b/doc/src/getting-started/gettingstartedqml.qdoc index e2d6e72..a6159c3 100644 --- a/doc/src/getting-started/gettingstartedqml.qdoc +++ b/doc/src/getting-started/gettingstartedqml.qdoc @@ -122,7 +122,7 @@ items can anchor to another item, creating robust layouts. The \c MouseArea has many signal handlers that are called during mouse movements within - the specfied \c MouseArea boundaries. One of them is \c onClicked and it is called + the specified \c MouseArea boundaries. One of them is \c onClicked and it is called whenever the acceptable mouse button is clicked, the left click being the default. We can bind actions to the onClicked handler. In our example, \c console.log() outputs text whenever the mouse area is clicked. The function \c console.log() is a useful tool for @@ -546,7 +546,7 @@ a certain easing curve. An easing curve controls the animation rates and interpolation behavior during state transitions. The easing curve we chose is \l{PropertyAnimation::easing.type}{Easing.OutQuint}, which slows the movement near - the end of the animation. Pleae read \l {qdeclarativeanimation.html}{QML's Animation} + the end of the animation. Please read \l {qdeclarativeanimation.html}{QML's Animation} article. \snippet examples/tutorials/gettingStarted/gsQml/texteditor.qml transitions @@ -835,7 +835,7 @@ \c QDeclarativeListProperty. The template type, \c File, needs to be a \c QObject derivative. Further, to create the \l {QDeclarativeListProperty}{QDeclarativeListProperty}, the list's accessor - and modifiers need to be passed to the consructor as function pointers. The list, + and modifiers need to be passed to the constructor as function pointers. The list, a \c QList in our case, also needs to be a list of \c File pointers. The constructor of \l {QDeclarativeListProperty}{QDeclarativeListProperty} @@ -980,7 +980,7 @@ Our \c FileMenu can now connect to their respective actions. The \c saveButton will transfer the text from the \c TextEdit onto the directory's \c fileContent property, then copy its file name from the editable text input. Finally, the button - calls the \c saveFile() function, saving the file. The \c sloadButton has a similar + calls the \c saveFile() function, saving the file. The \c loadButton has a similar execution. Also, the \c New action will empty the contents of the \c TextEdit. Further, the \c EditMenu buttons are connected to the \c TextEdit functions to copy, -- cgit v0.12 From 5a6f2b7ed7d1d37379324898161a6d03457c591e Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 1 Oct 2010 15:49:44 +1000 Subject: Doc: add missing image. --- doc/src/images/qml-column.png | Bin 0 -> 6264 bytes doc/src/snippets/declarative/column/column.qml | 14 +++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 doc/src/images/qml-column.png diff --git a/doc/src/images/qml-column.png b/doc/src/images/qml-column.png new file mode 100644 index 0000000..c589ad8 Binary files /dev/null and b/doc/src/images/qml-column.png differ diff --git a/doc/src/snippets/declarative/column/column.qml b/doc/src/snippets/declarative/column/column.qml index 45c6822..18e95e9 100644 --- a/doc/src/snippets/declarative/column/column.qml +++ b/doc/src/snippets/declarative/column/column.qml @@ -47,21 +47,21 @@ Item { Column { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - + spacing: 5 Rectangle { color: "lightblue"; radius: 10.0 width: 300; height: 50 - Text { anchors.fill: parent - font.pointSize: 32; text: "Books" } } + Text { anchors.centerIn: parent + font.pointSize: 24; text: "Books" } } Rectangle { color: "gold"; radius: 10.0 width: 300; height: 50 - Text { anchors.fill: parent - font.pointSize: 32; text: "Music" } } + Text { anchors.centerIn: parent + font.pointSize: 24; text: "Music" } } Rectangle { color: "lightgreen"; radius: 10.0 width: 300; height: 50 - Text { anchors.fill: parent - font.pointSize: 32; text: "Movies" } } + Text { anchors.centerIn: parent + font.pointSize: 24; text: "Movies" } } } } //! [document] -- cgit v0.12 From 6f74eef81cfbebce797f4a3464ea0cefbd268d7b Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 1 Oct 2010 11:11:45 +1000 Subject: Qt.openUrlExternally should resolve relative URLs. Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativeengine.cpp | 16 +++++------- .../qdeclarativeqt/data/openUrlExternally.qml | 3 +++ .../qdeclarativeqt/data/openUrlExternally_lib.js | 9 +++++++ .../qdeclarativeqt/data/openUrlExternally_lib.qml | 9 +++++++ .../qdeclarativeqt/tst_qdeclarativeqt.cpp | 30 ++++++++++++++++++++++ 5 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js create mode 100644 tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index bbd3ac1..584c5ec 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -284,9 +284,11 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url) { if (p) { - QDeclarativeContextData *ctxt = QDeclarativeEnginePrivate::get(this)->getContext(context); - Q_ASSERT(ctxt); - return ctxt->resolvedUrl(url); + QDeclarativeContextData *ctxt = p->getContext(context); + if (ctxt) + return ctxt->resolvedUrl(url); + else + return p->getUrl(context).resolved(url); } return baseUrl.resolved(url); } @@ -1146,12 +1148,8 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS QString arg = ctxt->argument(0).toString(); if (arg.isEmpty()) return engine->nullValue(); - QUrl url; + QUrl url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(ctxt, QUrl(arg)); QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt); - if (context) - url = QUrl(context->resolvedUrl(QUrl(arg))); - else - url = activeEnginePriv->getUrl(ctxt).resolved(QUrl(arg)); QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine); QDeclarativeComponentPrivate::get(c)->creationContext = context; QDeclarativeData::get(c, true)->setImplicitDestructible(); @@ -1635,7 +1633,7 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc return QScriptValue(e, false); bool ret = false; #ifndef QT_NO_DESKTOPSERVICES - ret = QDesktopServices::openUrl(QUrl(ctxt->argument(0).toString())); + ret = QDesktopServices::openUrl(QDeclarativeScriptEngine::get(e)->resolvedUrl(ctxt, QUrl(ctxt->argument(0).toString()))); #endif return QScriptValue(e, ret); } diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml index c9fb25e..dc4049c 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally.qml @@ -2,4 +2,7 @@ import QtQuick 1.0 QtObject { Component.onCompleted: Qt.openUrlExternally("test:url") + + property bool testFile + onTestFileChanged: Qt.openUrlExternally("test.html") } diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js new file mode 100644 index 0000000..702357a --- /dev/null +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.js @@ -0,0 +1,9 @@ +.pragma library + +function loadTest() { + Qt.openUrlExternally("test:url") +} + +function loadFile() { + Qt.openUrlExternally("test.html") +} diff --git a/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml new file mode 100644 index 0000000..456653b --- /dev/null +++ b/tests/auto/declarative/qdeclarativeqt/data/openUrlExternally_lib.qml @@ -0,0 +1,9 @@ +import QtQuick 1.0 +import "openUrlExternally_lib.js" as Test + +Item { + Component.onCompleted: Test.loadTest(); + + property bool testFile + onTestFileChanged: Test.loadFile(); +} diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index 739b10a..9f45d74 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -75,6 +75,7 @@ private slots: void darker(); void tint(); void openUrlExternally(); + void openUrlExternally_pragmaLibrary(); void md5(); void createComponent(); void createComponent_pragmaLibrary(); @@ -321,6 +322,7 @@ void tst_qdeclarativeqt::openUrlExternally() MyUrlHandler handler; QDesktopServices::setUrlHandler("test", &handler, "noteCall"); + QDesktopServices::setUrlHandler("file", &handler, "noteCall"); QDeclarativeComponent component(&engine, TEST_FILE("openUrlExternally.qml")); QObject *object = component.create(); @@ -328,7 +330,35 @@ void tst_qdeclarativeqt::openUrlExternally() QCOMPARE(handler.called,1); QCOMPARE(handler.last, QUrl("test:url")); + object->setProperty("testFile", true); + + QCOMPARE(handler.called,2); + QCOMPARE(handler.last, TEST_FILE("test.html")); + + QDesktopServices::unsetUrlHandler("test"); + QDesktopServices::unsetUrlHandler("file"); +} + +void tst_qdeclarativeqt::openUrlExternally_pragmaLibrary() +{ + MyUrlHandler handler; + + QDesktopServices::setUrlHandler("test", &handler, "noteCall"); + QDesktopServices::setUrlHandler("file", &handler, "noteCall"); + + QDeclarativeComponent component(&engine, TEST_FILE("openUrlExternally_lib.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + QCOMPARE(handler.called,1); + QCOMPARE(handler.last, QUrl("test:url")); + + object->setProperty("testFile", true); + + QCOMPARE(handler.called,2); + QCOMPARE(handler.last, TEST_FILE("test.html")); + QDesktopServices::unsetUrlHandler("test"); + QDesktopServices::unsetUrlHandler("file"); } void tst_qdeclarativeqt::md5() -- cgit v0.12 From 73bd68a35193f59a58be091270a5530b4d4755c0 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 1 Oct 2010 08:53:30 +0200 Subject: QmlDebugService: Fix compiler warning about cast from ascii --- src/declarative/debugger/qdeclarativedebugservice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugservice.cpp b/src/declarative/debugger/qdeclarativedebugservice.cpp index d2ef00d..b98cd5d 100644 --- a/src/declarative/debugger/qdeclarativedebugservice.cpp +++ b/src/declarative/debugger/qdeclarativedebugservice.cpp @@ -219,8 +219,8 @@ QDeclarativeDebugServer *QDeclarativeDebugServer::instance() server->waitForConnection(); } } else { - qWarning(QString("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " - "Format is -qmljsdebugger=port:[,block]").arg( + qWarning(QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". " + "Format is -qmljsdebugger=port:[,block]").arg( appD->qmljsDebugArguments).toAscii().constData()); } } -- cgit v0.12 From 976391c5ce2bbe3b992298e140bbbbc596ca756f Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Fri, 1 Oct 2010 17:18:39 +1000 Subject: Update change log. --- dist/changes-4.7.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.7.1 b/dist/changes-4.7.1 index 2d79ac1..68b23ba 100644 --- a/dist/changes-4.7.1 +++ b/dist/changes-4.7.1 @@ -109,7 +109,11 @@ QtDBus QtMultimedia ------------ - + - QAudioOutput + * [QTBUG-11586] Support audio with more than two channels. + * [QTBUG-11755] Fixed outputing audio in push mode with ALSA. + * [QTBUG-11883] Fixed segmentation fault when closing a QAudioInput or + QAudioOutput. QtNetwork --------- -- cgit v0.12 From 3c06efd09075c08fd9753f226a4342ea7a8356f8 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 1 Oct 2010 17:24:27 +1000 Subject: Only cache textlayout in paint engines that support transformations Task-number: QTBUG-14050 --- src/declarative/graphicsitems/qdeclarativetextlayout.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index 5972f92..722378e 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -273,7 +273,12 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) { QPainterPrivate *priv = QPainterPrivate::get(painter); - if (!priv->extended) { + bool paintEngineSupportsTransformations = priv->extended && + (priv->extended->type() == QPaintEngine::OpenGL2 || + priv->extended->type() == QPaintEngine::OpenVG || + priv->extended->type() == QPaintEngine::OpenGL); + + if (!paintEngineSupportsTransformations) { QTextLayout::draw(painter, p); return; } -- cgit v0.12 From 55bf3ab3fb5591544e1f6a7996d5fdedb8e699c9 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 1 Oct 2010 11:25:02 +0300 Subject: Remove partial upgrade deployment generation for Webkit Generic partial upgrade package deployment generation in qbase.pri wrecks webkit pkg files. Reviewed-by: axis --- src/qbase.pri | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/qbase.pri b/src/qbase.pri index b431ade..e565e4a 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -185,18 +185,21 @@ include(qt_targets.pri) win32:DEFINES+=_USE_MATH_DEFINES symbian { - # Partial upgrade SIS file - vendorinfo = \ - "; Localised Vendor name" \ - "%{\"Nokia, Qt\"}" \ - " " \ - "; Unique Vendor name" \ - ":\"Nokia, Qt\"" \ - " " - pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ - "$${LITERAL_HASH}{\"$${TARGET}\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" - partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.sources = $$QMAKE_LIBDIR_QT/$${TARGET}.dll - partial_upgrade.path = c:/sys/bin - DEPLOYMENT += partial_upgrade + # Make partial upgrade SIS file for all dll's except webkit + !contains(TARGET.UID3, 0x200267C2):!contains(TARGET.UID3, 0xE00267C2) { + # Partial upgrade SIS file + vendorinfo = \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"$${TARGET}\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.sources = $$QMAKE_LIBDIR_QT/$${TARGET}.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT += partial_upgrade + } } -- cgit v0.12 From e4407012815a805d9a7d1a3beb7038a93cdd74dd Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 1 Oct 2010 10:35:46 +0200 Subject: Make the OpenSSL library search also hit /lib. Task-number: http://bugs.meego.com/show_bug.cgi?id=7777 Reviewed-by: Markus Goetz --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 6affa36..d717214 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -333,7 +333,7 @@ static QStringList findAllLibSsl() paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH")) .split(QLatin1Char(':'), QString::SkipEmptyParts); # endif - paths << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib"); + paths << QLatin1String("/lib") << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib"); QStringList foundSsls; foreach (const QString &path, paths) { -- cgit v0.12 From 4ee6f86baccd7c5ba065fd00d22120e71e1f6d3a Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 1 Oct 2010 12:08:24 +0200 Subject: Incorrect selection background for unfocused widgets with GTK In Ubuntu 10.10 the unfocused selection background is different from the focused one. Interestingly they use GTK_STATE_ACTIVE for unfocused widgets. This was verified back to GTK 2.10 which is the required minimum for QGtkStyle so it should be safe for all other styles as well. Task-number: QTBUG-13792 Reviewed-by: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index c5429dd..7f342f9 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -225,9 +225,8 @@ QPalette QGtkStyle::standardPalette() const GtkStyle *style = d->gtkStyle(); GtkWidget *gtkButton = d->gtkWidget("GtkButton"); GtkWidget *gtkEntry = d->getTextColorWidget(); - - GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg; - QColor bg, base, text, fg, highlight, highlightText; + GdkColor gdkBg, gdkBase, gdkText, gdkForeground, gdkSbg, gdkSfg, gdkaSbg, gdkaSfg; + QColor bg, base, text, fg, highlight, highlightText, inactiveHighlight, inactiveHighlightedTExt; gdkBg = style->bg[GTK_STATE_NORMAL]; gdkForeground = gtkButton->style->fg[GTK_STATE_NORMAL]; @@ -237,14 +236,23 @@ QPalette QGtkStyle::standardPalette() const gdkText = gtkEntry->style->text[GTK_STATE_NORMAL]; gdkSbg = gtkEntry->style->base[GTK_STATE_SELECTED]; gdkSfg = gtkEntry->style->text[GTK_STATE_SELECTED]; + + // The ACTIVE base color is really used for inactive windows + gdkaSbg = gtkEntry->style->base[GTK_STATE_ACTIVE]; + gdkaSfg = gtkEntry->style->text[GTK_STATE_ACTIVE]; + bg = QColor(gdkBg.red>>8, gdkBg.green>>8, gdkBg.blue>>8); text = QColor(gdkText.red>>8, gdkText.green>>8, gdkText.blue>>8); fg = QColor(gdkForeground.red>>8, gdkForeground.green>>8, gdkForeground.blue>>8); base = QColor(gdkBase.red>>8, gdkBase.green>>8, gdkBase.blue>>8); highlight = QColor(gdkSbg.red>>8, gdkSbg.green>>8, gdkSbg.blue>>8); highlightText = QColor(gdkSfg.red>>8, gdkSfg.green>>8, gdkSfg.blue>>8); + inactiveHighlight = QColor(gdkaSbg.red>>8, gdkaSbg.green>>8, gdkaSbg.blue>>8); + inactiveHighlightedTExt = QColor(gdkaSfg.red>>8, gdkaSfg.green>>8, gdkaSfg.blue>>8); palette.setColor(QPalette::HighlightedText, highlightText); + + palette.setColor(QPalette::Light, bg.lighter(125)); palette.setColor(QPalette::Shadow, bg.darker(130)); palette.setColor(QPalette::Dark, bg.darker(120)); @@ -279,6 +287,10 @@ QPalette QGtkStyle::standardPalette() const highlightText.setHsv(highlightText.hue(), 0, highlightText.value(), highlightText.alpha()); palette.setColor(QPalette::Disabled, QPalette::Highlight, highlight); palette.setColor(QPalette::Disabled, QPalette::HighlightedText, highlightText); + + palette.setColor(QPalette::Inactive, QPalette::HighlightedText, inactiveHighlightedTExt); + palette.setColor(QPalette::Inactive, QPalette::Highlight, inactiveHighlight); + style = d->gtk_rc_get_style_by_paths(d->gtk_settings_get_default(), "gtk-tooltips", "GtkWindow", d->gtk_window_get_type()); if (style) { -- cgit v0.12 From 1f14df23bf0e593c31efc846c13f11afb0fad6b8 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 28 Sep 2010 11:01:20 +0100 Subject: Progressive download in Phonon MMF backend: added download managers This patch adds a Download class which uses the RHttpDownloadMgr API to download a media clip over HTTP. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- src/3rdparty/phonon/mmf/download.cpp | 194 +++++++++++++++++++++++++++++++++++ src/3rdparty/phonon/mmf/download.h | 111 ++++++++++++++++++++ src/plugins/phonon/mmf/mmf.pro | 3 + 3 files changed, 308 insertions(+) create mode 100644 src/3rdparty/phonon/mmf/download.cpp create mode 100644 src/3rdparty/phonon/mmf/download.h diff --git a/src/3rdparty/phonon/mmf/download.cpp b/src/3rdparty/phonon/mmf/download.cpp new file mode 100644 index 0000000..7b80e4a --- /dev/null +++ b/src/3rdparty/phonon/mmf/download.cpp @@ -0,0 +1,194 @@ +/* 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 "download.h" +#include "utils.h" +#include +#include + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +static const TBool InheritDownloads = EFalse; + +DownloadPrivate::DownloadPrivate(Download *parent) + : QObject(parent) + , m_parent(parent) + , m_download(0) + , m_length(0) +{ + +} + +DownloadPrivate::~DownloadPrivate() +{ + m_downloadManager.Disconnect(); + m_downloadManager.Close(); +} + +bool DownloadPrivate::start() +{ + TRACE_CONTEXT(DownloadPrivate::start, EVideoApi); + Q_ASSERT(!m_download); + // Connect to download manager + RProcess process; + const TUid uid3 = process.SecureId(); + TRAPD(err, m_downloadManager.ConnectL(uid3, *this, InheritDownloads)); + TRACE("connect err %d", err); + if (KErrNone == err) { + // Start download + QHBufC url(m_parent->sourceUrl().toString()); + TPtr8 url8 = url->Des().Collapse(); + TRAP(err, m_download = &m_downloadManager.CreateDownloadL(url8)); + TRACE("start err %d", err); + if (KErrNone == err) + m_download->Start(); + } + return (KErrNone == err); +} + +void DownloadPrivate::resume() +{ + +} + +void DownloadPrivate::HandleDMgrEventL(RHttpDownload &aDownload, THttpDownloadEvent aEvent) +{ + TRACE_CONTEXT(DownloadPrivate::HandleDMgrEventL, EVideoApi); + Q_ASSERT(&aDownload == m_download); + switch (aEvent.iDownloadState) { + case EHttpDlPaused: + if (EHttpContentTypeReceived == aEvent.iProgressState) { + TRACE_0("paused, content type received"); + m_download->Start(); + } + break; + case EHttpDlInprogress: + switch (aEvent.iProgressState) { + case EHttpProgResponseHeaderReceived: + { + TFileName fileName; + m_download->GetStringAttribute(EDlAttrDestFilename, fileName); + TRACE("in progress, response header received, filename %S", &fileName); + const QString fileNameQt = QDir::fromNativeSeparators(qt_TDesC2QString(fileName)); + m_parent->downloadStarted(fileNameQt); + } + break; + case EHttpProgResponseBodyReceived: + { + TInt32 length = 0; + m_download->GetIntAttribute(EDlAttrDownloadedSize, length); + if (length != m_length) { + TRACE("in progress, length %d", length); + m_length = length; + emit lengthChanged(m_length); + } + } + break; + } + break; + case EHttpDlCompleted: + TRACE_0("complete"); + m_parent->complete(); + break; + case EHttpDlFailed: + TRACE_0("failed"); + m_parent->error(); + break; + } +} + +Download::Download(const QUrl &url, QObject *parent) + : QObject(parent) + , m_private(new DownloadPrivate(this)) + , m_sourceUrl(url) + , m_state(Idle) +{ + qRegisterMetaType(); + connect(m_private, SIGNAL(lengthChanged(qint64)), this, SIGNAL(lengthChanged(qint64))); +} + +Download::~Download() +{ + +} + +const QUrl &Download::sourceUrl() const +{ + return m_sourceUrl; +} + +const QString &Download::targetFileName() const +{ + return m_targetFileName; +} + +void Download::start() +{ + TRACE_CONTEXT(Download::start, EVideoApi); + TRACE_ENTRY_0(); + Q_ASSERT(Idle == m_state); + const bool ok = m_private->start(); + setState(ok ? Initializing : Error); + TRACE_EXIT_0(); +} + +void Download::resume() +{ + TRACE_CONTEXT(Download::resume, EVideoApi); + TRACE_ENTRY_0(); + m_private->resume(); + TRACE_EXIT_0(); +} + +void Download::setState(State state) +{ + TRACE_CONTEXT(Download::setState, EVideoApi); + TRACE("oldState %d newState %d", m_state, state); + const State oldState = m_state; + m_state = state; + if (oldState != m_state) + emit stateChanged(m_state); +} + +void Download::error() +{ + TRACE_CONTEXT(Download::error, EVideoApi); + TRACE_0(""); + setState(Error); +} + +void Download::downloadStarted(const QString &targetFileName) +{ + TRACE_CONTEXT(Download::downloadStarted, EVideoApi); + TRACE_0("downloadStarted"); + m_targetFileName = targetFileName; + setState(Downloading); +} + +void Download::complete() +{ + TRACE_CONTEXT(Download::complete, EVideoApi); + TRACE_0(""); + setState(Complete); +} + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/download.h b/src/3rdparty/phonon/mmf/download.h new file mode 100644 index 0000000..b57348b --- /dev/null +++ b/src/3rdparty/phonon/mmf/download.h @@ -0,0 +1,111 @@ +/* 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_MMF_DOWNLOAD_H +#define PHONON_MMF_DOWNLOAD_H + +#include +#include +#include +#include + +QT_FORWARD_DECLARE_CLASS(QByteArray) +QT_FORWARD_DECLARE_CLASS(QFile) + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ + +class Download; + +class DownloadPrivate : public QObject + , public MHttpDownloadMgrObserver +{ + Q_OBJECT +public: + DownloadPrivate(Download *parent); + ~DownloadPrivate(); + bool start(); + void resume(); +signals: + void error(); + void targetFileNameChanged(); + void lengthChanged(qint64 length); + void complete(); +private: + // MHttpDownloadMgrObserver + void HandleDMgrEventL(RHttpDownload &aDownload, THttpDownloadEvent aEvent); +private: + Download *m_parent; + RHttpDownloadMgr m_downloadManager; + RHttpDownload *m_download; + qint64 m_length; +}; + +class Download : public QObject +{ + Q_OBJECT + friend class DownloadPrivate; +public: + Download(const QUrl &url, QObject *parent = 0); + ~Download(); + const QUrl &sourceUrl() const; + const QString &targetFileName() const; + void start(); + + // Only has effect when QT_PHONON_MMF_DOWNLOAD_DUMMY is defined + void resume(); + + enum State { + Idle, + Initializing, + Downloading, + Complete, + Error + }; + +signals: + void lengthChanged(qint64 length); + void stateChanged(Download::State state); + +private: + void setState(State state); + + // Called by DownloadPrivate + void error(); + void downloadStarted(const QString &targetFileName); + void complete(); + +private: + DownloadPrivate *m_private; + QUrl m_sourceUrl; + QString m_targetFileName; + State m_state; +}; + +} +} + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(Phonon::MMF::Download::State) + +#endif diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 7a6fdf8..902354f 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,6 +36,7 @@ symbian { $$PHONON_MMF_DIR/backend.h \ $$PHONON_MMF_DIR/bassboost.h \ $$PHONON_MMF_DIR/defs.h \ + $$PHONON_MMF_DIR/download.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ @@ -61,6 +62,7 @@ symbian { $$PHONON_MMF_DIR/abstractvideoplayer.cpp \ $$PHONON_MMF_DIR/backend.cpp \ $$PHONON_MMF_DIR/bassboost.cpp \ + $$PHONON_MMF_DIR/download.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ @@ -111,6 +113,7 @@ symbian { LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream + LIBS += -ldownloadmgr # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From 865a9214fbb858cd5089aa3073ad2cff305017ea Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 28 Sep 2010 11:05:41 +0100 Subject: Progressive download in Phonon MMF backend: integrated with player This commit integrates the Download class with the media playback classes in the backend, to implement Progressive Download. Note that this PDL implementation has one drawback: when video playback is paused due to shortage of data (i.e. due to the download being temporarily stalled), the display goes black. This is because, when the end of the currently-downloaded data is reached, the playback session is closed. When more data becomes available, the clip is re-opened, a seek is done to reach the previous playback position, and playback is re-started. Closing the playback session closes the video stack's connection to the display, thereby causing the video widget to go black while more data is buffered. This is a consequence of the level in the native video stack at which the Phonon integration is done: managing a network stall without requiring the playback session to be closed would require integration below the MMF client API, specifically at the MMF controller level. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 148 +++++++++++++++++++++--- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 17 +++ src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 24 +++- src/3rdparty/phonon/mmf/abstractvideoplayer.h | 5 +- src/3rdparty/phonon/mmf/audioplayer.cpp | 18 ++- src/3rdparty/phonon/mmf/audioplayer.h | 5 +- src/3rdparty/phonon/mmf/mediaobject.cpp | 36 +++--- src/3rdparty/phonon/mmf/mediaobject.h | 1 + 8 files changed, 211 insertions(+), 43 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 3702560..a728423 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -51,10 +51,13 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer , m_parent(parent) , m_pending(NothingPending) , m_positionTimer(new QTimer(this)) + , m_position(0) , m_bufferStatusTimer(new QTimer(this)) , m_mmfMaxVolume(NullMaxVolume) , m_prefinishMarkSent(false) , m_aboutToFinishSent(false) + , m_download(0) + , m_downloadStalled(false) { connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick())); connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick())); @@ -183,6 +186,7 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms) } doSeek(ms); + m_position = ms; resetMarksIfRewound(); if(wasPlaying && state() != ErrorState) { @@ -207,6 +211,11 @@ bool MMF::AbstractMediaPlayer::isSeekable() const return true; } +qint64 MMF::AbstractMediaPlayer::currentTime() const +{ + return m_position; +} + void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval) { TRACE_CONTEXT(AbstractMediaPlayer::doSetTickInterval, EAudioApi); @@ -247,6 +256,14 @@ void MMF::AbstractMediaPlayer::open() symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); + } else if (url.scheme() == QLatin1String("http")) { + Q_ASSERT(!m_download); + m_download = new Download(url, this); + connect(m_download, SIGNAL(lengthChanged(qint64)), + this, SLOT(downloadLengthChanged(qint64))); + connect(m_download, SIGNAL(stateChanged(Download::State)), + this, SLOT(downloadStateChanged(Download::State))); + m_download->start(); } else { symbianErr = openUrl(url.toString()); if (KErrNone != symbianErr) @@ -288,6 +305,14 @@ void MMF::AbstractMediaPlayer::open() TRACE_EXIT_0(); } +void MMF::AbstractMediaPlayer::close() +{ + doClose(); + delete m_download; + m_download = 0; + m_position = 0; +} + void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) { TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); @@ -374,7 +399,8 @@ void MMF::AbstractMediaPlayer::bufferingComplete() { stopBufferStatusTimer(); emit MMF::AbstractPlayer::bufferStatus(100); - changeState(m_stateBeforeBuffering); + if (!progressiveDownloadStalled()) + changeState(m_stateBeforeBuffering); } void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) @@ -385,13 +411,28 @@ void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) void MMF::AbstractMediaPlayer::loadingComplete(int error) { - Q_ASSERT(Phonon::LoadingState == state()); - - if (KErrNone == error) { - updateMetaData(); - changeState(StoppedState); + TRACE_CONTEXT(AbstractMediaPlayer::loadingComplete, EAudioApi); + TRACE_ENTRY("state %d error %d", state(), error); + if (progressiveDownloadStalled()) { + Q_ASSERT(Phonon::BufferingState == state()); + if (KErrNone == error) { + bufferingComplete(); + doSeek(m_position); + startPlayback(); + m_downloadStalled = false; + } } else { - setError(tr("Loading clip failed"), error); + Q_ASSERT(Phonon::LoadingState == state()); + if (KErrNone == error) { + updateMetaData(); + changeState(StoppedState); + } else { + if (isProgressiveDownload() && KErrCorrupt == error) { + setProgressiveDownloadStalled(); + } else { + setError(tr("Loading clip failed"), error); + } + } } } @@ -415,8 +456,12 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error) QMetaObject::invokeMethod(m_parent, "switchToNextSource", Qt::QueuedConnection); } else { - setError(tr("Playback complete"), error); - emit finished(); + if (isProgressiveDownload() && KErrCorrupt == error) { + setProgressiveDownloadStalled(); + } else { + setError(tr("Playback complete"), error); + emit finished(); + } } } @@ -425,15 +470,28 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds return in.Int64() / 1000; } +bool MMF::AbstractMediaPlayer::isProgressiveDownload() const +{ + return (0 != m_download); +} + +bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const +{ + return m_downloadStalled; +} + //----------------------------------------------------------------------------- // Slots //----------------------------------------------------------------------------- void MMF::AbstractMediaPlayer::positionTick() { - const qint64 current = currentTime(); - emitMarksIfReached(current); - emit MMF::AbstractPlayer::tick(current); + const qint64 pos = getCurrentTime(); + if (pos > m_position) { + m_position = pos; + emitMarksIfReached(m_position); + emit MMF::AbstractPlayer::tick(m_position); + } } void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) @@ -458,7 +516,7 @@ void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) void MMF::AbstractMediaPlayer::resetMarksIfRewound() { - const qint64 current = currentTime(); + const qint64 current = getCurrentTime(); const qint64 total = totalTime(); const qint64 remaining = total - current; @@ -487,9 +545,71 @@ void MMF::AbstractMediaPlayer::startPlayback() changeState(PlayingState); } +void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() +{ + TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi); + TRACE_ENTRY("state %d", state()); + Q_ASSERT(isProgressiveDownload()); + m_downloadStalled = true; + doClose(); + bufferingStarted(); + // Video player loses window handle when closed - need to reapply it here + videoOutputChanged(); +#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY + m_download->resume(); +#endif +} + void MMF::AbstractMediaPlayer::bufferStatusTick() { - emit MMF::AbstractPlayer::bufferStatus(bufferStatus()); + // During progressive download, there is no way to detect the buffering status. + // Phonon does not support a "buffering; amount unknown" signal, therefore we + // return a buffering status of zero. + const int status = progressiveDownloadStalled() ? 0 : bufferStatus(); + emit MMF::AbstractPlayer::bufferStatus(status); +} + +void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length) +{ + TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi); + TRACE_ENTRY("length %Ld", length); + Q_UNUSED(length) + if (m_downloadStalled) { + bufferingComplete(); + int err = m_parent->openFileHandle(m_download->targetFileName()); + if (KErrNone == err) + err = openFile(*m_parent->file()); + if (KErrNone != err) + setError(tr("Error opening file")); + } +} + +void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state) +{ + TRACE_CONTEXT(AbstractMediaPlayer::downloadStateChanged, EAudioApi); + TRACE_ENTRY("state %d", state); + switch (state) { + case Download::Idle: + case Download::Initializing: + break; + case Download::Downloading: + { + int err = m_parent->openFileHandle(m_download->targetFileName()); + if (KErrNone == err) + err = openFile(*m_parent->file()); + else if (KErrCorrupt == err) + // Insufficient data downloaded - enter Buffering state + setProgressiveDownloadStalled(); + if (KErrNone != err) + setError(tr("Error opening file")); + } + break; + case Download::Complete: + break; + case Download::Error: + setError(tr("Download error")); + break; + } } Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index e795ecb..99fc101 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -23,6 +23,7 @@ along with this library. If not, see . #include #include #include "abstractplayer.h" +#include "download.h" class RFile; @@ -48,6 +49,7 @@ protected: public: virtual void open(); + virtual void close(); // MediaObjectInterface virtual void play(); @@ -55,6 +57,7 @@ public: virtual void stop(); virtual void seek(qint64 milliseconds); virtual bool isSeekable() const; + virtual qint64 currentTime() const; virtual void volumeChanged(qreal volume); protected: @@ -68,12 +71,15 @@ protected: virtual void doStop() = 0; virtual void doSeek(qint64 pos) = 0; virtual int setDeviceVolume(int mmfVolume) = 0; + virtual int openFile(const QString &fileName) = 0; virtual int openFile(RFile& file) = 0; virtual int openUrl(const QString& url) = 0; virtual int openDescriptor(const TDesC8 &des) = 0; virtual int bufferStatus() const = 0; + virtual void doClose() = 0; void updateMetaData(); + virtual qint64 getCurrentTime() const = 0; virtual int numberOfMetaDataEntries() const = 0; virtual QPair metaDataEntry(int index) const = 0; @@ -86,6 +92,9 @@ protected: static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &); + bool isProgressiveDownload() const; + bool progressiveDownloadStalled() const; + private: void startPositionTimer(); void stopPositionTimer(); @@ -96,6 +105,7 @@ private: void emitMarksIfReached(qint64 position); void resetMarksIfRewound(); void startPlayback(); + void setProgressiveDownloadStalled(); enum Pending { NothingPending, @@ -108,6 +118,8 @@ private: private Q_SLOTS: void positionTick(); void bufferStatusTick(); + void downloadLengthChanged(qint64); + void downloadStateChanged(Download::State); private: MediaObject *const m_parent; @@ -115,6 +127,7 @@ private: Pending m_pending; QScopedPointer m_positionTimer; + qint64 m_position; QScopedPointer m_bufferStatusTimer; PrivateState m_stateBeforeBuffering; @@ -127,6 +140,10 @@ private: // Used for playback of resource files TPtrC8 m_buffer; + // Used for progressive download + Download *m_download; + bool m_downloadStalled; + QMultiMap m_metaData; }; diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp index fb20bea..1ab5bae 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see . */ +#include #include #include #include @@ -132,6 +133,13 @@ int MMF::AbstractVideoPlayer::setDeviceVolume(int mmfVolume) return err; } +int MMF::AbstractVideoPlayer::openFile(const QString &fileName) +{ + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRAPD(err, m_player->OpenFileL(*nativeFileName)); + return err; +} + int MMF::AbstractVideoPlayer::openFile(RFile &file) { TRAPD(err, m_player->OpenFileL(file)); @@ -157,7 +165,7 @@ int MMF::AbstractVideoPlayer::bufferStatus() const return result; } -void MMF::AbstractVideoPlayer::close() +void MMF::AbstractVideoPlayer::doClose() { m_player->Close(); } @@ -167,9 +175,9 @@ bool MMF::AbstractVideoPlayer::hasVideo() const return true; } -qint64 MMF::AbstractVideoPlayer::currentTime() const +qint64 MMF::AbstractVideoPlayer::getCurrentTime() const { - TRACE_CONTEXT(AbstractVideoPlayer::currentTime, EVideoApi); + TRACE_CONTEXT(AbstractVideoPlayer::getCurrentTime, EVideoApi); TTimeIntervalMicroSeconds us; TRAPD(err, us = m_player->PositionL()) @@ -246,7 +254,9 @@ void MMF::AbstractVideoPlayer::MvpuoOpenComplete(TInt aError) TRACE_CONTEXT(AbstractVideoPlayer::MvpuoOpenComplete, EVideoApi); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); if (KErrNone == aError) m_player->Prepare(); @@ -261,7 +271,9 @@ void MMF::AbstractVideoPlayer::MvpuoPrepareComplete(TInt aError) TRACE_CONTEXT(AbstractVideoPlayer::MvpuoPrepareComplete, EVideoApi); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); TRAPD(err, getVideoClipParametersL(aError)); @@ -470,7 +482,7 @@ void MMF::AbstractVideoPlayer::updateScaleFactors(const QSize &windowSize, bool void MMF::AbstractVideoPlayer::parametersChanged(VideoParameters parameters) { - if (state() == LoadingState) + if (state() == LoadingState || progressiveDownloadStalled() && BufferingState == state()) m_pendingChanges |= parameters; else handleParametersChanged(parameters); diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h index 3ff3c75..3bc5c7c 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h @@ -64,21 +64,22 @@ public: virtual void doStop(); virtual void doSeek(qint64 milliseconds); virtual int setDeviceVolume(int mmfVolume); + virtual int openFile(const QString &fileName); virtual int openFile(RFile &file); virtual int openUrl(const QString &url); virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; - virtual void close(); + virtual void doClose(); // MediaObjectInterface virtual bool hasVideo() const; - virtual qint64 currentTime() const; virtual qint64 totalTime() const; // AbstractPlayer virtual void videoOutputChanged(); // AbstractMediaPlayer + virtual qint64 getCurrentTime() const; virtual int numberOfMetaDataEntries() const; virtual QPair metaDataEntry(int index) const; diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 7c8b9bd..dc5c800 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see . */ +#include #include #include "audioplayer.h" @@ -109,6 +110,13 @@ int MMF::AudioPlayer::setDeviceVolume(int mmfVolume) #endif } +int MMF::AudioPlayer::openFile(const QString &fileName) +{ + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRAPD(err, m_player->OpenFileL(*nativeFileName)); + return err; +} + int MMF::AudioPlayer::openFile(RFile& file) { TRAPD(err, m_player->OpenFileL(file)); @@ -150,7 +158,7 @@ int MMF::AudioPlayer::bufferStatus() const return result; } -void MMF::AudioPlayer::close() +void MMF::AudioPlayer::doClose() { m_player->Close(); } @@ -160,9 +168,9 @@ bool MMF::AudioPlayer::hasVideo() const return false; } -qint64 MMF::AudioPlayer::currentTime() const +qint64 MMF::AudioPlayer::getCurrentTime() const { - TRACE_CONTEXT(AudioPlayer::currentTime, EAudioApi); + TRACE_CONTEXT(AudioPlayer::getCurrentTime, EAudioApi); TTimeIntervalMicroSeconds us; const TInt err = m_player->GetPosition(us); @@ -203,7 +211,9 @@ void MMF::AudioPlayer::MapcInitComplete(TInt aError, TRACE_CONTEXT(AudioPlayer::MapcInitComplete, EAudioInternal); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); if (KErrNone == aError) { maxVolumeChanged(m_player->MaxVolume()); diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h index e43cadd..cf4f6d5 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.h +++ b/src/3rdparty/phonon/mmf/audioplayer.h @@ -65,18 +65,19 @@ typedef CMdaAudioPlayerUtility NativePlayer; virtual void doStop(); virtual void doSeek(qint64 milliseconds); virtual int setDeviceVolume(int mmfVolume); + virtual int openFile(const QString &fileName); virtual int openFile(RFile& file); virtual int openUrl(const QString& url); virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; - virtual void close(); + virtual void doClose(); // MediaObjectInterface virtual bool hasVideo() const; - virtual qint64 currentTime() const; virtual qint64 totalTime() const; // AbstractMediaPlayer + virtual qint64 getCurrentTime() const; virtual int numberOfMetaDataEntries() const; virtual QPair metaDataEntry(int index) const; diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 98326b8..2c7a7ef 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -61,6 +61,9 @@ MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(paren TRACE_CONTEXT(MediaObject::MediaObject, EAudioApi); TRACE_ENTRY_0(); + const int err = m_fileServer.Connect(); + QT_TRAP_THROWING(User::LeaveIfError(err)); + Q_UNUSED(parent); TRACE_EXIT_0(); @@ -99,12 +102,6 @@ bool MMF::MediaObject::openRecognizer() return false; } - err = m_fileServer.Connect(); - if (KErrNone != err) { - TRACE("RFs::Connect error %d", err); - return false; - } - // This must be called in order to be able to share file handles with // the recognizer server (see fileMediaType function). err = m_fileServer.ShareProtected(); @@ -127,13 +124,8 @@ MMF::MediaType MMF::MediaObject::fileMediaType MediaType result = MediaTypeUnknown; if (openRecognizer()) { - - const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName)); - - Q_ASSERT(!m_file); - m_file = new RFile; - TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); - + TInt err = openFileHandle(fileName); + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); if (KErrNone == err) { TDataRecognitionResult recognizerResult; err = m_recognizer.RecognizeData(*m_file, recognizerResult); @@ -141,16 +133,30 @@ MMF::MediaType MMF::MediaObject::fileMediaType const TPtrC mimeType = recognizerResult.iDataType.Des(); result = Utils::mimeTypeToMediaType(mimeType); } else { - TRACE("RApaLsSession::RecognizeData filename %S error %d", fileNameSymbian.data(), err); + TRACE("RApaLsSession::RecognizeData filename %S error %d", nativeFileName.data(), err); } } else { - TRACE("RFile::Open filename %S error %d", fileNameSymbian.data(), err); + TRACE("RFile::Open filename %S error %d", nativeFileName.data(), err); } } return result; } +int MMF::MediaObject::openFileHandle(const QString &fileName) +{ + TRACE_CONTEXT(MediaObject::openFileHandle, EAudioInternal); + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRACE_ENTRY("filename %S", nativeFileName.data()); + if (m_file) + m_file->Close(); + delete m_file; + m_file = 0; + m_file = new RFile; + TInt err = m_file->Open(m_fileServer, *nativeFileName, EFileRead | EFileShareReadersOrWriters); + return err; +} + MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size) { TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal); diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 5399e27..5d785fb 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -89,6 +89,7 @@ public: void setVideoOutput(AbstractVideoOutput* videoOutput); + int openFileHandle(const QString &fileName); RFile* file() const; QResource* resource() const; -- cgit v0.12 From bd53ef2094a020789e9543156c524cd90a2d5302 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 27 Sep 2010 18:07:35 +0100 Subject: qmediaplayer: show buffer status of 0% During progressive download, it is not possible for the Symbian MMF Phonon backend to determine the buffering status, so it returns a value of 0%. This change causes qmediaplayer to display this value in the UI, thereby giving a visible notification of buffering during progressive download. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- demos/qmediaplayer/mediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index 3cb0616..97a8e35 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -716,7 +716,7 @@ void MediaPlayer::openFile() void MediaPlayer::bufferStatus(int percent) { - if (percent == 0 || percent == 100) + if (percent == 100) progressLabel->setText(QString()); else { QString str = QString::fromLatin1("(%1%)").arg(percent); -- cgit v0.12 From 19085117bfece0709c996ed445a476add4f6815b Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 1 Oct 2010 12:40:44 +0200 Subject: Fix focus appearance of tabwidget tabs with QGtkStyle There was an issue with ubuntu Ambience theme since it requires a custom tab style. This was not currently supported by QGtkStyle. Task-number: QTBUG-14161 Reviewed-by: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 7f342f9..9cc64b3 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -803,10 +803,13 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, // ### this mess should move to subcontrolrect QRect frameRect = option->rect.adjusted(1, 1, -1, -2); - if (qobject_cast(widget)) - frameRect.adjust(-1, 1, 1, 1); - - gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style); + if (qobject_cast(widget)) { + GtkWidget *gtkNotebook = d->gtkWidget("GtkNotebook"); + style = gtkPainter.getStyle(gtkNotebook); + gtkPainter.paintFocus(gtkNotebook, "tab", frameRect.adjusted(-1, 1, 1, 1), GTK_STATE_ACTIVE, style); + } else { + gtkPainter.paintFocus(NULL, "tab", frameRect, GTK_STATE_ACTIVE, style); + } } break; -- cgit v0.12 From 8a895dbcc9aacab3b0059119650a74bbaff1a27b Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 30 Sep 2010 10:04:50 +0200 Subject: Setting the _NET_WM_STATE Atom only when its not already set Task: QT-3918 Reviewed By: Bradley T. Hughes --- src/gui/kernel/qwidget_x11.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 8d80e10..9085e98 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -1933,20 +1933,27 @@ void QWidgetPrivate::show_sys() if (flags & Qt::WindowStaysOnTopHint) { if (flags & Qt::WindowStaysOnBottomHint) qWarning() << "QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time"; - netWmState.append(ATOM(_NET_WM_STATE_ABOVE)); - netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_ABOVE))) + netWmState.append(ATOM(_NET_WM_STATE_ABOVE)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_STAYS_ON_TOP))) + netWmState.append(ATOM(_NET_WM_STATE_STAYS_ON_TOP)); } else if (flags & Qt::WindowStaysOnBottomHint) { - netWmState.append(ATOM(_NET_WM_STATE_BELOW)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_BELOW))) + netWmState.append(ATOM(_NET_WM_STATE_BELOW)); } if (q->isFullScreen()) { - netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_FULLSCREEN))) + netWmState.append(ATOM(_NET_WM_STATE_FULLSCREEN)); } if (q->isMaximized()) { - netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ)); - netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ))) + netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_HORZ)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_MAXIMIZED_VERT))) + netWmState.append(ATOM(_NET_WM_STATE_MAXIMIZED_VERT)); } if (data.window_modality != Qt::NonModal) { - netWmState.append(ATOM(_NET_WM_STATE_MODAL)); + if (!netWmState.contains(ATOM(_NET_WM_STATE_MODAL))) + netWmState.append(ATOM(_NET_WM_STATE_MODAL)); } if (!netWmState.isEmpty()) { -- cgit v0.12 From dc4d4a87c0c17e41c0e16bc481db82de0f620596 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 1 Oct 2010 14:26:49 +0200 Subject: Doc: Implementing features to the search feature. Adding search to narrow/slim fit mode --- doc/src/template/scripts/functions.js | 2 +- doc/src/template/style/narrow.css | 1 + doc/src/template/style/style.css | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index 0bb88a8..b89e05f 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -89,7 +89,7 @@ function processNokiaData(response){ /* fetch the responce from the server using page as the root element */ var propertyTags = response.getElementsByTagName('page'); /* reset counters */ - var lookupCount = 0; + var apiCount = 0; var articleCount = 0; var exampleCount = 0; var full_li_element; diff --git a/doc/src/template/style/narrow.css b/doc/src/template/style/narrow.css index 8e42a0d..c1e3f61 100644 --- a/doc/src/template/style/narrow.css +++ b/doc/src/template/style/narrow.css @@ -61,6 +61,7 @@ { background-image: none; text-indent: 0; + width: 260px; } .narrow .header #nav-topright diff --git a/doc/src/template/style/style.css b/doc/src/template/style/style.css index 5833266..c07385c 100755 --- a/doc/src/template/style/style.css +++ b/doc/src/template/style/style.css @@ -204,6 +204,10 @@ { font-size: 13px; } + .red + { + color:red; + } /* end font style elements */ /* global settings*/ @@ -907,7 +911,6 @@ .wrap .content table p { line-height: 20px; - /* padding: 0px;*/ } .wrap .content ul { -- cgit v0.12 From c168be1aa3dc4f7ccc70d530244fc97af0b4d1e1 Mon Sep 17 00:00:00 2001 From: mread Date: Fri, 1 Oct 2010 13:13:42 +0100 Subject: fixed hybrid heap Symbian udeb build issues Fixed name collision with TAllocFail Added definition for EDebugHdrSize and fixed scope issue Added definition for SRAllocatorBurstFail Added a definition for global enum ETHeapBadDebugFailParameter Tested compilation on: Symbian^3 RnD - armv5_urel, armv5_udeb, winscw_urel, winscw_udeb S60 3.1 SDK - armv5_urel, armv5_udeb S60 5.0 SDK - armv5_urel, armv5_udeb Symbian^3 PDK - armv5_urel, armv5_udeb Symbian^4 RnD - armv5_urel, armv5_udeb Basic functional testing on N8 armv5_urel Task-number: QTBUG-14168 Reviewed-by: Shane Kearns --- src/corelib/arch/symbian/debugfunction.cpp | 2 +- src/corelib/arch/symbian/heap_hybrid_p.h | 6 +++++- src/corelib/arch/symbian/qt_hybridheap_symbian_p.h | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/corelib/arch/symbian/debugfunction.cpp b/src/corelib/arch/symbian/debugfunction.cpp index f3b5d2d..91f6917 100644 --- a/src/corelib/arch/symbian/debugfunction.cpp +++ b/src/corelib/arch/symbian/debugfunction.cpp @@ -549,7 +549,7 @@ void ResetAllocCellLevels(TAny* aPtr, RHybridHeap::TCellType aType, TAny* aCell, if (aType == RHybridHeap::EGoodAllocatedCell) { - RHybridHeap::SDebugCell* DbgCell = (RHybridHeap::SDebugCell*)((TUint8*)aCell-RHeap::EDebugHdrSize); + RHybridHeap::SDebugCell* DbgCell = (RHybridHeap::SDebugCell*)((TUint8*)aCell-RHybridHeap::EDebugHdrSize); DbgCell->nestingLevel = 0; } } diff --git a/src/corelib/arch/symbian/heap_hybrid_p.h b/src/corelib/arch/symbian/heap_hybrid_p.h index 736af72..95fb3d4 100644 --- a/src/corelib/arch/symbian/heap_hybrid_p.h +++ b/src/corelib/arch/symbian/heap_hybrid_p.h @@ -103,11 +103,15 @@ public: EGetSize=48, EGetMaxLength, EGetBase, EAlignInteger, EAlignAddr }; enum TDebugOp { EWalk = 128, EHybridHeap }; - enum TAllocFail + enum THybridAllocFail { ERandom, ETrueRandom, EDeterministic, EHybridNone, EFailNext, EReset, EBurstRandom, EBurstTrueRandom, EBurstDeterministic, EBurstFailNext, ECheckFailure, }; + enum { EDebugHdrSize = sizeof(SDebugCell) }; +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS + struct SRAllocatorBurstFail {TInt iBurst; TInt iRate; TInt iUnused[2];}; +#endif struct HeapInfo { diff --git a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h index 5827aca..92cfe0e 100644 --- a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h +++ b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h @@ -100,6 +100,9 @@ inline int noBTrace() {return 0;} #define BTraceContext12(a,b,c,d,e) noBTrace() #endif +// declare ETHeapBadDebugFailParameter, where missing +#define ETHeapBadDebugFailParameter ((TCdtPanic)213) + #ifndef QT_SYMBIAN_HAVE_U32STD_H struct SThreadCreateInfo { -- cgit v0.12 From 628c9625c4bf6d0e189f9e8da5268eb7629e7597 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 1 Oct 2010 14:56:00 +0200 Subject: Doc: Fixing link titles and error color in search results --- doc/src/template/scripts/functions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/src/template/scripts/functions.js b/doc/src/template/scripts/functions.js index b89e05f..47539d2 100755 --- a/doc/src/template/scripts/functions.js +++ b/doc/src/template/scripts/functions.js @@ -124,7 +124,7 @@ function processNokiaData(response){ /* adding the URL attribute*/ full_li_element += propertyTags[i].getElementsByTagName('pageUrl')[j].firstChild.nodeValue; /* adding the link title and closing the link and list elements */ - full_li_element += '">' + propertyTags[i].getElementsByTagName('pageTitle')[0].firstChild.nodeValue + ''; + full_li_element += '">' + propertyTags[i].getElementsByTagName('pageWords')[0].firstChild.nodeValue + ''; /* appending the list element to the #resultlist div*/ $('#resultlist').append(full_li_element); } @@ -139,7 +139,12 @@ function processNokiaData(response){ $('#apicount').html(apiCount); $('#articlecount').html(articleCount); $('#examplecount').html(exampleCount); - } + + } + else { + $('#pageType').addClass('red'); + } + // Filtering results in display @@ -181,6 +186,7 @@ function CheckEmptyAndLoadList() /* Start Extracting information for feedback and adding this to the feedback form */ var pageUrl = window.location.href; var pageVal = $('title').html(); + $('#pageType').removeClass('red'); $('#feedUrl').remove(); $('#pageVal').remove(); $('.menuAlert').remove(); -- cgit v0.12 From d1b2480f33641055f2d729212addf059577a4e01 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 1 Oct 2010 15:33:37 +0100 Subject: Fixed crash on startup in Symbian debug build This fixes a typo in a debug-only function in the hybrid heap allocator. The typo causes an assertion to fail during startup of applications, when using a debug build of Qt. Reviewed-by: mread --- src/corelib/arch/symbian/debugfunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/symbian/debugfunction.cpp b/src/corelib/arch/symbian/debugfunction.cpp index 91f6917..31937e8 100644 --- a/src/corelib/arch/symbian/debugfunction.cpp +++ b/src/corelib/arch/symbian/debugfunction.cpp @@ -1105,7 +1105,7 @@ void RHybridHeap::DoCheckSlab(slab* aSlab, TAllocatorType aSlabType, TAny* aBfr) unsigned used = SlabHeaderUsedm4(h)+4; unsigned size = SlabHeaderSize(h); __HEAP_CORRUPTED_TEST( (used < SLABSIZE),ETHeapBadCellAddress, aBfr, aSlab); - __HEAP_CORRUPTED_TEST( ((size > 3 ) && (size < MAXSLABSIZE)), ETHeapBadCellAddress,aBfr,aSlab); + __HEAP_CORRUPTED_TEST( ((size > 3 ) && (size <= MAXSLABSIZE)), ETHeapBadCellAddress,aBfr,aSlab); unsigned count = 0; switch ( aSlabType ) -- cgit v0.12 From b3a46493a1a74bd7918bd68638c28cf6e84eb57f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 15 Jul 2010 16:08:43 +0200 Subject: QWorkspace: fix hardcoded min size overwriting the real min size The setMinimumSize call was having precedence over the minimumSizeHint, so when having a sizegrip enabled it was possible to resize a MDI window to a much smaller size than its min size (actually it would flicker between the two sizes, on each resize). Fixed by moving that min size (for the titlebar contents) to the calculations in minimumSizeHint(). Reviewed-by: mariusso --- src/gui/widgets/qworkspace.cpp | 15 +++++++++------ tests/auto/qworkspace/tst_qworkspace.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp index 7180c4d..3a9b30c 100644 --- a/src/gui/widgets/qworkspace.cpp +++ b/src/gui/widgets/qworkspace.cpp @@ -2551,7 +2551,6 @@ QWorkspaceChild::QWorkspaceChild(QWidget* window, QWorkspace *parent, Qt::Window this, SLOT(titleBarDoubleClicked())); } - setMinimumSize(128, 0); int fw = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); setContentsMargins(fw, fw, fw, fw); @@ -2702,11 +2701,15 @@ QSize QWorkspaceChild::sizeHint() const QSize QWorkspaceChild::minimumSizeHint() const { - if (!childWidget) - return QWidget::minimumSizeHint() + baseSize(); - QSize s = childWidget->minimumSize(); - if (s.isEmpty()) - s = childWidget->minimumSizeHint(); + QSize s; + if (!childWidget) { + s = QWidget::minimumSizeHint(); + } else { + s = childWidget->minimumSize(); + if (s.isEmpty()) + s = childWidget->minimumSizeHint(); + } + s = s.expandedTo(QSize(128, 0)); return s + baseSize(); } diff --git a/tests/auto/qworkspace/tst_qworkspace.cpp b/tests/auto/qworkspace/tst_qworkspace.cpp index 4cf76b5..9039eb3 100644 --- a/tests/auto/qworkspace/tst_qworkspace.cpp +++ b/tests/auto/qworkspace/tst_qworkspace.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #if defined(QT3_SUPPORT) #include @@ -591,16 +592,25 @@ void tst_QWorkspace::childSize() MyChild *child = new MyChild(&ws); child->show(); + ws.addWindow(child); QCOMPARE(child->size(), child->sizeHint()); delete child; child = new MyChild(&ws); child->setFixedSize(200, 200); child->show(); + ws.addWindow(child); QCOMPARE(child->size(), child->minimumSize()); + QCOMPARE(child->parentWidget()->metaObject()->className(), "QWorkspaceChild"); + QVERIFY(child->parentWidget()->width() >= 200); + // check that the minimum size is respected, using closestAcceptableSize + // like QSizeGrip does. + const QSize newSize = QLayout::closestAcceptableSize(child->parentWidget(), QSize(100, 100)); + QVERIFY(newSize.width() >= 200); delete child; child = new MyChild(&ws); + ws.addWindow(child); child->resize(150, 150); child->show(); QCOMPARE(child->size(), QSize(150,150)); -- cgit v0.12 From 51d007e0fa699339f072956bbd8bfe33db9b7f70 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Sun, 3 Oct 2010 19:43:29 +0100 Subject: Added qmake check for presence of RHttpDownloadMgr header downloadmgrclient.h is not found on S^4 baselines, causing a build failure. This commit is a temporary workaround, which disables progressive download support if the header is not found. The correct solution is to determine whether the RHttpDownloadMgr definition has moved, and if so, to modify the .pro file to include the new path. Task-number: QTBUG-10769 Reviewed-by: TrustMe --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 26 ++++++++++-- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 9 ++++- src/3rdparty/phonon/mmf/download.h | 2 - src/plugins/phonon/mmf/mmf.pro | 53 +++++++++++++++---------- 4 files changed, 61 insertions(+), 29 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index a728423..dfc5840 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -56,8 +56,10 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer , m_mmfMaxVolume(NullMaxVolume) , m_prefinishMarkSent(false) , m_aboutToFinishSent(false) +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD , m_download(0) , m_downloadStalled(false) +#endif { connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick())); connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick())); @@ -256,7 +258,9 @@ void MMF::AbstractMediaPlayer::open() symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); - } else if (url.scheme() == QLatin1String("http")) { + } +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD + else if (url.scheme() == QLatin1String("http")) { Q_ASSERT(!m_download); m_download = new Download(url, this); connect(m_download, SIGNAL(lengthChanged(qint64)), @@ -264,7 +268,9 @@ void MMF::AbstractMediaPlayer::open() connect(m_download, SIGNAL(stateChanged(Download::State)), this, SLOT(downloadStateChanged(Download::State))); m_download->start(); - } else { + } +#endif + else { symbianErr = openUrl(url.toString()); if (KErrNone != symbianErr) errorMessage = tr("Error opening URL"); @@ -308,8 +314,10 @@ void MMF::AbstractMediaPlayer::open() void MMF::AbstractMediaPlayer::close() { doClose(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD delete m_download; m_download = 0; +#endif m_position = 0; } @@ -419,7 +427,9 @@ void MMF::AbstractMediaPlayer::loadingComplete(int error) bufferingComplete(); doSeek(m_position); startPlayback(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD m_downloadStalled = false; +#endif } } else { Q_ASSERT(Phonon::LoadingState == state()); @@ -472,12 +482,20 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds bool MMF::AbstractMediaPlayer::isProgressiveDownload() const { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD return (0 != m_download); +#else + return false; +#endif } bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD return m_downloadStalled; +#else + return false; +#endif } //----------------------------------------------------------------------------- @@ -547,6 +565,7 @@ void MMF::AbstractMediaPlayer::startPlayback() void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi); TRACE_ENTRY("state %d", state()); Q_ASSERT(isProgressiveDownload()); @@ -555,7 +574,6 @@ void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() bufferingStarted(); // Video player loses window handle when closed - need to reapply it here videoOutputChanged(); -#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY m_download->resume(); #endif } @@ -569,6 +587,7 @@ void MMF::AbstractMediaPlayer::bufferStatusTick() emit MMF::AbstractPlayer::bufferStatus(status); } +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length) { TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi); @@ -611,6 +630,7 @@ void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state) break; } } +#endif // PHONON_MMF_PROGRESSIVE_DOWNLOAD Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const { diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 99fc101..c3b4528 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -23,7 +23,9 @@ along with this library. If not, see . #include #include #include "abstractplayer.h" -#include "download.h" +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD +# include "download.h" +#endif class RFile; @@ -118,8 +120,10 @@ private: private Q_SLOTS: void positionTick(); void bufferStatusTick(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD void downloadLengthChanged(qint64); void downloadStateChanged(Download::State); +#endif private: MediaObject *const m_parent; @@ -140,9 +144,10 @@ private: // Used for playback of resource files TPtrC8 m_buffer; - // Used for progressive download +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD Download *m_download; bool m_downloadStalled; +#endif QMultiMap m_metaData; diff --git a/src/3rdparty/phonon/mmf/download.h b/src/3rdparty/phonon/mmf/download.h index b57348b..bda7963 100644 --- a/src/3rdparty/phonon/mmf/download.h +++ b/src/3rdparty/phonon/mmf/download.h @@ -70,8 +70,6 @@ public: const QUrl &sourceUrl() const; const QString &targetFileName() const; void start(); - - // Only has effect when QT_PHONON_MMF_DOWNLOAD_DUMMY is defined void resume(); enum State { diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 902354f..ac11188 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,7 +36,6 @@ symbian { $$PHONON_MMF_DIR/backend.h \ $$PHONON_MMF_DIR/bassboost.h \ $$PHONON_MMF_DIR/defs.h \ - $$PHONON_MMF_DIR/download.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ @@ -62,7 +61,6 @@ symbian { $$PHONON_MMF_DIR/abstractvideoplayer.cpp \ $$PHONON_MMF_DIR/backend.cpp \ $$PHONON_MMF_DIR/bassboost.cpp \ - $$PHONON_MMF_DIR/download.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ @@ -77,25 +75,37 @@ symbian { $$PHONON_MMF_DIR/utils.cpp \ $$PHONON_MMF_DIR/videowidget.cpp - # Test for whether the build environment supports video rendering to graphics - # surfaces. - symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) { - HEADERS += \ - $$PHONON_MMF_DIR/videooutput_surface.h \ - $$PHONON_MMF_DIR/videoplayer_surface.h - SOURCES += \ - $$PHONON_MMF_DIR/videooutput_surface.cpp \ - $$PHONON_MMF_DIR/videoplayer_surface.cpp - DEFINES += PHONON_MMF_VIDEO_SURFACES - } else { - HEADERS += \ - $$PHONON_MMF_DIR/ancestormovemonitor.h \ - $$PHONON_MMF_DIR/videooutput_dsa.h \ - $$PHONON_MMF_DIR/videoplayer_dsa.h - SOURCES += \ - $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ - $$PHONON_MMF_DIR/videooutput_dsa.cpp \ - $$PHONON_MMF_DIR/videoplayer_dsa.cpp \ + symbian { + # Test for whether the build environment supports video rendering to graphics + # surfaces. + exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) { + HEADERS += \ + $$PHONON_MMF_DIR/videooutput_surface.h \ + $$PHONON_MMF_DIR/videoplayer_surface.h + SOURCES += \ + $$PHONON_MMF_DIR/videooutput_surface.cpp \ + $$PHONON_MMF_DIR/videoplayer_surface.cpp + DEFINES += PHONON_MMF_VIDEO_SURFACES + } else { + HEADERS += \ + $$PHONON_MMF_DIR/ancestormovemonitor.h \ + $$PHONON_MMF_DIR/videooutput_dsa.h \ + $$PHONON_MMF_DIR/videoplayer_dsa.h + SOURCES += \ + $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ + $$PHONON_MMF_DIR/videooutput_dsa.cpp \ + $$PHONON_MMF_DIR/videoplayer_dsa.cpp \ + } + + # Test whether the build environment includes support for the Download Manager + # API, required for Progressive Download + exists($${EPOCROOT}epoc32/include/downloadmgrclient.h) | \ + exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { + HEADERS += $$PHONON_MMF_DIR/download.h + SOURCES += $$PHONON_MMF_DIR/download.cpp + LIBS += -ldownloadmgr + DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD + } } LIBS += -lcone @@ -113,7 +123,6 @@ symbian { LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream - LIBS += -ldownloadmgr # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From d7c052a509191a0a5c632391ce318c5036900a18 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 4 Oct 2010 10:44:35 +1000 Subject: Compile Task-number: QTBUG-14050 --- .../graphicsitems/qdeclarativetextlayout.cpp | 4 ++ .../graphicsitems/qdeclarativetextlayout_p.h | 51 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index 722378e..ca2963b 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -5,6 +5,8 @@ #include #include +QT_BEGIN_NAMESPACE + class QDeclarativeTextLayoutPrivate { public: @@ -311,3 +313,5 @@ void QDeclarativeTextLayout::draw(QPainter *painter, const QPointF &p) } } +QT_END_NAMESPACE + diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h index 1a4473d..90bf0e0 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h +++ b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h @@ -1,8 +1,55 @@ +/**************************************************************************** +** +** 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 QtDeclarative 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 QDECLARATIVETEXTLAYOUT_P_H #define QDECLARATIVETEXTLAYOUT_P_H #include +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + class QDeclarativeTextLayoutPrivate; class QDeclarativeTextLayout : public QTextLayout { @@ -20,4 +67,8 @@ private: QDeclarativeTextLayoutPrivate *d; }; +QT_END_NAMESPACE + +QT_END_HEADER + #endif // QDECLARATIVETEXTLAYOUT_P_H -- cgit v0.12 From 29ddbd6f3021bd69a7badedc9749850ec1c1dabf Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 4 Oct 2010 11:59:38 +1000 Subject: Fix clipping behavior for non-cached text. --- src/declarative/graphicsitems/qdeclarativetext.cpp | 2 +- src/declarative/graphicsitems/qdeclarativetext_p_p.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index c2dd850..65f1564 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -1143,7 +1143,7 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid } else { qreal y = boundingRect().y(); - bool needClip = !clip() && (d->cachedLayoutSize.width() > width() || + bool needClip = clip() && (d->cachedLayoutSize.width() > width() || d->cachedLayoutSize.height() > height()); if (needClip) { diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h index ba1ec78..db68558 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h @@ -66,7 +66,6 @@ QT_BEGIN_NAMESPACE class QTextLayout; class QTextDocumentWithImageResources; -#define QML_NO_TEXT_CACHE class QDeclarativeTextPrivate : public QDeclarativeItemPrivate { Q_DECLARE_PUBLIC(QDeclarativeText) -- cgit v0.12 From efb0d6a986b991432d37c15151df7538fba8f430 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 4 Oct 2010 12:37:38 +1000 Subject: Remove unused, unexported class. --- src/declarative/qml/rewriter/rewriter.cpp | 102 -------------------- src/declarative/qml/rewriter/rewriter.pri | 5 - src/declarative/qml/rewriter/rewriter_p.h | 153 ------------------------------ 3 files changed, 260 deletions(-) delete mode 100644 src/declarative/qml/rewriter/rewriter.cpp delete mode 100644 src/declarative/qml/rewriter/rewriter_p.h diff --git a/src/declarative/qml/rewriter/rewriter.cpp b/src/declarative/qml/rewriter/rewriter.cpp deleted file mode 100644 index 6d2ccfb..0000000 --- a/src/declarative/qml/rewriter/rewriter.cpp +++ /dev/null @@ -1,102 +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 QtDeclarative 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 "private/rewriter_p.h" - -#include - -QT_QML_BEGIN_NAMESPACE - -using namespace QDeclarativeJS; - -void Rewriter::replace(const AST::SourceLocation &loc, const QString &text) -{ replace(loc.offset, loc.length, text); } - -void Rewriter::remove(const AST::SourceLocation &loc) -{ return replace(loc.offset, loc.length, QString()); } - -void Rewriter::remove(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc) -{ return replace(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, QString()); } - -void Rewriter::insertTextBefore(const AST::SourceLocation &loc, const QString &text) -{ replace(loc.offset, 0, text); } - -void Rewriter::insertTextAfter(const AST::SourceLocation &loc, const QString &text) -{ replace(loc.offset + loc.length, 0, text); } - -void Rewriter::replace(int offset, int length, const QString &text) -{ textWriter.replace(offset, length, text); } - -void Rewriter::insertText(int offset, const QString &text) -{ replace(offset, 0, text); } - -void Rewriter::removeText(int offset, int length) -{ replace(offset, length, QString()); } - -QString Rewriter::textAt(const AST::SourceLocation &loc) const -{ return _code.mid(loc.offset, loc.length); } - -QString Rewriter::textAt(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc) const -{ return _code.mid(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset); } - -void Rewriter::accept(QDeclarativeJS::AST::Node *node) -{ QDeclarativeJS::AST::Node::acceptChild(node, this); } - -void Rewriter::moveTextBefore(const AST::SourceLocation &firstLoc, - const AST::SourceLocation &lastLoc, - const AST::SourceLocation &loc) -{ - move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset); -} - -void Rewriter::moveTextAfter(const AST::SourceLocation &firstLoc, - const AST::SourceLocation &lastLoc, - const AST::SourceLocation &loc) -{ - move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset + loc.length); -} - -void Rewriter::move(int pos, int length, int to) -{ - textWriter.move(pos, length, to); -} - -QT_QML_END_NAMESPACE diff --git a/src/declarative/qml/rewriter/rewriter.pri b/src/declarative/qml/rewriter/rewriter.pri index 2c29061..a9fa1b5 100644 --- a/src/declarative/qml/rewriter/rewriter.pri +++ b/src/declarative/qml/rewriter/rewriter.pri @@ -2,8 +2,3 @@ INCLUDEPATH += $$PWD HEADERS += $$PWD/textwriter_p.h SOURCES += $$PWD/textwriter.cpp - -!no_ast_rewriter { - HEADERS += $$PWD/rewriter_p.h - SOURCES += $$PWD/rewriter.cpp -} diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h deleted file mode 100644 index 4799469..0000000 --- a/src/declarative/qml/rewriter/rewriter_p.h +++ /dev/null @@ -1,153 +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 QtDeclarative 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 REWRITER_H -#define REWRITER_H - -#include "private/textwriter_p.h" - -#include - -#include -#include - -QT_BEGIN_HEADER -QT_QML_BEGIN_NAMESPACE - -namespace QDeclarativeJS { - -//////////////////////////////////////////////////////////////////////////////// -// Replacement -//////////////////////////////////////////////////////////////////////////////// -class Replacement -{ - int _offset; - int _length; - QString _text; - -public: - Replacement(int offset = 0, int length = 0, const QString &text = QString()) - : _offset(offset), _length(length), _text(text) - { } - - bool isNull() const { return _offset == _length; } - operator bool() const { return ! isNull(); } - - int offset() const { return _offset; } - int length() const { return _length; } - QString text() const { return _text; } -}; - - - -//////////////////////////////////////////////////////////////////////////////// -// Rewriter -//////////////////////////////////////////////////////////////////////////////// -class Rewriter: public AST::Visitor -{ -protected: - TextWriter textWriter; -public: - // - // Token based API - // - - /// Returns the text of the token at the given \a location. - QString textAt(const AST::SourceLocation &location) const; - - QString textAt(const AST::SourceLocation &firstLoc, - const AST::SourceLocation &lastLoc) const; - - /// Replace the token at \a loc with the given \a text. - void replace(const AST::SourceLocation &loc, const QString &text); - - /// Remove the token at the given \a location. - void remove(const AST::SourceLocation &location); - - /// Remove all tokens in the range [\a firstLoc, \a lastLoc]. - void remove(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc); - - /// Insert \a text before the token at the given \a location. - void insertTextBefore(const AST::SourceLocation &location, const QString &text); - - /// Insert \a text after the token at the given \a location. - void insertTextAfter(const AST::SourceLocation &loc, const QString &text); - - void moveTextBefore(const AST::SourceLocation &firstLoc, - const AST::SourceLocation &lastLoc, - const AST::SourceLocation &loc); - - void moveTextAfter(const AST::SourceLocation &firstLoc, - const AST::SourceLocation &lastLoc, - const AST::SourceLocation &loc); - - // - // low-level offset based API - // - virtual void replace(int offset, int length, const QString &text); - virtual void move(int pos, int length, int to); - void insertText(int offset, const QString &text); - void removeText(int offset, int length); - - /// Visit the given \a node. - void accept(AST::Node *node); - - /// Returns the original unchanged source code. - QString code() const { return _code; } - - /// Returns the list of replacements. - QList replacementList() const { return _replacementList; } - -protected: - /// \internal - void setCode(const QString &code) { _code = code; } - -private: - QString _code; - QList _replacementList; -}; - -} // end of namespace QDeclarativeJS - -QT_QML_END_NAMESPACE -QT_END_HEADER - -#endif // REWRITER_H -- cgit v0.12 From b2e79e0b5c26e70ad586cb965808059330cc0893 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 4 Oct 2010 13:39:47 +1000 Subject: Prevent crash in XmlListModel when appending an empty role. --- src/declarative/util/qdeclarativexmllistmodel.cpp | 2 +- .../declarative/qdeclarativexmllistmodel/data/roleCrash.qml | 7 +++++++ .../qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp index 24edc89..ce5b483 100644 --- a/src/declarative/util/qdeclarativexmllistmodel.cpp +++ b/src/declarative/util/qdeclarativexmllistmodel.cpp @@ -476,7 +476,7 @@ public: void QDeclarativeXmlListModelPrivate::append_role(QDeclarativeListProperty *list, QDeclarativeXmlListModelRole *role) { QDeclarativeXmlListModel *_this = qobject_cast(list->object); - if (_this) { + if (_this && role) { int i = _this->d_func()->roleObjects.count(); _this->d_func()->roleObjects.append(role); if (_this->d_func()->roleNames.contains(role->name())) { diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml new file mode 100644 index 0000000..492dad9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativexmllistmodel/data/roleCrash.qml @@ -0,0 +1,7 @@ +import QtQuick 1.0 + +XmlListModel { + id: model + XmlRole {} + Component.onCompleted: model.roles = 0 +} diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp index bd19bd3..a14f942 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp +++ b/tests/auto/declarative/qdeclarativexmllistmodel/tst_qdeclarativexmllistmodel.cpp @@ -96,6 +96,8 @@ private slots: void threading_data(); void propertyChanges(); + void roleCrash(); + private: QString makeItemXmlAndData(const QString &data, QDeclarativeXmlModelData *modelData = 0) const { @@ -825,6 +827,15 @@ void tst_qdeclarativexmllistmodel::propertyChanges() delete model; } +void tst_qdeclarativexmllistmodel::roleCrash() +{ + // don't crash + QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/roleCrash.qml")); + QDeclarativeXmlListModel *model = qobject_cast(component.create()); + QVERIFY(model != 0); + delete model; +} + QTEST_MAIN(tst_qdeclarativexmllistmodel) #include "tst_qdeclarativexmllistmodel.moc" -- cgit v0.12 From 15cf932b3cc93239333694842be808acabae7bb3 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 4 Oct 2010 15:04:57 +1000 Subject: Add autotest for reserved words in QML. --- .../tst_qdeclarativelanguage.cpp | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 7f81fc0..8609a7e 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -128,6 +128,8 @@ private slots: void defaultPropertyListOrder(); void declaredPropertyValues(); void dontDoubleCallClassBegin(); + void reservedWords_data(); + void reservedWords(); void basicRemote_data(); void basicRemote(); @@ -1222,6 +1224,80 @@ void tst_qdeclarativelanguage::dontDoubleCallClassBegin() delete o; } +void tst_qdeclarativelanguage::reservedWords_data() +{ + QTest::addColumn("word"); + + QTest::newRow("abstract") << QByteArray("abstract"); + QTest::newRow("as") << QByteArray("as"); + QTest::newRow("boolean") << QByteArray("boolean"); + QTest::newRow("break") << QByteArray("break"); + QTest::newRow("byte") << QByteArray("byte"); + QTest::newRow("case") << QByteArray("case"); + QTest::newRow("catch") << QByteArray("catch"); + QTest::newRow("char") << QByteArray("char"); + QTest::newRow("class") << QByteArray("class"); + QTest::newRow("continue") << QByteArray("continue"); + QTest::newRow("const") << QByteArray("const"); + QTest::newRow("debugger") << QByteArray("debugger"); + QTest::newRow("default") << QByteArray("default"); + QTest::newRow("delete") << QByteArray("delete"); + QTest::newRow("do") << QByteArray("do"); + QTest::newRow("double") << QByteArray("double"); + QTest::newRow("else") << QByteArray("else"); + QTest::newRow("enum") << QByteArray("enum"); + QTest::newRow("export") << QByteArray("export"); + QTest::newRow("extends") << QByteArray("extends"); + QTest::newRow("false") << QByteArray("false"); + QTest::newRow("final") << QByteArray("final"); + QTest::newRow("finally") << QByteArray("finally"); + QTest::newRow("float") << QByteArray("float"); + QTest::newRow("for") << QByteArray("for"); + QTest::newRow("function") << QByteArray("function"); + QTest::newRow("goto") << QByteArray("goto"); + QTest::newRow("if") << QByteArray("if"); + QTest::newRow("implements") << QByteArray("implements"); + QTest::newRow("import") << QByteArray("import"); + QTest::newRow("in") << QByteArray("in"); + QTest::newRow("instanceof") << QByteArray("instanceof"); + QTest::newRow("int") << QByteArray("int"); + QTest::newRow("interface") << QByteArray("interface"); + QTest::newRow("long") << QByteArray("long"); + QTest::newRow("native") << QByteArray("native"); + QTest::newRow("new") << QByteArray("new"); + QTest::newRow("null") << QByteArray("null"); + QTest::newRow("package") << QByteArray("package"); + QTest::newRow("private") << QByteArray("private"); + QTest::newRow("protected") << QByteArray("protected"); + QTest::newRow("public") << QByteArray("public"); + QTest::newRow("return") << QByteArray("return"); + QTest::newRow("short") << QByteArray("short"); + QTest::newRow("static") << QByteArray("static"); + QTest::newRow("super") << QByteArray("super"); + QTest::newRow("switch") << QByteArray("switch"); + QTest::newRow("synchronized") << QByteArray("synchronized"); + QTest::newRow("this") << QByteArray("this"); + QTest::newRow("throw") << QByteArray("throw"); + QTest::newRow("throws") << QByteArray("throws"); + QTest::newRow("transient") << QByteArray("transient"); + QTest::newRow("true") << QByteArray("true"); + QTest::newRow("try") << QByteArray("try"); + QTest::newRow("typeof") << QByteArray("typeof"); + QTest::newRow("var") << QByteArray("var"); + QTest::newRow("void") << QByteArray("void"); + QTest::newRow("volatile") << QByteArray("volatile"); + QTest::newRow("while") << QByteArray("while"); + QTest::newRow("with") << QByteArray("with"); +} + +void tst_qdeclarativelanguage::reservedWords() +{ + QFETCH(QByteArray, word); + QDeclarativeComponent component(&engine); + component.setData("import QtQuick 1.0\nQtObject { property string " + word + " }", QUrl()); + QCOMPARE(component.errorString(), QLatin1String(":2 Expected token `identifier'\n")); +} + // Check that first child of qml is of given type. Empty type insists on error. void tst_qdeclarativelanguage::testType(const QString& qml, const QString& type, const QString& expectederror) { -- cgit v0.12 From da45259dbfa05c4f3b6c8c0472a65851692060e4 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 4 Oct 2010 16:04:31 +1000 Subject: Avoid potential null dereference. Task-number: QT-4030 --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 +- src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 8d08c99..8216ab7 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2591,7 +2591,7 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count) while (moved.count()) { int idx = moved.begin().key(); FxGridItem *item = moved.take(idx); - if (item->item == d->currentItem->item) + if (d->currentItem && item->item == d->currentItem->item) item->setPosition(d->colPosAt(idx), d->rowPosAt(idx)); d->releaseItem(item); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index c1e6aaa..6b46bc5 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -3090,7 +3090,7 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count) while (moved.count()) { int idx = moved.begin().key(); FxListItem *item = moved.take(idx); - if (item->item == d->currentItem->item) + if (d->currentItem && item->item == d->currentItem->item) item->setPosition(d->positionAt(idx)); d->releaseItem(item); } -- cgit v0.12 From f25391e52af3eef68abfa3941fc48da0c52bb010 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 4 Oct 2010 16:44:32 +1000 Subject: Improve test coverage for declarative module. Add additional autotests, and remove unreachable functions. --- .../graphicsitems/qdeclarativevisualitemmodel_p.h | 3 +-- .../declarative/qdeclarativeitem/data/keystest.qml | 3 +++ .../qdeclarativeitem/tst_qdeclarativeitem.cpp | 5 +++++ .../tst_qdeclarativelayoutitem.cpp | 5 +++++ .../tst_qdeclarativemousearea.cpp | 1 + .../qdeclarativepathview/data/closedPath.qml | 24 ++++++++++++++++++++++ .../qdeclarativepathview/data/openPath.qml | 10 +++++++++ .../tst_qdeclarativepathview.cpp | 21 +++++++++++++++++++ .../tst_qdeclarativepositioners.cpp | 8 ++++++-- 9 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativepathview/data/closedPath.qml create mode 100644 tests/auto/declarative/qdeclarativepathview/data/openPath.qml diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h index e159786..f09d8dd 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h @@ -67,7 +67,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeVisualModel : public QObject Q_PROPERTY(int count READ count NOTIFY countChanged) public: - QDeclarativeVisualModel(QObject *parent=0) : QObject(parent) {} virtual ~QDeclarativeVisualModel() {} enum ReleaseFlag { Referenced = 0x01, Destroyed = 0x02 }; @@ -79,7 +78,7 @@ public: virtual ReleaseFlags release(QDeclarativeItem *item) = 0; virtual bool completePending() const = 0; virtual void completeItem() = 0; - virtual QString stringValue(int, const QString &) { return QString(); } + virtual QString stringValue(int, const QString &) = 0; virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const = 0; diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml index aedccd9..3927f42 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml @@ -2,6 +2,9 @@ import QtQuick 1.0 Item { focus: true + + property bool isEnabled: Keys.enabled + Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; } Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers) diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index e9dad6b..bbbf73e 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -214,6 +214,9 @@ void tst_QDeclarativeItem::keys() QFocusEvent fe(QEvent::FocusIn); QApplication::sendEvent(canvas, &fe); + QVERIFY(canvas->rootObject()); + QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true); + QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1); QApplication::sendEvent(canvas, &key); QCOMPARE(testObject->mKey, int(Qt::Key_A)); @@ -285,6 +288,7 @@ void tst_QDeclarativeItem::keys() testObject->reset(); canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false)); + QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false); key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1); QApplication::sendEvent(canvas, &key); @@ -292,6 +296,7 @@ void tst_QDeclarativeItem::keys() QVERIFY(!key.isAccepted()); canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true)); + QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), true); key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1); QApplication::sendEvent(canvas, &key); diff --git a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp index bbdba74..cc0f633 100644 --- a/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp +++ b/tests/auto/declarative/qdeclarativelayoutitem/tst_qdeclarativelayoutitem.cpp @@ -82,6 +82,11 @@ void tst_qdeclarativelayoutitem::test_resizing() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/layoutItem.qml")); QDeclarativeLayoutItem* obj = static_cast(c.create()); + QVERIFY(obj); + QCOMPARE(obj->minimumSize(), QSizeF(100,100)); + QCOMPARE(obj->preferredSize(), QSizeF(200,200)); + QCOMPARE(obj->maximumSize(), QSizeF(300,300)); + layout->addItem(obj); layout->setContentsMargins(0,0,0,0); widget->setContentsMargins(0,0,0,0); diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index e4ec01f..5e88450 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -356,6 +356,7 @@ void tst_QDeclarativeMouseArea::onMousePressRejected() canvas->show(); canvas->setFocus(); QVERIFY(canvas->rootObject() != 0); + QVERIFY(canvas->rootObject()->property("enabled").toBool()); QVERIFY(!canvas->rootObject()->property("mr1_pressed").toBool()); QVERIFY(!canvas->rootObject()->property("mr1_released").toBool()); diff --git a/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml new file mode 100644 index 0000000..08b0d2a --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/closedPath.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Path { + startY: 120 + startX: 160 + PathQuad { + y: 120 + x: 80 + controlY: 330 + controlX: 100 + } + PathLine { + y: 160 + x: 20 + } + PathCubic { + y: 120 + x: 160 + control1Y: 0 + control1X: 100 + control2Y: 000 + control2X: 200 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/data/openPath.qml b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml new file mode 100644 index 0000000..328e3cd --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/openPath.qml @@ -0,0 +1,10 @@ +import QtQuick 1.0 + +Path { + startY: 120 + startX: 160 + PathLine { + y: 160 + x: 20 + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 3b5d438..65007a6 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -85,6 +85,7 @@ private slots: void pathUpdateOnStartChanged(); void package(); void emptyModel(); + void closed(); private: QDeclarativeView *createView(); @@ -786,6 +787,26 @@ void tst_QDeclarativePathView::emptyModel() delete canvas; } +void tst_QDeclarativePathView::closed() +{ + QDeclarativeEngine engine; + + { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/openPath.qml")); + QDeclarativePath *obj = qobject_cast(c.create()); + QVERIFY(obj); + QCOMPARE(obj->isClosed(), false); + delete obj; + } + + { + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/closedPath.qml")); + QDeclarativePath *obj = qobject_cast(c.create()); + QVERIFY(obj); + QCOMPARE(obj->isClosed(), true); + delete obj; + } +} QDeclarativeView *tst_QDeclarativePathView::createView() { diff --git a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp index 57a8354..254349f 100644 --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp @@ -322,7 +322,8 @@ void tst_QDeclarativePositioners::test_grid() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 50.0); - QDeclarativeItem *grid = canvas->rootObject()->findChild("grid"); + QDeclarativeGrid *grid = canvas->rootObject()->findChild("grid"); + QCOMPARE(grid->flow(), QDeclarativeGrid::LeftToRight); QCOMPARE(grid->width(), 120.0); QCOMPARE(grid->height(), 100.0); @@ -355,7 +356,8 @@ void tst_QDeclarativePositioners::test_grid_topToBottom() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 50.0); - QDeclarativeItem *grid = canvas->rootObject()->findChild("grid"); + QDeclarativeGrid *grid = canvas->rootObject()->findChild("grid"); + QCOMPARE(grid->flow(), QDeclarativeGrid::TopToBottom); QCOMPARE(grid->width(), 100.0); QCOMPARE(grid->height(), 120.0); @@ -670,10 +672,12 @@ void tst_QDeclarativePositioners::test_flow_implicit_resize() QCOMPARE(flow->height(), 120.0); canvas->rootObject()->setProperty("leftToRight", true); + QCOMPARE(flow->flow(), QDeclarativeFlow::LeftToRight); QCOMPARE(flow->width(), 220.0); QCOMPARE(flow->height(), 50.0); canvas->rootObject()->setProperty("leftToRight", false); + QCOMPARE(flow->flow(), QDeclarativeFlow::TopToBottom); QCOMPARE(flow->width(), 100.0); QCOMPARE(flow->height(), 120.0); -- cgit v0.12 From c2ed7b0cb9b9db105c650301af5bd3199cdd032e Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 09:32:42 +0200 Subject: Got rid of "No such directory" warning when shadow building. RevBy: Thomas Zander --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 53f520a..f7904d9 100755 --- a/configure +++ b/configure @@ -4902,9 +4902,8 @@ case "$XPLATFORM" in *symbian*) # Raptor does not support configure tests. # the main commands needed to compile; - (cd config.tests/symbian - mkdir -p rcomp - cd rcomp + (mkdir -p config.tests/symbian/rcomp + cd config.tests/symbian/rcomp rm -f rcomp_test.rsg touch rcomp_test.rpp rcomp_test.rsc rcomp_test.rss rcomp -u -m045,046,047 -s./rcomp_test.rpp -o./rcomp_test.rsc -h./rcomp_test.rsg -i./rcomp_test.rss 2>&1 > /dev/null -- cgit v0.12 From 9dae9599c4d19ca55693df0b81bacbc1255ec733 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 09:33:20 +0200 Subject: Made scripttools disabled on Symbian by default, like on Windows. RevBy: Miikka Heikkinen --- configure | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure b/configure index f7904d9..aca3467 100755 --- a/configure +++ b/configure @@ -7224,7 +7224,14 @@ if [ "$CFG_SCRIPTTOOLS" = "yes" -a "$CFG_SCRIPT" = "no" ]; then exit 1 fi if [ "$CFG_SCRIPTTOOLS" = "auto" -a "$CFG_SCRIPT" != "no" ]; then - CFG_SCRIPTTOOLS="yes" + case "$XPLATFORM" in + symbian*) + CFG_SCRIPTTOOLS="no" + ;; + *) + CFG_SCRIPTTOOLS="yes" + ;; + esac elif [ "$CFG_SCRIPT" = "no" ]; then CFG_SCRIPTTOOLS="no" fi -- cgit v0.12 From 207d9239dc6b67109b5e8cbdea7e5a589c167e85 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 4 Oct 2010 10:55:11 +0300 Subject: Enable QtOpenGL vector path caching on Symbian/IVE3 IVE3 doesn't support UNSIGNED_INT index values in DrawElements. This patch checks if GL_OES_element_index_uint extensions is supported and determines DrawElement indices type based on that. On desktop environment UNSIGNED_INT is always supported. Task-number: QTBUG-13563 Reviewed-by: Gunnar --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 42 +-- src/opengl/gl2paintengineex/qtriangulator.cpp | 354 ++++++++++++++------- src/opengl/gl2paintengineex/qtriangulator_p.h | 58 +++- src/opengl/qglextensions_p.h | 14 + 4 files changed, 334 insertions(+), 134 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a81ed8e..a98d7cc 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -646,7 +646,7 @@ struct QGL2PEVectorPathCache GLuint ibo; #else float *vertices; - quint32 *indices; + void *indices; #endif int vertexCount; int indexCount; @@ -696,14 +696,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) const QPointF* const points = reinterpret_cast(path.points()); - // ### Remove before release... -#ifdef Q_OS_SYMBIAN - // ### There are some unresolved issues in Symbian vector path caching. - static bool do_vectorpath_cache = false; -#else - static bool do_vectorpath_cache = true; -#endif - // 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()); @@ -774,8 +766,7 @@ 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 - if (do_vectorpath_cache) - path.makeCacheable(); + path.makeCacheable(); vertexCoordinateArray.clear(); vertexCoordinateArray.addPath(path, inverseScale, false); prepareForDraw(currentBrush.isOpaque()); @@ -828,13 +819,16 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) 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); + + if (glSupportsElementIndexUint) + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); + else + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint16) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); QVarLengthArray vertices(polys.vertices.size()); for (int i = 0; i < polys.vertices.size(); ++i) @@ -842,8 +836,13 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) 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()); + if (glSupportsElementIndexUint) { + cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); + memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); + } else { + cache->indices = (quint16 *) qMalloc(sizeof(quint16) * polys.indices.size()); + memcpy(cache->indices, polys.indices.data(), sizeof(quint16) * polys.indices.size()); + } for (int i = 0; i < polys.vertices.size(); ++i) cache->vertices[i] = float(inverseScale * polys.vertices.at(i)); #endif @@ -854,19 +853,24 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); - glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); + if (glSupportsElementIndexUint) + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); + else + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); #else setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); - glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, cache->indices); + if (glSupportsElementIndexUint) + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, (qint32 *)cache->indices); + else + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, (qint16 *)cache->indices); #endif } 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 - if (do_vectorpath_cache) - path.makeCacheable(); + path.makeCacheable(); // The path is too complicated & needs the stencil technique vertexCoordinateArray.clear(); diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index f14b0a4..ea072b4 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -57,6 +57,9 @@ #include +#include "qgl_p.h" +#include "qglextensions_p.h" + QT_BEGIN_NAMESPACE //#define Q_TRIANGULATOR_DEBUG @@ -185,6 +188,18 @@ sort_loop_end: sort(array + low + 1, count - low - 1); } +template +struct QVertexSet +{ + inline QVertexSet() { } + inline QVertexSet(const QVertexSet &other) : vertices(other.vertices), indices(other.indices) { } + QVertexSet &operator = (const QVertexSet &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], ...] +}; + //============================================================================// // QFraction // //============================================================================// @@ -1295,7 +1310,7 @@ inline void QRingBuffer::enqueue(const T &x) //============================================================================// // QTriangulator // //============================================================================// - +template class QTriangulator { public: @@ -1308,7 +1323,7 @@ public: class ComplexToSimple { public: - inline ComplexToSimple(QTriangulator *parent) : m_parent(parent), + inline ComplexToSimple(QTriangulator *parent) : m_parent(parent), m_edges(0), m_events(0), m_splits(0) { } void decompose(); private: @@ -1422,7 +1437,7 @@ public: class SimpleToMonotone { public: - inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent), m_edges(0), m_upperVertex(0) { } + inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent), m_edges(0), m_upperVertex(0) { } void decompose(); private: enum VertexType {MergeVertex, EndVertex, RegularVertex, StartVertex, SplitVertex}; @@ -1431,7 +1446,7 @@ public: { QRBTree::Node *node; int helper, twin, next, previous; - quint32 from, to; + T from, to; VertexType type; bool pointingUp; int upper() const {return (pointingUp ? to : from);} @@ -1478,20 +1493,20 @@ public: class MonotoneToTriangles { public: - inline MonotoneToTriangles(QTriangulator *parent) : m_parent(parent) { } + 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 T 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 less(int i, int j) const {return m_parent->m_vertices.at((qint32)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))); + return qPointIsLeftOfLine(m_parent->m_vertices.at((qint32)indices(i)), + m_parent->m_vertices.at((qint32)indices(j)), m_parent->m_vertices.at((qint32)indices(k))); } - QTriangulator *m_parent; + QTriangulator *m_parent; int m_first; int m_length; }; @@ -1505,11 +1520,11 @@ public: // 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(); + QVertexSet triangulate(); + QVertexSet polyline(); private: QDataBuffer m_vertices; - QVector m_indices; + QVector m_indices; uint m_hint; }; @@ -1517,7 +1532,8 @@ private: // QTriangulator // //============================================================================// -QTriangleSet QTriangulator::triangulate() +template +QVertexSet QTriangulator::triangulate() { for (int i = 0; i < m_vertices.size(); ++i) { Q_ASSERT(qAbs(m_vertices.at(i).x) < (1 << 21)); @@ -1536,7 +1552,7 @@ QTriangleSet QTriangulator::triangulate() MonotoneToTriangles m2t(this); m2t.decompose(); - QTriangleSet result; + QVertexSet result; result.indices = m_indices; result.vertices.resize(2 * m_vertices.size()); for (int i = 0; i < m_vertices.size(); ++i) { @@ -1546,9 +1562,10 @@ QTriangleSet QTriangulator::triangulate() return result; } -QPolylineSet QTriangulator::polyline() +template +QVertexSet QTriangulator::polyline() { - QPolylineSet result; + QVertexSet result; result.indices = m_indices; result.vertices.resize(2 * m_vertices.size()); for (int i = 0; i < m_vertices.size(); ++i) { @@ -1558,7 +1575,8 @@ QPolylineSet QTriangulator::polyline() return result; } -void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix) +template +void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix) { m_hint = hint; m_vertices.resize(count); @@ -1570,10 +1588,11 @@ void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const m_vertices.at(i).y = qRound(y * Q_FIXED_POINT_SCALE); m_indices[i] = i; } - m_indices[count] = Q_TRIANGULATE_END_OF_POLYGON; + m_indices[count] = T(-1); //Q_TRIANGULATE_END_OF_POLYGON } -void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix, qreal lod) +template +void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix, qreal lod) { m_hint = path.hints(); // Curved paths will be converted to complex polygons. @@ -1586,10 +1605,10 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix switch (*e) { case QPainterPath::MoveToElement: if (!m_indices.isEmpty()) - m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON // Fall through. case QPainterPath::LineToElement: - m_indices.push_back(quint32(m_vertices.size())); + m_indices.push_back(T(m_vertices.size())); m_vertices.resize(m_vertices.size() + 1); qreal x, y; matrix.map(p[0], p[1], &x, &y); @@ -1607,7 +1626,7 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix 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_indices.push_back(T(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); @@ -1624,7 +1643,7 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix } } else { for (int i = 0; i < path.elementCount(); ++i, p += 2) { - m_indices.push_back(quint32(m_vertices.size())); + m_indices.push_back(T(m_vertices.size())); m_vertices.resize(m_vertices.size() + 1); qreal x, y; matrix.map(p[0], p[1], &x, &y); @@ -1632,10 +1651,11 @@ void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix m_vertices.last().y = qRound(y * Q_FIXED_POINT_SCALE); } } - m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON } -void QTriangulator::initialize(const QPainterPath &path, const QTransform &matrix, qreal lod) +template +void QTriangulator::initialize(const QPainterPath &path, const QTransform &matrix, qreal lod) { initialize(qtVectorPathForPath(path), matrix, lod); } @@ -1643,8 +1663,8 @@ void QTriangulator::initialize(const QPainterPath &path, const QTransform &matri //============================================================================// // QTriangulator::ComplexToSimple // //============================================================================// - -void QTriangulator::ComplexToSimple::decompose() +template +void QTriangulator::ComplexToSimple::decompose() { m_initialPointCount = m_parent->m_vertices.size(); initEdges(); @@ -1670,17 +1690,18 @@ void QTriangulator::ComplexToSimple::decompose() 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); + m_parent->m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON } } -void QTriangulator::ComplexToSimple::initEdges() +template +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_parent->m_indices.at(i) == T(-1)) { // Q_TRIANGULATE_END_OF_POLYGON if (m_edges.size() != first) m_edges.last().to = m_edges.at(first).from; first = m_edges.size(); @@ -1700,15 +1721,16 @@ void QTriangulator::ComplexToSimple::initEdges() } // Return true if new intersection was found -bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) +template +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); + const QPodPoint &u1 = m_parent->m_vertices.at((qint32)e1.from); + const QPodPoint &u2 = m_parent->m_vertices.at((qint32)e1.to); + const QPodPoint &v1 = m_parent->m_vertices.at((qint32)e2.from); + const QPodPoint &v2 = m_parent->m_vertices.at((qint32)e2.to); if (qMax(u1.x, u2.x) <= qMin(v1.x, v2.x)) return false; @@ -1734,7 +1756,8 @@ bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) return true; } -bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +template +bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const { const Edge &leftEdge = m_edges.at(leftEdgeIndex); const Edge &rightEdge = m_edges.at(rightEdgeIndex); @@ -1752,7 +1775,8 @@ bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rig return d < 0; } -QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex) const +template +QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex) const { QRBTree::Node *current = m_edgeList.root; QRBTree::Node *result = 0; @@ -1767,7 +1791,8 @@ QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeInd return result; } -QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex, QRBTree::Node *after) const +template +QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex, QRBTree::Node *after) const { if (!m_edgeList.root) return after; @@ -1782,7 +1807,8 @@ QRBTree::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeInd return result; } -QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const +template +QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const { QRBTree::Node *current = m_edgeList.root; QPair::Node *, QRBTree::Node *> result(0, 0); @@ -1830,7 +1856,8 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple return result; } -QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const +template +QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const { QRBTree::Node *current = m_edgeList.root; QPair::Node *, QRBTree::Node *> result(0, 0); @@ -1886,7 +1913,8 @@ QPair::Node *, QRBTree::Node *> QTriangulator::ComplexToSimple return result; } -void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint) +template +void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint) { Q_ASSERT(leftmost && rightmost); @@ -1904,8 +1932,8 @@ void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree::Node *left } } - -void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost) +template +void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *leftmost, QRBTree::Node *rightmost) { Q_ASSERT(leftmost && rightmost); @@ -1932,7 +1960,8 @@ void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree::Node *le calculateIntersection(storeRightmost->data, rightmost->data); } -void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) +template +void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) { QIntersectionPoint eventPoint2 = qIntersectionPoint(eventPoint); while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint < eventPoint2) { @@ -1949,8 +1978,8 @@ void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) 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); + const QPodPoint &u = m_parent->m_vertices.at((qint32)edge.from); + const QPodPoint &v = m_parent->m_vertices.at((qint32)edge.to); if (!currentIntersectionPoint.isOnLine(u, v)) { Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); break; @@ -1963,8 +1992,8 @@ void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) 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); + const QPodPoint &u = m_parent->m_vertices.at((qint32)edge.from); + const QPodPoint &v = m_parent->m_vertices.at((qint32)edge.to); if (!currentIntersectionPoint.isOnLine(u, v)) { Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); break; @@ -1987,7 +2016,8 @@ void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) } } -void QTriangulator::ComplexToSimple::fillPriorityQueue() +template +void QTriangulator::ComplexToSimple::fillPriorityQueue() { m_events.reset(); m_events.reserve(m_edges.size() * 2); @@ -1995,7 +2025,7 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() 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))); + Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(qint32)(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)) { QPodPoint upper = m_parent->m_vertices.at(m_edges.at(i).upper()); @@ -2010,7 +2040,8 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() sort(m_events.data(), m_events.size()); } -void QTriangulator::ComplexToSimple::calculateIntersections() +template +void QTriangulator::ComplexToSimple::calculateIntersections() { fillPriorityQueue(); @@ -2075,7 +2106,8 @@ void QTriangulator::ComplexToSimple::calculateIntersections() // 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) +template +int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) { const Split &split = m_splits.at(splitIndex); Edge &lowerEdge = m_edges.at(split.edge); @@ -2105,7 +2137,8 @@ int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) } } -bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() +template +bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() { for (int i = 0; i < m_edges.size(); ++i) m_edges.at(i).mayIntersect = false; @@ -2122,7 +2155,8 @@ bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() return checkForNewIntersections; } -void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i) +template +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)); @@ -2152,7 +2186,8 @@ void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &or orderedEdges.append(i); } -void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() +template +void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() { Q_ASSERT(m_edgeList.root == 0); // Initialize priority queue. @@ -2179,7 +2214,7 @@ void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() 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(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(qint32)(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); @@ -2290,7 +2325,8 @@ void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() } // end while } -void QTriangulator::ComplexToSimple::removeUnusedPoints() { +template +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)); @@ -2314,7 +2350,8 @@ void QTriangulator::ComplexToSimple::removeUnusedPoints() { } } -bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) const +template +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)); @@ -2325,7 +2362,8 @@ bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) co return cmp > 0; } -inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &other) const +template +inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &other) const { if (point == other.point) return type < other.type; // 'Lower' has higher priority than 'Upper'. @@ -2337,8 +2375,8 @@ inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &othe //============================================================================// #ifdef Q_TRIANGULATOR_DEBUG - -QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent, int currentVertex) +template +QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent, int currentVertex) : m_parent(parent), m_vertex(currentVertex) { QDataBuffer &vertices = m_parent->m_parent->m_vertices; @@ -2360,7 +2398,8 @@ QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent m_window = QRectF(minX - border, minY - border, (maxX - minX + 2 * border), (maxY - minY + 2 * border)); } -void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) +template +void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) { QPainter p(this); p.setRenderHint(QPainter::Antialiasing, true); @@ -2426,7 +2465,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) } } -void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) +template +void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) { qreal scale = exp(-0.001 * event->delta()); QPointF center = m_window.center(); @@ -2436,7 +2476,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) update(); } -void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *event) +template +void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton) { QPointF delta = event->pos() - m_lastMousePos; @@ -2449,7 +2490,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *ev } } -void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *event) +template +void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) m_lastMousePos = event->pos(); @@ -2462,8 +2504,8 @@ void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *e //============================================================================// // QTriangulator::SimpleToMonotone // //============================================================================// - -void QTriangulator::SimpleToMonotone::decompose() +template +void QTriangulator::SimpleToMonotone::decompose() { setupDataStructures(); removeZeroLengthEdges(); @@ -2482,12 +2524,13 @@ void QTriangulator::SimpleToMonotone::decompose() 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); + if (m_parent->m_indices.size() > 0 && m_parent->m_indices.back() != T(-1)) // Q_TRIANGULATE_END_OF_POLYGON + m_parent->m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON } } -void QTriangulator::SimpleToMonotone::setupDataStructures() +template +void QTriangulator::SimpleToMonotone::setupDataStructures() { int i = 0; Edge e; @@ -2505,7 +2548,7 @@ void QTriangulator::SimpleToMonotone::setupDataStructures() 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); + } while (m_parent->m_indices.at(i) != T(-1)); // Q_TRIANGULATE_END_OF_POLYGON m_edges.last().next = start; m_edges.at(start).previous = m_edges.size() - 1; @@ -2519,7 +2562,8 @@ void QTriangulator::SimpleToMonotone::setupDataStructures() } } -void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() +template +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)) { @@ -2547,7 +2591,8 @@ void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() } } -void QTriangulator::SimpleToMonotone::fillPriorityQueue() +template +void QTriangulator::SimpleToMonotone::fillPriorityQueue() { m_upperVertex.reset(); m_upperVertex.reserve(m_edges.size()); @@ -2561,7 +2606,8 @@ void QTriangulator::SimpleToMonotone::fillPriorityQueue() //} } -bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +template +bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const { const Edge &leftEdge = m_edges.at(leftEdgeIndex); const Edge &rightEdge = m_edges.at(rightEdgeIndex); @@ -2575,7 +2621,8 @@ bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int ri } // Returns the rightmost edge not to the right of the given edge. -QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int edgeIndex) const +template +QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int edgeIndex) const { QRBTree::Node *current = m_edgeList.root; QRBTree::Node *result = 0; @@ -2591,7 +2638,8 @@ QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int ed } // Returns the rightmost edge left of the given point. -QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int pointIndex) const +template +QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int pointIndex) const { QRBTree::Node *current = m_edgeList.root; QRBTree::Node *result = 0; @@ -2609,7 +2657,8 @@ QRBTree::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int p return result; } -void QTriangulator::SimpleToMonotone::classifyVertex(int i) +template +void QTriangulator::SimpleToMonotone::classifyVertex(int i) { Edge &e2 = m_edges.at(i); const Edge &e1 = m_edges.at(e2.previous); @@ -2638,13 +2687,15 @@ void QTriangulator::SimpleToMonotone::classifyVertex(int i) } } -void QTriangulator::SimpleToMonotone::classifyVertices() +template +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) +template +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); @@ -2655,7 +2706,8 @@ bool QTriangulator::SimpleToMonotone::pointIsInSector(const QPodPoint &p, const return leftOfPreviousEdge || leftOfNextEdge; } -bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) +template +bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) { const QPodPoint ¢er = m_parent->m_vertices.at(m_edges.at(sector).from); // Handle degenerate edges. @@ -2677,7 +2729,8 @@ bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) return pointIsInSector(p, v1, center, v3); } -int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) +template +int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) { while (!pointIsInSector(vertex, edge)) { edge = m_edges.at(m_edges.at(edge).previous).twin; @@ -2686,7 +2739,8 @@ int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) return edge; } -void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) +template +void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) { lower = findSector(lower, upper); upper = findSector(upper, lower); @@ -2713,7 +2767,8 @@ void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) m_edges.add(e); } -void QTriangulator::SimpleToMonotone::monotoneDecomposition() +template +void QTriangulator::SimpleToMonotone::monotoneDecomposition() { if (m_edges.isEmpty()) return; @@ -2729,8 +2784,8 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() 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)); + m_clockwiseOrder = qPointIsLeftOfLine(m_parent->m_vertices.at((quint32)m_edges.at(i).from), + m_parent->m_vertices.at((quint32)m_edges.at(j).from), m_parent->m_vertices.at((quint32)m_edges.at(i).to)); classifyVertices(); fillPriorityQueue(); @@ -2848,7 +2903,8 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() createDiagonal(diagonals.at(i).first, diagonals.at(i).second); } -bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j) const +template +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; @@ -2859,16 +2915,16 @@ bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j //============================================================================// // QTriangulator::MonotoneToTriangles // //============================================================================// - -void QTriangulator::MonotoneToTriangles::decompose() +template +void QTriangulator::MonotoneToTriangles::decompose() { - QVector result; + QVector result; QDataBuffer stack(m_parent->m_indices.size()); 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) { + while (m_parent->m_indices.at(m_first + m_length) != T(-1)) { // Q_TRIANGULATE_END_OF_POLYGON ++m_length; Q_ASSERT(m_first + m_length < m_parent->m_indices.size()); } @@ -2955,39 +3011,115 @@ void QTriangulator::MonotoneToTriangles::decompose() // qTriangulate // //============================================================================// -QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint, const QTransform &matrix) +QTriangleSet qTriangulate(const qreal *polygon, + int count, uint hint, const QTransform &matrix) { - QTriangulator triangulator; - triangulator.initialize(polygon, count, hint, matrix); - return triangulator.triangulate(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QTriangleSet triangleSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(polygon, count, hint, matrix); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUint(vertexSet.indices); + + } else { + QTriangulator triangulator; + triangulator.initialize(polygon, count, hint, matrix); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUshort(vertexSet.indices); + } + return triangleSet; } -QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix, qreal lod) +QTriangleSet qTriangulate(const QVectorPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.triangulate(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QTriangleSet triangleSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUshort(vertexSet.indices); + } + return triangleSet; } -QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix, qreal lod) +QTriangleSet qTriangulate(const QPainterPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.triangulate(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QTriangleSet triangleSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + triangleSet.vertices = vertexSet.vertices; + triangleSet.indices.setDataUshort(vertexSet.indices); + } + return triangleSet; } -QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix, qreal lod) +QPolylineSet qPolyline(const QVectorPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.polyline(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QPolylineSet polyLineSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.polyline(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUshort(vertexSet.indices); + } + return polyLineSet; } -QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix, qreal lod) +QPolylineSet qPolyline(const QPainterPath &path, + const QTransform &matrix, qreal lod) { - QTriangulator triangulator; - triangulator.initialize(path, matrix, lod); - return triangulator.polyline(); + QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint + + QPolylineSet polyLineSet; + if (glSupportsElementIndexUint) { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.polyline(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUint(vertexSet.indices); + } else { + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + QVertexSet vertexSet = triangulator.triangulate(); + polyLineSet.vertices = vertexSet.vertices; + polyLineSet.indices.setDataUshort(vertexSet.indices); + } + return polyLineSet; } QT_END_NAMESPACE diff --git a/src/opengl/gl2paintengineex/qtriangulator_p.h b/src/opengl/gl2paintengineex/qtriangulator_p.h index e5eec39..8f96e9f 100644 --- a/src/opengl/gl2paintengineex/qtriangulator_p.h +++ b/src/opengl/gl2paintengineex/qtriangulator_p.h @@ -58,7 +58,58 @@ QT_BEGIN_NAMESPACE -#define Q_TRIANGULATE_END_OF_POLYGON quint32(-1) +class QVertexIndexVector +{ +public: + enum Type { + UnsignedInt, + UnsignedShort + }; + + inline Type type() const { return t; } + + inline void setDataUint(const QVector &data) + { + t = UnsignedInt; + indices32 = data; + } + + inline void setDataUshort(const QVector &data) + { + t = UnsignedShort; + indices16 = data; + } + + inline const void* data() const + { + if (t == UnsignedInt) + return indices32.data(); + return indices16.data(); + } + + inline int size() const + { + if (t == UnsignedInt) + return indices32.size(); + return indices16.size(); + } + + inline QVertexIndexVector &operator = (const QVertexIndexVector &other) + { + if (t == UnsignedInt) + indices32 = other.indices32; + else + indices16 = other.indices16; + + return *this; + } + +private: + + Type t; + QVector indices32; + QVector indices16; +}; struct QTriangleSet { @@ -68,7 +119,7 @@ struct QTriangleSet // 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], ...] + QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] }; struct QPolylineSet @@ -78,8 +129,7 @@ struct QPolylineSet 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; - + QVertexIndexVector indices; }; // The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index 6259cca..e81e849 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -346,6 +346,17 @@ struct QGLExtensionFuncs qt_glEGLImageTargetTexture2DOES = 0; qt_glEGLImageTargetRenderbufferStorageOES = 0; #endif + + // OES_element_index_uint +#if !defined(QT_OPENGL_ES) + qt_glSupportsElementIndexUint = true; +#else + QString extensions = reinterpret_cast(glGetString(GL_EXTENSIONS)); + if (extensions.contains("GL_OES_element_index_uint")) + qt_glSupportsElementIndexUint = true; + else + qt_glSupportsElementIndexUint = false; +#endif } @@ -473,6 +484,7 @@ struct QGLExtensionFuncs _glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES; #endif + bool qt_glSupportsElementIndexUint; }; @@ -871,6 +883,8 @@ struct QGLExtensionFuncs #define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES #endif +#define glSupportsElementIndexUint QGLContextPrivate::extensionFuncs(ctx).qt_glSupportsElementIndexUint + extern bool qt_resolve_framebufferobject_extensions(QGLContext *ctx); bool qt_resolve_buffer_extensions(QGLContext *ctx); -- cgit v0.12 From 77a92b39b30bf14f6509dfb578bad8511ef9a32e Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 09:34:07 +0200 Subject: Made javascriptcore depend on corelib. It lists "QT = core" in its profile, and may fail parallel builds if the dependency is not in place. RevBy: Benjamin Poulain --- src/src.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/src.pro b/src/src.pro index 9a8b70fc..060f48b 100644 --- a/src/src.pro +++ b/src/src.pro @@ -119,7 +119,10 @@ src_webkit_declarative.target = sub-webkitdeclarative src_webkit.depends = src_gui src_sql src_network contains(QT_CONFIG, xmlpatterns): src_webkit.depends += src_xmlpatterns src_imports.depends += src_webkit - exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro): src_webkit.depends += src_javascriptcore + exists($$QT_SOURCE_TREE/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pro) { + src_webkit.depends += src_javascriptcore + src_javascriptcore.depends = src_corelib + } } contains(QT_CONFIG, qt3support): src_plugins.depends += src_qt3support contains(QT_CONFIG, dbus):{ -- cgit v0.12 From 4207bded6577f24fb4c20cc84880fd48eb9c0c9b Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 4 Oct 2010 10:46:14 +0200 Subject: Fixed library ordering when linking to qtmain. Done-with: Liang Qi Reviewed-by: Trust me --- mkspecs/features/symbian/symbian_building.prf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index 539609d..614fb65 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -187,9 +187,11 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") { linux-armcc: { QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\) QMAKE_LIBS += -leexe.lib\\(uc_exe_.o\\) - contains(CONFIG, "qt"):contains(QT, "core") { #if linking with QtCore + contains(CONFIG, "qt"):contains(QT, "gui") { #if linking with QtCore + QMAKE_LIBS -= -lqtmain$${QT_LIBINFIX}.lib QMAKE_LIBS += -lqtmain$${QT_LIBINFIX}.lib } else { + QMAKE_LIBS -= -llibcrt0.lib QMAKE_LIBS += -llibcrt0.lib } } else :linux-gcce { @@ -197,9 +199,12 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@:.*") { QMAKE_LIBS += \ -l:eexe.lib \ -l:usrt2_2.lib - contains(CONFIG, "qt"):contains(QT, "core") { #if linking with QtCore + contains(CONFIG, "qt"):contains(QT, "gui") { #if linking with QtCore + QMAKE_LIBS -= -l:qtmain$${QT_LIBINFIX}.lib QMAKE_LIBS += -l:qtmain$${QT_LIBINFIX}.lib } else { + QMAKE_LIBS -= -l:libcrt0.lib + QMAKE_LIBS -= -l:libcrt0_gcce.lib QMAKE_LIBS += -l:libcrt0_gcce.lib } QMAKE_LIBS += \ -- cgit v0.12 From 0b905d602ffb24b8cad4f09d84a5f762cc6a6603 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 4 Oct 2010 14:27:10 +0300 Subject: My changes for 4.7.1 Reviewed-by: TrustMe --- dist/changes-4.7.1 | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.7.1 b/dist/changes-4.7.1 index 68b23ba..51a10a3 100644 --- a/dist/changes-4.7.1 +++ b/dist/changes-4.7.1 @@ -308,7 +308,7 @@ Qt for Symbian * [QTBUG-4586] Fixed wrong paths in include/ActiveQt/headers.pri. * [QTBUG-11671] Fixed audio-backend detection in configure tests. - - qmake + - qmake & mkspecs * [QTBUG-13523] Added support for using -L notation in the LIBS variable when building with the symbian/linux-armcc or gcce mkspec. * [QTBUG-12851] Fix assertion on Windows when DESTDIR is empty in static @@ -318,6 +318,31 @@ Qt for Symbian .pro file. * [QTBUG-13081] vc[x]proj generators: support /MAP option without file name. + * [QTBUG-13902] Added support for unsigned smart installer package creation. + * [QTBUG-13991] No longer need to manually edit smart installer pkg file for publishing. + * [QT-3949] Load environment.prf from Symbian SDK if it exists there. + * [QTBUG-13499] Provide a way to compile with RVCT 4.0 using generated Makefile. + * [QTBUG-13336] Ignore MAKEFILE variable for Symbian abld and sbsv2 builds. + * [QTBUG-13363] Fix Symbian handling of projects with special characters in TARGET. + * [QTBUG-12762 & QTBUG-13307] Gcce building support for symbian-sbsv2 + * [QTBUG-13147] Added support for DEPLOYMENT.pkg_build_version + * [QTBUG-12884] Fix "installer_sis" and "deploy" targets when TARGET has path. + * [QTBUG-12879] Fix check to remove unnecessary deployments in Symbian. + * [QTBUG-12716] Make bld.inf target in Symbian mkspecs to depend on .pro file. + * [QTBUG-12715] Rename Symbian generated mmp/mk files to include target in filename. + * [QTBUG-12617] Fix package header in cases where VERSION doesn't contain all values. + * Fix run and runonphone targets for projects that have TARGET with path. + * Fix QT_LIBINFIX for QT_PLUGINS_BASE_DIR. + * No longer require PRE_TARGETDEPS items to be absolute for symbian-sbsv2 mkspec. + * Do smart command replacement for commands containing $$QMAKE_* + command variables, such as $$QMAKE_COPY, when generating bld.inf + extensions for QMAKE_EXTRA_* variables for symbian-sbsv2 mkspec. + + - s60installs + * Fixed qsymbianbearer.qtplugin exports in s60installs.pro. + + - patch_capabilities.pl + * [QTBUG-13760] Improved output of patch_capabilities.pl script. - QInputContext * [QTBUG-12949] Fixed a bug where passwords would not be committed when @@ -325,6 +350,23 @@ Qt for Symbian * [QTBUG-13472] Fixed crash in input methods when using symbols menu and numbers only. + - QDesktopWidget + * [QTBUG-14058] Fix QApplication::desktop()->availableGeometry(). + + - QtCore + * [QTBUG-13802] Symbian^4 platform detection for QSysInfo::symbianVersion(). + * [QTBUG-13612] Do not wait for QThread exit when destroying global statics. + * [QT-3895] Change RLibrary handle in QS60PluginResolver to be process wide. + * [QTBUG-11218] Fix QProcessManager destruction. + + - Qt Plugins + * [QT-3949] Remove pre-Symbian3 plugins from Symbian3 and later builds and + Check S60_VERSION instead of existence of certain files in bearer plugin. + + - Demos & Examples + * [QTBUG-13461] Remove some .pro statements left behind after IAP usage cleanup + * [QTBUG-12276] Assigned valid UID3 for fortuneserver example. + Qt for Windows CE ----------------- - Gui -- cgit v0.12 From d203e7d078cc2bb43ccb32282f40cedbffee4095 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Mon, 4 Oct 2010 14:12:10 +0200 Subject: Small improvement in the textedit demo We don't need to retrieve the content of the clipboard just to check if it is empty or not - that is quite a heavy operation if the clipboard contains large piece of data. Related to QTBUG-11085 Reviewed-by: Bradley T. Hughes --- demos/textedit/textedit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp index e1f24a1..165c97c 100644 --- a/demos/textedit/textedit.cpp +++ b/demos/textedit/textedit.cpp @@ -262,7 +262,7 @@ void TextEdit::setupEditActions() tb->addAction(a); menu->addAction(a); #ifndef QT_NO_CLIPBOARD - actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); + actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText()); #endif } @@ -681,7 +681,7 @@ void TextEdit::cursorPositionChanged() void TextEdit::clipboardDataChanged() { #ifndef QT_NO_CLIPBOARD - actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); + actionPaste->setEnabled(QApplication::clipboard()->mimeData()->hasText()); #endif } -- cgit v0.12 From a636fa9006b7f4cb898cdeec38a99c994fd9259e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 4 Oct 2010 15:10:25 +0200 Subject: Ensure that the underline is only drawn when expected for an accel On Mac, the underline for an accel should not be drawn at all as this is not part of the style guidelines. This ensures that it is not drawn. Autotest included which required a change to drawItemText() to go via the proxy as well so that the autotest would be useful too. Task-number: QTBUG-14172 Reviewed-by: Richard --- src/gui/styles/qmacstyle_mac.mm | 10 ++++---- tests/auto/qstyle/tst_qstyle.cpp | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 671a888..fb31ae4 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3336,6 +3336,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (needText) { QPalette pal = tb->palette; QPalette::ColorRole role = QPalette::NoRole; + if (!proxy()->styleHint(SH_UnderlineShortcut, tb, w)) + alignment |= Qt::TextHideMnemonic; if (down) cr.translate(shiftX, shiftY); if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 @@ -3353,13 +3355,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter role = QPalette::HighlightedText; } } - drawItemText(p, cr, alignment, pal, - tb->state & State_Enabled, tb->text, role); + proxy()->drawItemText(p, cr, alignment, pal, + tb->state & State_Enabled, tb->text, role); if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 && (tb->state & State_Sunken)) { // Draw a "drop shadow" in earlier versions. - drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment, - tb->palette, tb->state & State_Enabled, tb->text); + proxy()->drawItemText(p, cr.adjusted(0, 1, 0, 1), alignment, + tb->palette, tb->state & State_Enabled, tb->text); } } } else { diff --git a/tests/auto/qstyle/tst_qstyle.cpp b/tests/auto/qstyle/tst_qstyle.cpp index a76c82d..ba24225 100644 --- a/tests/auto/qstyle/tst_qstyle.cpp +++ b/tests/auto/qstyle/tst_qstyle.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -146,6 +147,7 @@ private slots: void pixelMetric(); void progressBarChangeStyle(); void defaultFont(); + void testDrawingShortcuts(); private: void lineUpLayoutTest(QStyle *); QWidget *testWidget; @@ -781,5 +783,54 @@ void tst_QStyle::defaultFont() qApp->setFont(defaultFont); } +class DrawTextStyle : public QProxyStyle +{ + Q_OBJECT +public: + DrawTextStyle(QStyle *base = 0) : QProxyStyle(), alignment(0) { setBaseStyle(base); } + void drawItemText(QPainter *painter, const QRect &rect, + int flags, const QPalette &pal, bool enabled, + const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const + { + DrawTextStyle *that = (DrawTextStyle *)this; + that->alignment = flags; + QProxyStyle::drawItemText(painter, rect, flags, pal, enabled, text, textRole); + } + int alignment; +}; + +void tst_QStyle::testDrawingShortcuts() +{ + { + QWidget w; + QToolButton *tb = new QToolButton(&w); + tb->setText("&abc"); + DrawTextStyle *dts = new DrawTextStyle; + w.show(); + tb->setStyle(dts); + QPixmap::grabWidget(tb); + QStyleOptionToolButton sotb; + sotb.initFrom(tb); + bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); + QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); + delete dts; + } + { + QToolBar w; + QToolButton *tb = new QToolButton(&w); + tb->setText("&abc"); + DrawTextStyle *dts = new DrawTextStyle; + w.addWidget(tb); + w.show(); + tb->setStyle(dts); + QPixmap::grabWidget(tb); + QStyleOptionToolButton sotb; + sotb.initFrom(tb); + bool showMnemonic = dts->styleHint(QStyle::SH_UnderlineShortcut, &sotb, tb); + QVERIFY(dts->alignment & (showMnemonic ? Qt::TextShowMnemonic : Qt::TextHideMnemonic)); + delete dts; + } +} + QTEST_MAIN(tst_QStyle) #include "tst_qstyle.moc" -- cgit v0.12 From d0d545a751c6b0b37f166c2c77fd3eba4d9b9ddc Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 4 Oct 2010 16:39:25 +0100 Subject: fix for USER: 163 panic found on 5800XM The NO_NAMED_LOCAL_CHUNKS macro should have been set for S605.0 builds. Also for S60 3.2 and Symbian^2. All are added. Reviewed-by: Shane Kearns --- src/corelib/arch/symbian/qt_hybridheap_symbian_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h index 92cfe0e..36c7b6d 100644 --- a/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h +++ b/src/corelib/arch/symbian/qt_hybridheap_symbian_p.h @@ -90,7 +90,7 @@ // disabling code ported from Symbian^4 that we don't want/can't have in earlier platforms #define QT_SYMBIAN4_ALLOCATOR_UNWANTED_CODE -#if defined(SYMBIAN_VERSION_9_2) || defined(SYMBIAN_VERSION_9_1) +#if defined(SYMBIAN_VERSION_9_1) || defined(SYMBIAN_VERSION_9_2) || defined(SYMBIAN_VERSION_9_3) || defined(SYMBIAN_VERSION_9_4) || defined(SYMBIAN_VERSION_SYMBIAN2) #define NO_NAMED_LOCAL_CHUNKS #endif -- cgit v0.12 From 0ee5619ac77285935317a2a068c90f8c999b3f0d Mon Sep 17 00:00:00 2001 From: axasia Date: Mon, 4 Oct 2010 19:01:41 +0200 Subject: Update japanese translations. Merge-request: 837 Reviewed-by: Oswald Buddenhagen --- translations/assistant_ja.ts | 587 ++++++++++++++++++++++++++- translations/designer_ja.ts | 58 ++- translations/linguist_ja.ts | 924 ++++++++++++++++++++++++++++++++++++++++++- translations/qt_ja.ts | 740 ++++++++++++++++++---------------- translations/qtconfig_ja.ts | 194 --------- translations/qvfb_ja.ts | 110 ------ 6 files changed, 1952 insertions(+), 661 deletions(-) mode change 100644 => 100755 translations/assistant_ja.ts mode change 100644 => 100755 translations/linguist_ja.ts mode change 100644 => 100755 translations/qt_ja.ts diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts old mode 100644 new mode 100755 index afebc9a..c449e00 --- a/translations/assistant_ja.ts +++ b/translations/assistant_ja.ts @@ -69,15 +69,15 @@ Reason: Error reading collection file '%1': %2. - コレクションファイル '%1' の読み込み中にエラーが発生しました: %2 + コレクションファイル '%1' の読み込み中にエラーが発生しました: %2。 Error creating collection file '%1': %2. - コレクションファイル '%1' の作成中にエラーが発生しました: %2 + コレクションファイル '%1' の作成中にエラーが発生しました: %2。 Error reading collection file '%1': %2 - コレクションファイル '%1' の読み込み中にエラーが発生しました: %2 + コレクションファイル '%1' の読み込み中にエラーが発生しました: %2 Cannot load sqlite database driver! @@ -120,6 +120,17 @@ Reason: + BookmarkItem + + New Folder + 新しいフォルダ + + + Untitled + タイトルなし + + + BookmarkManager Bookmarks @@ -357,6 +368,60 @@ Reason: CmdLineParser + Usage: assistant [Options] + +-collectionFile file Uses the specified collection + file instead of the default one +-showUrl url Shows the document with the + url. +-enableRemoteControl Enables Assistant to be + remotely controlled. +-show widget Shows the specified dockwidget + which can be "contents", "index", + "bookmarks" or "search". +-activate widget Activates the specified dockwidget + which can be "contents", "index", + "bookmarks" or "search". +-hide widget Hides the specified dockwidget + which can be "contents", "index" + "bookmarks" or "search". +-register helpFile Registers the specified help file + (.qch) in the given collection + file. +-unregister helpFile Unregisters the specified help file + (.qch) from the give collection + file. +-setCurrentFilter filter Set the filter as the active filter. +-remove-search-index Removes the full text search index. +-rebuild-search-index Re-builds the full text search index (potentially slow). +-quiet Does not display any error or + status message. +-help Displays this help. + + 使い方: assistant [オプション] + +-collectionFile file デフォルトのコレクションファイルの代わりに使用する + コレクションファイルを指定します。 +-showUrl url 表示するURLを指定します。 +-enableRemoteControl Assistant をリモートから制御できるようにします。 +-show widget 表示するウィジェット("contents"、"index"、 + "bookmarks"、"search")を指定します。 +-activate widget アクティブにするウィジェット("contents"、 + "index"、"bookmarks"、"search")を指定します。 +-hide widget 表示しないウィジェット("contents"、"index"、 + "bookmarks"、"search")を指定します。 +-register helpFile コレクションファイルに登録する + ヘルプファイル (.qch) を指定します。 +-unregister helpFile コレクションファイルから登録を解除する + ヘルプファイル (.qch) を指定します。 +-setCurrentFilter filter フィルタをアクティブなフィルタとして設定します。 +-remove-search-index 全文検索インデックスを削除します。 +-rebuild-search-index 全文検索インデックスをリビルドします。(時間を要する場合があります) +-quiet エラーやステータスメッセージを表示しません。 +-help このヘルプを表示します。 + + + Unknown option: %1 不明なオプション: %1 @@ -417,6 +482,56 @@ Reason: + ConversionWizard + + Help Conversion Wizard + ヘルプ変換ウィザード + + + Converting %1... + %1 を変換中... + + + Writing help collection file... + ヘルプコレクションファイルに書き出し中... + + + Done. + 完了. + + + + FilesPage + + Form + Form + + + Files: + ファイル: + + + Remove + 削除 + + + Remove All + すべて削除 + + + Unreferenced Files + 参照していないファイル + + + Remove files which are neither referenced by a keyword nor by the TOC. + キーワードと目次のどちらからも参照されていないファイルを削除します。 + + + <p><b>Warning:</b> When removing images or stylesheets, be aware that those files are not directly referenced by the .adp or .dcf file.</p> + <p><b>警告:</b> 画像やスタイルシートを削除する時は、それらが .adp ファイルや .dcf ファイルから直接参照されていないか注意してください。</p> + + + FilterNameDialogClass Add Filter Name @@ -428,6 +543,66 @@ Reason: + FilterPage + + Form + Form + + + Filter attributes for current documentation (comma separated list): + 現在のドキュメントのフィルタ属性 (カンマ区切りリスト): + + + Custom Filters + カスタム フィルタ + + + 1 + 1 + + + 2 + 2 + + + Add + 追加 + + + Remove + 削除 + + + Filter Settings + フィルタ設定 + + + Specify the filter attributes for the documentation. If filter attributes are used, also define a custom filter for it. Both the filter attributes and the custom filters are optional. + ドキュメントのフィルタ属性を指定します。フィルタ属性を使用する場合、使用するカスタムフィルタもあわせて指定する必要があります。フィルタ属性もカスタムフィルタも必須ではありません。 + + + Filter Name + フィルタ名 + + + Filter Attributes + フィルタ属性 + + + The custom filter '%1' is defined multiple times. + カスタムフィルタ '%1' が複数回定義されています。 + + + The attributes for custom filter '%1' are defined multiple times. + カスタムフィルタ '%1' の属性が複数回定義されています。 + + + unfiltered + list of available documentation + フィルタなし + + + FindWidget Previous @@ -451,6 +626,17 @@ Reason: + FinishPage + + Converting File + ファイルを変換中 + + + Creating the new Qt help files from the old ADP file. + 古い ADP ファイルから新しい Qt ヘルプファイルを作成しています。 + + + FontPanel Font @@ -474,6 +660,59 @@ Reason: + GeneralPage + + Form + Form + + + Namespace: + 名前空間: + + + Virtual Folder: + 仮想フォルダ: + + + General Settings + 概要設定 + + + Specify the namespace and the virtual folder for the documentation. + ドキュメントの名前空間や仮想フォルダを指定します。 + + + Namespace Error + 名前空間エラー + + + The namespace contains some invalid characters. + 名前空間にいくつか無効な文字が含まれています。 + + + Virtual Folder Error + 仮想フォルダ エラー + + + The virtual folder contains some invalid characters. + 仮想フォルダにいくつか無効な文字が含まれています。 + + + + HelpEngineWrapper + + Unfiltered + フィルタなし + + + + HelpGenerator + + Warning: %1 + 警告: %1 + + + HelpViewer Help @@ -485,7 +724,7 @@ Reason: <title>about:blank</title> - + <title>about:blank</title> <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> @@ -511,6 +750,40 @@ Reason: + HelpWindow + + <center><b>Wizard Assistant</b></center> + <center><b>ウィザード アシスタント</b></center> + + + + IdentifierPage + + Form + Form + + + Create identifiers + IDを作成 + + + Global prefix: + グローバルな接頭辞: + + + Inherit prefix from file names + ファイル名を受け継いだ接頭辞 + + + Identifiers + ID + + + This page allows you to create identifiers from the keywords found in the .adp or .dcf file. + このページで .adp や .dcf ファイルに見つかったキーワードにIDを付与する事ができます。 + + + IndexWindow &Look for: @@ -526,6 +799,53 @@ Reason: + InputPage + + Form + Form + + + File name: + ファイル名: + + + ... + ... + + + Input File + 取り込むファイルの指定 + + + Specify the .adp or .dcf file you want to convert to the new Qt help project format and/or collection format. + 新たに Qt ヘルプ プロジェクト/コレクションフォーマットに変換したい .adp / .dcf ファイルを指定してください。 + + + Open file + ファイルを開く + + + Qt Help Files (*.adp *.dcf) + Qt ヘルプ ファイル (*.adp *.dcf) + + + File Open Error + ファイル オープン エラー + + + The specified file could not be opened! + 指定されたファイルを開く事ができません! + + + File Parsing Error + ファイル パース エラー + + + Parsing error in line %1! + %1 行目でパース エラーです! + + + InstallDialog Install Documentation @@ -713,6 +1033,10 @@ Reason: ホーム(&H) + <center><h3>%1</h3><p>Version %2</p></center><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p> + <center><h3>%1</h3><p>バージョン %2</p></center><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p> + + Could not register file '%1': %2 ファイル '%1' を登録できませんでした: %2 @@ -854,6 +1178,92 @@ Reason: + OutputPage + + Form + Form + + + Project file name: + プロジェクト ファイル名: + + + Collection file name: + コレクション ファイル名: + + + Output File Names + 出力するファイル名の指定 + + + Specify the file names for the output files. + 出力するファイルのファイル名を指定してください。 + + + Convert... + 変換... + + + Qt Help Project File + Qt ヘルプ プロジェクト ファイル + + + Qt Help Collection Project File + Qt ヘルプ コレクション プロジェクト ファイル + + + The specified file %1 already exist. + +Do you want to remove it? + 指定されたファイル %1 は既に存在します。 + +元々あったファイルを削除しますか? + + + Remove + 削除 + + + Cancel + キャンセル + + + + PathPage + + Form + Form + + + File filters: + ファイル フィルタ: + + + Documentation source file paths: + ドキュメントソースファイルパス: + + + Add + 追加 + + + Remove + 削除 + + + Source File Paths + ソースファイルのパス + + + Specify the paths where the sources files are located. By default, all files in those directories matched by the file filter will be included. + ソースファイルが格納されているパスを指定してください。デフォルトではファイルフィルタに一致したディレクトリ内のすべてのファイルが含まれます。 + + + Source File Path + ソースファイルのパス + + + PreferencesDialog Add Documentation @@ -988,6 +1398,175 @@ Reason: + QCollectionGenerator + + Unknown token at line %1. + %1 行目に未知のトークンがあります。 + + + Unknown token at line %1. Expected "QtHelpCollectionProject". + %1 行目の "QtHelpCollectionProject" が期待される箇所に未知のトークンがあります。 + + + Missing end tags. + 終了タグが不明です。 + + + Missing input or output file for help file generation. + ヘルプファイルを生成する為の入力ファイルまたは出力ファイルが不明です。 + + + Missing output file name. + 出力先ファイル名が不明です。 + + + Qt Collection Generator version 1.0 (Qt %1) + + Qt コレクション ジェネレータ バージョン 1.0 (Qt %1) + + + + Missing collection config file. + コレクション設定ファイルが見つかりません。 + + + +Usage: + +qcollectiongenerator <collection-config-file> [options] + + -o <collection-file> Generates a collection file + called <collection-file>. If + this option is not specified + a default name will be used. + -v Displays the version of + qcollectiongenerator. + + + +使い方: + +qcollectiongenerator <コレクション設定ファイル> [オプション] + + -o <コレクションファイル> <コレクションファイル> という名前で + コレクションファイルを生成します。 + このオプションが指定されていなかった場合は + デフォルトのファイル名が使用されます。 + -v qcollectiongenerator のバージョンを表示します。 + + + + + Could not open %1. + + %1 を開けませんでした。 + + + + Reading collection config file... + + コレクション設定ファイルを読み込んでいます... + + + + Collection config file error: %1 + + コレクション設定ファイル エラー: %1 + + + + Generating help for %1... + + %1 のヘルプを生成しています... + + + + Creating collection file... + + コレクションファイルを作成しています... + + + + The file %1 cannot be overwritten. + + ファイル %1 を上書きできません。 + + + + Cannot open %1. + + %1 を開けません。 + + + + Cannot open referenced image file %1. + + 参照されている画像ファイル %1 を開けません。 + + + + + QHelpGenerator + + Missing output file name. + 出力先ファイル名が不明です。 + + + Qt Help Generator version 1.0 (Qt %1) + + Qt ヘルプ ジェネレータ バージョン 1.0 (Qt %1) + + + + Missing Qt help project file. + Qt ヘルプ プロジェクト ファイルが見つかりません。 + + + +Usage: + +qhelpgenerator <help-project-file> [options] + + -o <compressed-file> Generates a Qt compressed help + file called <compressed-file>. + If this option is not specified + a default name will be used. + -c Checks whether all links in HTML files + point to files in this help project. + -v Displays the version of + qhelpgenerator. + + + +使い方: + +qhelpgenerator <ヘルププロジェクトファイル> [オプション] + + -o <圧縮ファイル> <圧縮ファイル> という名前で Qt 圧縮 ヘルプ + ファイルを生成します。 + このオプションが指定されていなかった場合は + デフォルトのファイル名が使用されます。 + -c HTML ファイル内のすべてのリンクがこのヘルプ + プロジェクト内のファイルを指しているかどうかを + チェックします。 + -v qhelpgenerator のバージョンを表示します。 + + + + + Could not open %1. + + %1 を開けませんでした。 + + + + Could not create output directory: %1 + + 出力ディレクトリを作成できませんでした: %1 + + + + QObject The specified collection file does not exist! diff --git a/translations/designer_ja.ts b/translations/designer_ja.ts index 7e1696f..2eb6cd9 100644 --- a/translations/designer_ja.ts +++ b/translations/designer_ja.ts @@ -25,6 +25,49 @@ + AbstractItemEditor + + Selectable + 選択可能 + + + Editable + 編集可能 + + + DragEnabled + ドラッグ可能 + + + DropEnabled + ドロップ可能 + + + UserCheckable + チェック可能 + + + Enabled + 有効 + + + Tristate + 3択 + + + Unchecked + チェックなし + + + PartiallyChecked + 部分的にチェックあり + + + Checked + チェックあり + + + AddLinkDialog Insert Link @@ -844,6 +887,7 @@ Parsing grid layout minimum size values FormEditorOptionsPage %1 % + Zoom percentage %1 % @@ -969,7 +1013,7 @@ Parsing grid layout minimum size values XX Icon Selected off Sample string to determinate the width for the first column of the list item property browser - + XX Icon Selected off @@ -2502,6 +2546,10 @@ Empty class name passed to widget factory method QtLocalePropertyManager + <Invalid> + <無効> + + %1, %2 %1, %2 @@ -4720,6 +4768,14 @@ Please select another name. 新しくインストールされたカスタムウィジェットプラグインをスキャンします。 + Loaded Plugins + ロード済みプラグイン + + + Failed Plugins + 失敗したプラグイン + + Qt Designer couldn't find any plugins プラグインは見つかりませんでした diff --git a/translations/linguist_ja.ts b/translations/linguist_ja.ts old mode 100644 new mode 100755 index abd32a0..2f948e8 --- a/translations/linguist_ja.ts +++ b/translations/linguist_ja.ts @@ -256,6 +256,186 @@ Will assume a single universal form. + LConvert + + +Usage: + lconvert [options] <infile> [<infile>...] + +lconvert is part of Qt's Linguist tool chain. It can be used as a +stand-alone tool to convert and filter translation data files. +The following file formats are supported: + +%1 +If multiple input files are specified, they are merged with +translations from later files taking precedence. + +Options: + -h + --help Display this information and exit. + + -i <infile> + --input-file <infile> + Specify input file. Use if <infile> might start with a dash. + This option can be used several times to merge inputs. + May be '-' (standard input) for use in a pipe. + + -o <outfile> + --output-file <outfile> + Specify output file. Default is '-' (standard output). + + -if <informat> + --input-format <format> + Specify input format for subsequent <infile>s. + The format is auto-detected from the file name and defaults to 'ts'. + + -of <outformat> + --output-format <outformat> + Specify output format. See -if. + + --input-codec <codec> + Specify encoding for QM and PO input files. Default is 'Latin1' + for QM and 'UTF-8' for PO files. UTF-8 is always tried as well for + QM, corresponding to the possible use of the trUtf8() function. + + --output-codec <codec> + Specify encoding for PO output files. Default is 'UTF-8'. + + --drop-tags <regexp> + Drop named extra tags when writing TS or XLIFF files. + May be specified repeatedly. + + --drop-translations + Drop existing translations and reset the status to 'unfinished'. + Note: this implies --no-obsolete. + + --source-language <language>[_<region>] + Specify/override the language of the source strings. Defaults to + POSIX if not specified and the file does not name it yet. + + --target-language <language>[_<region>] + Specify/override the language of the translation. + The target language is guessed from the file name if this option + is not specified and the file contents name no language yet. + + --no-obsolete + Drop obsolete messages. + + --no-finished + Drop finished messages. + + --sort-contexts + Sort contexts in output TS file alphabetically. + + --locations {absolute|relative|none} + Override how source code references are saved in TS files. + Default is absolute. + + --no-ui-lines + Drop line numbers from references to UI files. + + --verbose + be a bit more verbose + +Long options can be specified with only one leading dash, too. + +Return value: + 0 on success + 1 on command line parse failures + 2 on read failures + 3 on write failures + + +使い方: + lconvert [オプション] <入力ファイル> [<入力ファイル>...] + +lconvert は Qt Linguist ツールチェインの一部です。 +翻訳データファイルを変換したりフィルタリングしたりする事が +できるスタンドアロンのツールです。 +サポートしているファイル形式は以下の通りです: + +%1 +入力ファイルが複数個指定された場合、末尾のファイルほど +優先度が高いものとして翻訳データをマージします。 + +オプション: + -h + --help このヘルプを表示して終了します。 + + -i <入力ファイル> + --input-file <入力ファイル> + 入力ファイルを指定します。<入力ファイル> の指定はダッシュ記号で始まっていてもよいです。 + This option can be used several times to merge inputs. + May be '-' (標準入力) for use in a pipe. + + -o <出力ファイル> + --output-file <出力ファイル> + 出力ファイルを指定します。デフォルトは '-' (標準出力) です。 + + -if <入力形式> + --input-format <入力形式> + 後続の <入力ファイル> の入力形式を指定します。 + 形式はファイル名から自動検知され、デフォルトでは 'ts' となります。 + + -of <出力形式> + --output-format <出力形式> + 出力形式を指定します。-if を参照してください。 + + --input-codec <コーデック> + Specify encoding for QM and PO input files. Default is 'Latin1' + for QM and 'UTF-8' for PO files. UTF-8 is always tried as well for + QM, corresponding to the possible use of the trUtf8() function. + + --output-codec <コーデック> + Specify encoding for PO output files.デフォルトは 'UTF-8' です。 + + --drop-tags <正規表現> + Drop named extra tags when writing TS or XLIFF files. + May be specified repeatedly. + + --drop-translations + Drop existing translations and reset the status to 'unfinished'. + 注意: --no-obsolete と同等です。 + + --source-language <language>[_<region>] + Specify/override the language of the source strings. Defaults to + POSIX if not specified and the file does not name it yet. + + --target-language <language>[_<region>] + Specify/override the language of the translation. + The target language is guessed from the file name if this option + is not specified and the file contents name no language yet. + + --no-obsolete + 未使用のメッセージを取り除きます。 + + --no-finished + 完了しているメッセージを取り除きます。 + + --sort-contexts + 出力する TS ファイル内のコンテキストをアルファベット順にソートします。 + + --locations {absolute|relative|none} + Override how source code references are saved in TS files. + Default is absolute. + + --no-ui-lines + UI ファイルを参照している行番号を取り除きます。 + + --verbose + be a bit more verbose + +長すぎるオプションの指定はダッシュ記号で括る事で1つにできます。 + +戻り値: + 0 成功 + 1 コマンドラインパース失敗 + 2 読み込み失敗 + 3 書き込み失敗 + + + + LRelease Dropped %n message(s) which had no ID. @@ -281,6 +461,735 @@ Will assume a single universal form. %n 件の未翻訳のソーステキストを無視しました + + Usage: + lrelease [options] project-file + lrelease [options] ts-files [-qm qm-file] + +lrelease is part of Qt's Linguist tool chain. It can be used as a +stand-alone tool to convert XML-based translations files in the TS +format into the 'compiled' QM format used by QTranslator objects. + +Options: + -help Display this information and exit + -idbased + Use IDs instead of source strings for message keying + -compress + Compress the QM files + -nounfinished + Do not include unfinished translations + -removeidentical + If the translated text is the same as + the source text, do not include the message + -markuntranslated <prefix> + If a message has no real translation, use the source text + prefixed with the given string instead + -silent + Do not explain what is being done + -version + Display the version of lrelease and exit + + 使い方: + lrelease [オプション] project-file + lrelease [オプション] ts-files [-qm qm-file] + +lrelease is part of Qt's Linguist tool chain. It can be used as a +stand-alone tool to convert XML-based translations files in the TS +format into the 'compiled' QM format used by QTranslator objects. + +オプション: + -help このヘルプを表示して終了します + -idbased + メッセージのキーとして、ソース中の文字列を使用する代わりにIDを使用します + -compress + QM ファイルを圧縮します + -nounfinished + 未完了の翻訳をインクルードしません + -removeidentical + If the translated text is the same as + the source text, do not include the message + -markuntranslated <プレフィクス> + If a message has no real translation, use the source text + prefixed with the given string instead + -silent + 完了した事を通知しません + -version + lrelease のバージョンを表示して終了します + + + + lrelease error: %1 + lrelease エラー: %1 + + + Updating '%1'... + + '%1' を更新しています... + + + + Removing translations equal to source text in '%1'... + + '%1' のソーステキストと等しい翻訳を削除しています... + + + + lrelease error: cannot create '%1': %2 + + lrelease エラー: '%1' を作成できません: %2 + + + + lrelease error: cannot save '%1': %2 + lrelease エラー: '%1' を保存できません: %2 + + + lrelease version %1 + + lrelease バージョン %1 + + + + lrelease error: cannot read project file '%1'. + + lrelease エラー: プロジェクトファイル '%1' が読めません。 + + + + lrelease error: cannot process project file '%1'. + + lrelease エラー: プロジェクトファイル '%1' を処理できません。 + + + + lrelease warning: Met no 'TRANSLATIONS' entry in project file '%1' + + lrelease 警告: プロジェクトファイル '%1' に 'TRANSLATIONS' エントリが見つかりません + + + + + LUpdate + + Parenthesis/bracket/brace mismatch between #if and #else branches; using #if branch + + #if を使っている部分で、#if 〜 #else の間の丸括弧/角括弧/中括弧の個数が一致していません + + + + Parenthesis/brace mismatch between #if and #else branches; using #if branch + + #if を使っている部分で、#if 〜 #else の間の丸括弧/中括弧の個数が一致していません + + + + Unterminated C++ comment + + 終了していないC++ コメント + + + + Unterminated C++ string + + 終了していない C++ 文字列 + + + + Excess closing brace in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で閉じ中括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Excess closing parenthesis in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で閉じ丸括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Excess closing bracket in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で閉じ角括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + circular inclusion of %1 + + %1 を循環インクルードしています + + + + Cannot open %1: %2 + + %1 を開けません: %2 + + + + //% cannot be used with tr() / QT_TR_NOOP(). Ignoring + + //% は tr() または QT_TR_NOOP() と併用できません。無視します + + + + Qualifying with unknown namespace/class %1::%2 + + 未知の名前空間またはクラス %1::%2 で修飾されています + + + + tr() cannot be called without context + + コンテキストなしで tr() は呼び出せません + + + + Class '%1' lacks Q_OBJECT macro + + クラス '%1' は Q_OBJECT マクロが不足しています + + + + It is not recommended to call tr() from within a constructor '%1::%2' + + コンストラクタ '%1::%2' 内での tr() 呼び出しは推奨されていません + + + + //% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring + + //% は translate() または QT_TRANSLATE_NOOP() と併用できません。無視します + + + + //= cannot be used with qtTrId() / QT_TRID_NOOP(). Ignoring + + //= は qtTrId() または QT_TRID_NOOP() と併用できません。無視します + + + + Unexpected character in meta string + + メタ文字列内に予期せぬ文字 + + + + Unterminated meta string + + 終了していない メタ文字列 + + + + Cannot invoke tr() like this + + this のように tr() を呼び出す事はできません + + + + Discarding unconsumed meta data + + 未使用のメタデータを破棄しています + + + + Unbalanced opening brace in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で開き中括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Unbalanced opening parenthesis in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で開き丸括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Unbalanced opening bracket in C++ code (or abuse of the C++ preprocessor) + + C++ コード内で開き角括弧の数が一致していません (もしくは C++ プリプロセッサが乱用されています) + + + + Cannot open %1: %2 + %1 を開けません: %2 + + + Unterminated Java comment. + + 終了していない Java コメント。 + + + + Invalid Unicode value. + + 不正な Unicode 値です。 + + + + Unterminated string. + + 終了していない文字列。 + + + + String used in translation can contain only literals concatenated with other literals, not expressions or numbers. + + 翻訳で使用される文字列は、式や数字以外の他のリテラルと連結されたリテラルだけを含む事ができます。 + + + + 'class' must be followed by a class name. + + 'class' に続くのはクラス名でなければなりません。 + + + + Excess closing brace. + + 余分な閉じ括弧です。 + + + + 'package' must be followed by package name. + + 'package' に続くのはパッケージ名でなければなりません。 + + + + Unbalanced opening brace. + + 開き括弧が一致していません。 + + + + Unbalanced opening parenthesis. + + 開き丸括弧が一致していません。 + + + + Usage: + lupdate [options] [project-file]... + lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file + +lupdate is part of Qt's Linguist tool chain. It extracts translatable +messages from Qt UI files, C++, Java and JavaScript/QtScript source code. +Extracted messages are stored in textual translation source files (typically +Qt TS XML). New and modified messages can be merged into existing TS files. + +Options: + -help Display this information and exit. + -no-obsolete + Drop all obsolete strings. + -extensions <ext>[,<ext>]... + Process files with the given extensions only. + The extension list must be separated with commas, not with whitespace. + Default: '%1'. + -pluralonly + Only include plural form messages. + -silent + Do not explain what is being done. + -no-sort + Do not sort contexts in TS files. + -no-recursive + Do not recursively scan the following directories. + -recursive + Recursively scan the following directories (default). + -I <includepath> or -I<includepath> + Additional location to look for include files. + May be specified multiple times. + -locations {absolute|relative|none} + Specify/override how source code references are saved in TS files. + Default is absolute. + -no-ui-lines + Do not record line numbers in references to UI files. + -disable-heuristic {sametext|similartext|number} + Disable the named merge heuristic. Can be specified multiple times. + -pro <filename> + Name of a .pro file. Useful for files with .pro file syntax but + different file suffix. Projects are recursed into and merged. + -source-language <language>[_<region>] + Specify the language of the source strings for new files. + Defaults to POSIX if not specified. + -target-language <language>[_<region>] + Specify the language of the translations for new files. + Guessed from the file name if not specified. + -ts <ts-file>... + Specify the output file(s). This will override the TRANSLATIONS + and nullify the CODECFORTR from possibly specified project files. + -codecfortr <codec> + Specify the codec assumed for tr() calls. Effective only with -ts. + -version + Display the version of lupdate and exit. + @lst-file + Read additional file names (one per line) from lst-file. + + 使い方: + lupdate [オプション] [プロジェクトファイル]... + lupdate [オプション] [source-file|path|@lst-file]... -ts ts-files|@lst-file + +lupdate は Qt' Linguist ツールチェインの一部です。Qt UI ファイル、C++ 、Java、 +JavaScript/QtScript のソースコードからメッセージを抽出します。 +Extracted messages are stored in textual translation source files (typically +Qt TS XML). 新しく追加されたり変更されたメッセージは既存の TS ファイル内のメッセージから +マージされます。 + +オプション: + -help このヘルプを表示して終了します。 + -no-obsolete + すべての未使用の文字列を取り除きます。 + -extensions <ext>[,<ext>]... + 与えられた拡張子のファイルだけ処理します。 + 拡張子のリストはカンマで区切り、空白スペースを含んではいけません。 + デフォルト: '%1' + -pluralonly + 複数形のメッセージだけインクルードします。 + -silent + 完了した事を通知しません + -no-sort + TS ファイル内のコンテキストをソートしません。 + -no-recursive + ディレクトリ内を再帰的に処理しません。 + -recursive + ディレクトリ内を再帰的に処理します。(デフォルト) + -I <includepath> or -I<includepath> + Additional location to look for include files. + May be specified multiple times. + -locations {absolute|relative|none} + Specify/override how source code references are saved in TS files. + Default is absolute. + -no-ui-lines + UI ファイルを参照する行番号を記録しません。 + -disable-heuristic {sametext|similartext|number} + Disable the named merge heuristic. Can be specified multiple times. + -pro <ファイル名> + .pro ファイルの名前を指定します。Useful for files with .pro file syntax but + different file suffix. Projects are recursed into and merged. + -source-language <language>[_<region>] + Specify the language of the source strings for new files. + Defaults to POSIX if not specified. + -target-language <language>[_<region>] + Specify the language of the translations for new files. + Guessed from the file name if not specified. + -ts <ts-file>... + 出力ファイルを指定します。This will override the TRANSLATIONS + and nullify the CODECFORTR from possibly specified project files. + -codecfortr <codec> + Specify the codec assumed for tr() calls. Effective only with -ts. + -version + lupdate のバージョン情報を表示して終了します。 + @lst-file + Read additional file names (one per line) from lst-file. + + + + lupdate warning: Codec for tr() '%1' disagrees with existing file's codec '%2'. Expect trouble. + + lupdate 警告: tr() '%1' のコーデックと既存のファイルのコーデック '%2' が一致しません。問題が発生したようです。 + + + + lupdate warning: Specified target language '%1' disagrees with existing file's language '%2'. Ignoring. + + lupdate 警告: 指定されたターゲット言語 '%1' と既存のファイルの言語 '%2' が一致しません。無視されます。 + + + + lupdate warning: Specified source language '%1' disagrees with existing file's language '%2'. Ignoring. + + lupdate 警告: 指定されたソース言語 '%1' と既存のファイルの言語 '%2' が一致しません。無視されます。 + + + + Updating '%1'... + + '%1' を更新しています... + + + + Stripping non plural forms in '%1'... + + '%1' 内の複数形以外のメッセージを取り除いています... + + + + lupdate warning: Codec for source '%1' is invalid. Falling back to codec for tr(). + + lupdate 警告: ソース '%1' のコーデックは不正です。コーデックを元に戻します。 + + + + lupdate warning: TS files from command line will override TRANSLATIONS in %1. + + lupdate 警告: コマンドラインで指定された TS ファイルは %1 の TRANSLATIONS を上書きます。 + + + + lupdate warning: TS files from command line prevent recursing into %1. + + lupdate 警告: コマンドラインで指定された TS ファイルは %1 内で再起的に処理するのを妨げます。 + + + + lupdate warning: no TS files specified. Only diagnostics will be produced for '%1'. + + lupdate 警告: TS ファイルが指定されていません。'%1' は診断のみ行われます。 + + + + The option -target-language requires a parameter. + + パラメータに -target-language オプションが必要です。 + + + + The option -source-language requires a parameter. + + パラメータに -source-language オプションが必要です。 + + + + The option -disable-heuristic requires a parameter. + + パラメーターに -disable-heuristic オプションが必要です。 + + + + Invalid heuristic name passed to -disable-heuristic. + + -disable-heuristic に不正なヒューリスティック名が渡されています。 + + + + The option -locations requires a parameter. + + パラメータに -locations オプションが必要です。 + + + + Invalid parameter passed to -locations. + + -locations に不正なパラメータが渡されています。 + + + + The -codecfortr option should be followed by a codec name. + + -codecfortr オプションの後ろに続けてコーデック名があるべきです。 + + + + The -extensions option should be followed by an extension list. + + -extensions オプションの後ろに続けて拡張リストがあるべきです。 + + + + The -pro option should be followed by a filename of .pro file. + + -pro オプションの後ろに続けて .pro ファイルのファイル名があるべきです。 + + + + The -I option should be followed by a path. + + -l オプションの後ろに続けてパスがあるべきです。 + + + + Unrecognized option '%1'. + + '%1' は認識できないオプションです。 + + + + lupdate error: List file '%1' is not readable. + + lupdate エラー: リストファイル '%1' が読めません。 + + + + lupdate warning: For some reason, '%1' is not writable. + + lupdate 警告: いくつかの理由により '%1' は書き込みできません。 + + + + lupdate error: File '%1' has no recognized extension. + + lupdate エラー: ファイル '%1' は拡張として認識できません。 + + + + lupdate error: File '%1' does not exist. + + lupdate エラー: ファイル '%1' が存在しません。 + + + + Scanning directory '%1'... + + ディレクトリ '%1' をスキャンしています... + + + + lupdate warning: -target-language usually only makes sense with exactly one TS file. + + lupdate 警告: -target-language は通常1つの TS ファイルにだけ意味を持ちます。 + + + + lupdate warning: -codecfortr has no effect without -ts. + + lupdate 警告: -ts 指定なしでは -codecfortr は何の効果もありません。 + + + + lupdate warning: no TS files specified. Only diagnostics will be produced. + + lupdate 警告: TS ファイルが指定されていません。診断のみ行われます。 + + + + lupdate error: Both project and source files / include paths specified. + + lupdate エラー: プロジェクトとソースファイルまたはインクルードパスの両方が指定されています。 + + + + Found %n source text(s) (%1 new and %2 already existing) + + + %n 件のソーステキストが見つかりました (新規: %1 件、既存: %2 件) + + + + + Removed %n obsolete entries + + + %n 件の未使用のエントリを削除しました + + + + + Kept %n obsolete entries + + + %n 件の未使用のエントリを残しました + + + + + Number heuristic provided %n translation(s) + + + 数値ヒューリスティックは %n 件の翻訳を提供しました + + + + + Same-text heuristic provided %n translation(s) + + + 同一テキスト ヒューリスティックは %n 件の翻訳を提供しました + + + + + Similar-text heuristic provided %n translation(s) + + + 類似ヒューリスティックは %n 件の翻訳を提供しました + + + + + Illegal character + 無効な文字 + + + Unclosed string at end of line + ファイルの終端までに閉じられていない文字列 + + + Illegal escape squence + 無効なエスケープシーケンス + + + Illegal unicode escape sequence + 無効な Unicode エスケープシーケンス + + + Unclosed comment at end of file + ファイルの終端までに閉じられていないコメント + + + Illegal syntax for exponential number + 指数番号の構文が不正です + + + Identifier cannot start with numeric literal + 識別子の先頭に数字を使用する事はできません + + + Unterminated regular expression literal + 終了していない正規表現リテラル + + + //% cannot be used with %1(). Ignoring + + //% は %1() と併用できません。無視します + + + + %1() requires at least two arguments. + + %1() には最低でも2個の引数が必要です。 + + + + %1(): both arguments must be literal strings. + + %1(): 両方の引数は文字列リテラルである必要があります。 + + + + %1() requires at least one argument. + + %1() は最低でも1個の引数が必要です。 + + + + %1(): text to translate must be a literal string. + + %1(): 翻訳するテキストはリテラル文字列である必要があります。 + + + + //= cannot be used with %1(). Ignoring + + //= は %1() と併用できません。無視します + + + + %1(): identifier must be a literal string. + + %1(): 識別子は文字列リテラルである必要があります。 + + + + Expected + Beginning of the string that contains comma-separated list of expected tokens + 期待されるトークン + + + XML error: Parse error at line %1, column %2 (%3). + XML エラー: %1 行目、%2 列目でパースエラー (%3)。 + + + Parse error in UI file + UI ファイルでパースエラー + MainWindow @@ -918,7 +1827,7 @@ All files (*) Save changes made to this Qt translation source file - この Qt 翻訳ソースファイルに対して行われた変更を保存します。 + この Qt 翻訳ソースファイルに対して行われた変更を保存します Save changes made to this Qt translation source file into a new file. @@ -1279,6 +2188,13 @@ Line: %2 + PhraseBook + + Parse error at line %1, column %2 (%3). + %1 行目、%2 列目でパースエラー (%3)。 + + + PhraseBookBox (New Entry) @@ -1450,6 +2366,12 @@ Line: %2 Qt Linguist 'Phrase Book' Qt Linguist 'フレーズ ブック' + + lupdate version %1 + + lupdate バージョン %1 + + SourceCodeView diff --git a/translations/qt_ja.ts b/translations/qt_ja.ts old mode 100644 new mode 100755 index 0812a64..095631e --- a/translations/qt_ja.ts +++ b/translations/qt_ja.ts @@ -373,52 +373,52 @@ libgstreamer-plugins-base はインストールされていますか。 Decay HF ratio (%) DecayHFRatio: Ratio of high-frequency decay time to the value specified by DecayTime. - + 高周波減衰率 (%) Decay time (ms) DecayTime: Time over which reverberation is diminished. - + 減衰時間 (ms) Density (%) Density Delay between first and subsequent reflections. Note that the S60 platform documentation does not make clear the distinction between this value and the Diffusion value. - + 密度 (%) Diffusion (%) Diffusion: Delay between first and subsequent reflections. Note that the S60 platform documentation does not make clear the distinction between this value and the Density value. - + 拡散度 (%) Reflections delay (ms) ReflectionsDelay: Amount of delay between the arrival the direct path from the source and the arrival of the first reflection. - + 反射遅延 (ms) Reflections level (mB) ReflectionsLevel: Amplitude of reflections. This value is corrected by the RoomLevel to give the final reflection amplitude. - + 反射レベル (mB) Reverb delay (ms) ReverbDelay: Amount of time between arrival of the first reflection and start of the late reverberation. - + リバーブ遅延 (ms) Reverb level (mB) ReverbLevel Amplitude of reverberations. This value is corrected by the RoomLevel to give the final reverberation amplitude. - + リバーブ レベル (mB) Room HF level RoomHFLevel: Amplitude of low-pass filter used to attenuate the high frequency component of reflected sound. - + 高周波室内レベル Room level (mB) RoomLevel: Master volume control for all reflected sound. - + 室内レベル (mB) @@ -1531,7 +1531,7 @@ to Invalid use of namespace - 無効なネームスペースの使用法です + 無効な名前空間の使用法です Not an attached property name @@ -1701,19 +1701,19 @@ to QDeclarativeCompositeTypeManager Resource %1 unavailable - リソース %1 が利用できません + リソース %1 が利用できません Namespace %1 cannot be used as a type - ネームスペース %1 を型として使用することはできません + 名前空間 %1 を型として使用することはできません %1 %2 - %1 %2 + %1 %2 Type %1 unavailable - 型 %1 が利用できません + 型 %1 が利用できません @@ -1801,15 +1801,15 @@ to import "%1" has no qmldir and no namespace - import する "%1" に qmldir もネームスペースもありません + import する "%1" に qmldir も名前空間もありません - %1 is not a namespace - - %1 はネームスペースではありません + - %1 は名前空間ではありません - nested namespaces not allowed - - ネームスペースのネストは許可されていません + - 名前空間のネストは許可されていません local directory @@ -1878,7 +1878,7 @@ to ListElement: cannot contain nested elements - ListElement: ネストしたエレメントは保持できません + ListElement: ネストした要素は保持できません ListElement: cannot use reserved "id" property @@ -1998,19 +1998,19 @@ to Invalid import qualifier ID - import するネームスペースの ID が無効です + import する名前空間の ID が無効です Reserved name "Qt" cannot be used as an qualifier - 予約語 "Qt" を import するネームスペースに使用することはできません + 予約語 "Qt" を import する名前空間に使用することはできません Script import qualifiers must be unique. - スクリプトを import するネームスペースは一意である必要があります。 + スクリプトを import する名前空間は一意である必要があります。 Script import requires a qualifier - スクリプトを import する際にはネームスペースの指定が必要です + スクリプトを import する際には名前空間の指定が必要です Library import requires a version @@ -2097,6 +2097,44 @@ to + QDeclarativeTypeData + + Script %1 unavailable + スクリプト %1 が利用できません + + + Type %1 unavailable + 型 %1 が利用できません + + + Namespace %1 cannot be used as a type + 名前空間 %1 を型として使用することはできません + + + %1 %2 + %1 %2 + + + + QDeclarativeTypeLoader + + Script %1 unavailable + スクリプト %1 が利用できません + + + Type %1 unavailable + 型 %1 が利用できません + + + Namespace %1 cannot be used as a type + 名前空間 %1 を型として使用することはできません + + + %1 %2 + %1 %2 + + + QDeclarativeVME Unable to create object of type %1 @@ -3316,7 +3354,7 @@ Do you want to delete it anyway? QLibrary Could not mmap '%1': %2 - '%1' をメモリにマッピングできませんでした: %2 + '%1' をメモリにマッピングできませんでした: %2 Plugin verification data mismatch in '%1' @@ -3324,7 +3362,7 @@ Do you want to delete it anyway? Could not unmap '%1': %2 - '%1' のマッピングを解除できませんでした: %2 + '%1' のマッピングを解除できませんでした: %2 The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] @@ -3663,7 +3701,7 @@ Do you want to delete it anyway? <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> - + <p>Qt はクロスプラットフォームアプリケーション開発用の C++ ツールキットです。</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>Qt ライセンスについての概要は <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> をご覧ください。</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt は Nokia 社の製品です。詳しい情報は <a href="http://qt.nokia.com/">qt.nokia.com</a> をご覧ください。</p> @@ -5751,7 +5789,7 @@ Please choose a different file name. Hot Links - + 人気のリンク Adjust Brightness @@ -5771,15 +5809,15 @@ Please choose a different file name. Back Forward - + 戻る Application Left - + Application Left Application Right - + Application Right Book @@ -5799,7 +5837,7 @@ Please choose a different file name. Clear Grab - + Clear Grab Close @@ -5839,11 +5877,11 @@ Please choose a different file name. Go - + Go iTouch - + iTouch Logoff @@ -5863,7 +5901,7 @@ Please choose a different file name. Menu PB - + Menu PB My Sites @@ -5899,15 +5937,15 @@ Please choose a different file name. Rotate Windows - + Rotate Windows Rotation PB - + Rotation PB Rotation KB - + Rotation KB Save @@ -6023,7 +6061,7 @@ Please choose a different file name. Audio Cycle Track - + Audio Cycle Track Time @@ -6130,7 +6168,7 @@ Please choose a different file name. Toggle Call/Hangup Button that will hang up if we're in call, or make a call if we're not. - + 通話/終話の切替 Flip @@ -6138,7 +6176,7 @@ Please choose a different file name. Voice Dial - Button to trigger voice dialling + Button to trigger voice dialing ボイスダイアル @@ -6238,43 +6276,43 @@ Please choose a different file name. Hangul Start - + Hangul Start Hangul End - + Hangul End Hangul Hanja - + ハングル 漢字 Hangul Jamo - + ハングル 字母 Hangul Romaja - + ハングル ローマ字入力 Hangul Jeonja - + Hangul Jeonja Hangul Banja - + Hangul Banja Hangul PreHanja - + Hangul PreHanja Hangul PostHanja - + Hangul PostHanja Hangul Special - + Hangul Special Ctrl @@ -6469,7 +6507,7 @@ Please choose a different file name. QSslSocket Error creating SSL context (%1) - SSL content の作成に失敗しました (%1) + SSL context の作成に失敗しました (%1) Invalid or empty cipher list (%1) @@ -7223,12 +7261,12 @@ Please choose a different file name. Seek quickly back Media controller element - + 少し戻る Seek quickly forward Media controller element - + 少し進む Indefinite time @@ -7794,7 +7832,7 @@ Please choose a different file name. Sequence ']]>' not allowed in content. - このコンテキストでは、']]>' は許可されていません。 + このコンテンツでは、']]>' は許可されていません。 Encountered incorrectly encoded content. @@ -7944,7 +7982,7 @@ Please choose a different file name. Element %1 can't be serialized because it appears outside the document element. - エレメント %1 はシリアライズできません。このドキュメントの範囲を越えるエレメントを含んでいます。 + 要素 %1 はシリアライズできません。このドキュメントの範囲を越える要素を含んでいます。 Attribute %1 can't be serialized because it appears at the top level. @@ -7952,7 +7990,7 @@ Please choose a different file name. Year %1 is invalid because it begins with %2. - %1 年はむこうです。%2 で始まっています。 + %1 年は無効です。%2 で始まっています。 Day %1 is outside the range %2..%3. @@ -7992,7 +8030,7 @@ Please choose a different file name. %1 is not a valid value of type %2. - %1 は、%2 の型に対して有効な値ではありません。 + %1 は、型 %2 の値として無効です。 When casting to %1 from %2, the source value cannot be %3. @@ -8044,7 +8082,7 @@ Please choose a different file name. %1 is not valid as a value of type %2. - 型 %2 に対して、値 %1 は有効ではありません。 + 値 %1 は、型 %2 の値として無効です。 Ambiguous rule match. @@ -8084,7 +8122,7 @@ Please choose a different file name. In a namespace constructor, the value for a namespace cannot be an empty string. - 名前空間のスントラクトにおいて、空白の文字列を名前空間の値として使用することはできません。 + 名前空間のコンストラクタにおいて、空白の文字列を名前空間の値として使用することはできません。 The prefix must be a valid %1, which %2 is not. @@ -8136,11 +8174,11 @@ Please choose a different file name. No namespace binding exists for the prefix %1 - プレフィックス %1 にバインドされたネームスペースがありません + プレフィックス %1 にバインドされた名前空間がありません No namespace binding exists for the prefix %1 in %2 - %2 におけるプレフィックス %1 にバインディングされたネームスペースが存在しません + %2 におけるプレフィックス %1 にバインディングされた名前空間が存在しません %1 is an invalid %2 @@ -8180,7 +8218,7 @@ Please choose a different file name. %1 is not a valid XML 1.0 character. - %1 は XML 1.0 において有効な文字ではありません。 + %1 は、XML 1.0 文字として無効です。 The root node of the second argument to function %1 must be a document node. %2 is not a document node. @@ -8224,7 +8262,7 @@ Please choose a different file name. %1 is an invalid regular expression pattern: %2 - %1 は有効な正規表現ではありません。: %2 + %1 は有効な正規表現ではありません: %2 %1 is an invalid flag for regular expressions. Valid flags are: @@ -8276,15 +8314,15 @@ Please choose a different file name. W3C XML Schema identity constraint selector - + W3C XML スキーマ ID制約 selector W3C XML Schema identity constraint field - + W3C XML スキーマ ID制約 field A construct was encountered which is disallowed in the current language(%1). - + 現在の言語 (%1) では許可されていない構造が検出されました。 %1 is an unknown schema type. @@ -8488,11 +8526,11 @@ Please choose a different file name. An attribute with name %1 has already appeared on this element. - 属性名 '%1' は、すでにこのエレメントで使用されています。 + 属性名 '%1' は、すでにこの要素で使用されています。 A direct element constructor is not well-formed. %1 is ended with %2. - 直積的な指定のエレメントがwell formedではありません。'%1' が、'%2' で終わっています。 + 直積的な指定の要素がwell formedではありません。'%1' が、'%2' で終わっています。 The name %1 does not refer to any schema type. @@ -8520,7 +8558,7 @@ Please choose a different file name. Element %1 is not allowed at this location. - この場所にエレメント '%1' をおくことは許可されていません。 + この場所に要素 %1 をおくことは許可されていません。 Text nodes are not allowed at this location. @@ -8552,31 +8590,31 @@ Please choose a different file name. If element %1 has no attribute %2, it cannot have attribute %3 or %4. - エレメント '%1' が属性 '%2' を持たない場合は、属性 '%3' や '%4' を使用することはできません。 + 要素 '%1' が属性 '%2' を持たない場合は、属性 '%3' や '%4' を使用することはできません。 Element %1 must have at least one of the attributes %2 or %3. - エレメント '%1' は、属性 '%2' か '%3' のいずれかを持たなければなりません。 + 要素 '%1' は、属性 '%2' か '%3' のいずれかを持たなければなりません。 At least one mode must be specified in the %1-attribute on element %2. - エレメント '%2' において、'%1' 属性は少くとも一つのモードを指定しなければなりません。 + 要素 '%2' において、'%1' 属性は少くとも一つのモードを指定しなければなりません。 Element %1 must come last. - エレメント %1 は最後になければなりません。 + 要素 %1 は最後になければなりません。 At least one %1-element must occur before %2. - %2 の前に、少くとも一つは %1 エレメントが存在しなければなりません。 + %2 の前に、少くとも一つは %1 要素が存在しなければなりません。 Only one %1-element can appear. - %1 エレメントは一つのみ存在しなければなりません。 + %1 要素は一つのみ存在しなければなりません。 At least one %1-element must occur inside %2. - %2 の内側には、少くとも一つの '%1' エレメントが存在しなければなりません。 + %2 の内側には、少くとも一つの '%1' 要素が存在しなければなりません。 When attribute %1 is present on %2, a sequence constructor cannot be used. @@ -8584,7 +8622,7 @@ Please choose a different file name. Element %1 must have either a %2-attribute or a sequence constructor. - エレメント %1 には、%2 属性またはsequence constructorがなければなりません。 + 要素 %1 には、%2 属性またはsequence constructorがなければなりません。 When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. @@ -8592,11 +8630,11 @@ Please choose a different file name. Element %1 cannot have children. - エレメント %1 は、子要素を持つことができません。 + 要素 %1 は、子要素を持つことができません。 Element %1 cannot have a sequence constructor. - エレメント %1 は、sequence constructor を含むことができません。 + 要素 %1 は、sequence constructor を含むことができません。 The attribute %1 cannot appear on %2, when it is a child of %3. @@ -8612,11 +8650,11 @@ Please choose a different file name. Top level stylesheet elements must be in a non-null namespace, which %1 isn't. - トップレベルのスタイルシートのエレメントは、non-nullな名前空間を持っていなければなりません。しかし、%1 はそうではありません。 + トップレベルのスタイルシートの要素は、non-nullな名前空間を持っていなければなりません。しかし、%1 はそうではありません。 The value for attribute %1 on element %2 must either be %3 or %4, not %5. - エレメント %2 の属性 %1 の値は、%3 または %4 でなければなりません。%5 は異なります。 + 要素 %2 の属性 %1 の値は、%3 または %4 でなければなりません。%5 は異なります。 Attribute %1 cannot have the value %2. @@ -8624,1083 +8662,1083 @@ Please choose a different file name. The attribute %1 can only appear on the first %2 element. - 属性 %1 は、最初の %2 エレメントにのみ指定できます。 + 属性 %1 は、最初の %2 要素にのみ指定できます。 At least one %1 element must appear as child of %2. - %2 の子要素としては、少くとも一つは %1 エレメントがなければなりません。 + %2 の子要素としては、少くとも一つは %1 要素がなければなりません。 Empty particle cannot be derived from non-empty particle. - 空ではない particle から空の particle を得ることはできません。 + 空ではないパーティクルから空のパーティクルを派生させることはできません。 Derived particle is missing element %1. - 取得した particle に要素 %1 がありません。 + 派生パーティクル に要素 %1 がありません。 Derived element %1 is missing value constraint as defined in base particle. - + 派生要素 %1 は基底パーティクルで値制約が定義されていません。 Derived element %1 has weaker value constraint than base particle. - + 派生要素 %1 は基底パーティクルよりも弱い値制約を持っています。 Fixed value constraint of element %1 differs from value constraint in base particle. - + 要素 %1 の固定値制約は基底パーティクルの値制約と異なっています。 Derived element %1 cannot be nillable as base element is not nillable. - + 基底要素が null を許可していない為、派生要素 %1 に null を許可させる事はできません。 Block constraints of derived element %1 must not be more weaker than in the base element. - + 派生要素 %1 の Block 制約は、基底要素よりも弱くできません。 Simple type of derived element %1 cannot be validly derived from base element. - + 派生要素 %1 の単純型は、基底要素から適切に派生できません。 Complex type of derived element %1 cannot be validly derived from base element. - + 派生要素 %1 の複合型は、基底要素から適切に派生できません。 Element %1 is missing in derived particle. - + 派生パーティクルに要素 %1 がありません。 Element %1 does not match namespace constraint of wildcard in base particle. - + 要素 %1 は基底パーティクルのワイルドカードの名前空間制約にマッチしません。 Wildcard in derived particle is not a valid subset of wildcard in base particle. - + 派生パーティクルにあるワイルドカードは、基底パーティクルのワイルドカードのサブセットとして無効です。 processContent of wildcard in derived particle is weaker than wildcard in base particle. - + 派生パーティクルのワイルドカードの processContent は基底パーティクルのワイルドカードよりも弱いです。 Derived particle allows content that is not allowed in the base particle. - + 派生パーティクルはコンテンツを許可していますが、基底パーティクルでは許可していません。 %1 has inheritance loop in its base type %2. - + %1 は、基底型 %2 で継承ループしています。 Circular inheritance of base type %1. - + 基底型 %1 を循環継承しています。 Circular inheritance of union %1. - + union %1 を循環継承しています。 %1 is not allowed to derive from %2 by restriction as the latter defines it as final. - + %1 は最終的に定義される制約により %2 を派生する事は許可されていません。 %1 is not allowed to derive from %2 by extension as the latter defines it as final. - + %1 は最終的に定義される拡張により %2 を派生する事は許可されていません。 Base type of simple type %1 cannot be complex type %2. - + 単純型 %1 の基底型は複合型 %2 にはできません。 Simple type %1 cannot have direct base type %2. - + 単純型 %1 は基底型 %2 を直接持つ事はできません。 Simple type %1 is not allowed to have base type %2. - + 単純型 %1 は基底型 %2 を持つ事は許可されていません。 Simple type %1 can only have simple atomic type as base type. - + 単純型 %1 は基底型として単純なアトミック型のみ持つ事ができます。 Simple type %1 cannot derive from %2 as the latter defines restriction as final. - + 単純型 %1 は最終的に定義される制約により %2 を派生できません。 Variety of item type of %1 must be either atomic or union. - + %1 の各アイテム型は atomic か union である必要があります。 Variety of member types of %1 must be atomic. - + %1 の各メンバーの型は atomic である必要があります。 %1 is not allowed to derive from %2 by list as the latter defines it as final. - + %1 は最終的に定義されるリストにより %2 を派生する事は許可されていません。 Simple type %1 is only allowed to have %2 facet. - + 単純型 %1 は %2 ファセットのみ持つ事ができます。 Base type of simple type %1 must have variety of type list. - + 単純型 %1 の基底型は各型のリストを持っていなければなりません。 Base type of simple type %1 has defined derivation by restriction as final. - + 単純型 %1 の基底型は最終的に制約により派生として定義されています。 Item type of base type does not match item type of %1. - + 基底型のアイテム型が %1 のアイテム型にマッチしていません。 Simple type %1 contains not allowed facet type %2. - + 単純型 %1 がファセット型 %2 を含む事は許可されていません。 %1 is not allowed to derive from %2 by union as the latter defines it as final. - + %1 は最終的に定義される union により %2 を派生する事は許可されていません。 %1 is not allowed to have any facets. - + %1 はどんなファセットも持つ事を許可されていません。 Base type %1 of simple type %2 must have variety of union. - + 単純型 %2 の基底型 %1 は各型の uinon を持っていなければなりません。 Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute. - + 単純型 %2 の基底型 %1 は %3 属性内に制約を持つ事を許可されていません。 Member type %1 cannot be derived from member type %2 of %3's base type %4. - + メンバ型 %1 は %3 の基底型 %4 のメンバ型 %2 から派生する事はできません。 Derivation method of %1 must be extension because the base type %2 is a simple type. - + %1 の派生メソッドは基底型 %2 が単純型の為、拡張でなければなりません。 Complex type %1 has duplicated element %2 in its content model. - + 複合形 %1 は自身のコンテンツ モデル内で要素 %2 を重複させています。 Complex type %1 has non-deterministic content. - + 複合型 %1 は非決定性コンテンツを所有しています。 Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3. - + 複合型 %1 の属性は、基底型 %2 の属性の拡張として無効です: %3。 Content model of complex type %1 is not a valid extension of content model of %2. - + 複合型 %1 のコンテンツ モデルは、%2 のコンテンツ モデルの拡張として無効です。 Complex type %1 must have simple content. - + 複合型 %1 は単純コンテンツを持たなければなりません。 Complex type %1 must have the same simple type as its base class %2. - + 複合型 %1 は基底クラス %2 のような単純型を持たなければなりません。 Complex type %1 cannot be derived from base type %2%3. - + 複合型 %1 は基底型 %2 から派生する事はできません %3。 Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3. - + 複合型 %1 の属性は、基底型 %2 の属性の制約として無効です: %3。 Complex type %1 with simple content cannot be derived from complex base type %2. - + 単純コンテンツの複合型 %1 は複合基底型 %2 を派生する事はできません。 Item type of simple type %1 cannot be a complex type. - + 単純型 %1 のアイテム型を複合型にする事はできません。 Member type of simple type %1 cannot be a complex type. - + 単純型 %1 のメンバー型を複合型にする事はできません。 %1 is not allowed to have a member type with the same name as itself. - + %1 は自身と同名のメンバー型を所有する事を許可していません。 %1 facet collides with %2 facet. - + %1 ファセットと %2 ファセットが衝突しています。 %1 facet must have the same value as %2 facet of base type. - + %1 ファセットは基底型の %2 ファセットと同値を所有しなければなりません。 %1 facet must be equal or greater than %2 facet of base type. - + %1 ファセットは基底型の %2 ファセットと同じかそれ以上でなければなりません。 %1 facet must be less than or equal to %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以下でなければなりません。 %1 facet contains invalid regular expression - + %1 ファセットは無効な正規表現を含んでいます Unknown notation %1 used in %2 facet. - + 未知の表記法 %1 が %2 ファセットで使われています。 %1 facet contains invalid value %2: %3. - + %1 ファセットは無効な値 %2 を含んでいます: %3。 %1 facet cannot be %2 or %3 if %4 facet of base type is %5. - + %1 ファセットは、%4 ファセットの基底型が %5 の場合に %2 や %3 にする事はできません。 %1 facet cannot be %2 if %3 facet of base type is %4. - + %1 ファセットは、%3 ファセットの基底型が %4 の場合に %2 にする事はできません。 %1 facet must be less than or equal to %2 facet. - + %1 ファセットは %2 ファセット以下でなければなりません。 %1 facet must be less than %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以下でなければなりません。 %1 facet and %2 facet cannot appear together. - + %1 ファセットと %2 ファセットを同時に現す事はできません。 %1 facet must be greater than %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以上でなければなりません。 %1 facet must be less than %2 facet. - + %1 ファセットは %2 ファセット以下でなければなりません。 %1 facet must be greater than or equal to %2 facet of base type. - + %1 ファセットは基底型の %2 ファセット以上でなければなりません。 Simple type contains not allowed facet %1. - + 単純型がファセット %1 を含む事は許可されていません。 %1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list. - + list に派生される場合、%1, %2, %3, %4, %5, %6 ファセットは許可されていません。 Only %1 and %2 facets are allowed when derived by union. - + union に派生される場合、%1 と %2 ファセットだけが許可されます。 %1 contains %2 facet with invalid data: %3. - + %1 は無効なデータを含んだ %2 ファセットが含まれています: %3。 Attribute group %1 contains attribute %2 twice. - + 属性グループ %1 は属性 %2 を2重に含んでいます。 Attribute group %1 contains two different attributes that both have types derived from %2. - + 属性グループ %1 はどちらも %2 から派生した型を持つ2つの異なる属性を含んでいます。 Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3. - + 属性グループ %1 は %3 を継承した型の値制約を持つ属性 %2 を含んでいます。 Complex type %1 contains attribute %2 twice. - + 複合型 %1 は属性 %2 を2回含んでいます。 Complex type %1 contains two different attributes that both have types derived from %2. - + 複合型 %1 はどちらも %2 から派生した型を持つ2つの異なる属性を含んでいます。 Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3. - + 複合型 %1 は %3 を継承した型の値制約を持つ属性 %2 を含んでいます。 Element %1 is not allowed to have a value constraint if its base type is complex. - + 要素 %1 は自身の基底型が複合型の場合に値制約を持つ事を許可されていません。 Element %1 is not allowed to have a value constraint if its type is derived from %2. - + 要素 %1 は、自身が %2 を派生している場合に値制約を持つ事を許可されていません。 Value constraint of element %1 is not of elements type: %2. - + 要素 %1 の値制約は要素型のものではありません: %2。 Element %1 is not allowed to have substitution group affiliation as it is no global element. - + 要素 %1 はグローバル要素ではない代替グループ関係を持つ事を許可されていません。 Type of element %1 cannot be derived from type of substitution group affiliation. - + 要素 %1 の型は代替グループ関係の型を派生する事はできません。 Value constraint of attribute %1 is not of attributes type: %2. - + 属性 %1 の値制約は属性型のものではありません: %2。 Attribute %1 has value constraint but has type derived from %2. - + 属性 %1 は %2 から派生した型を持つ値制約を持っています。 %1 attribute in derived complex type must be %2 like in base type. - + 派生複合型の %1 属性は基底型のように %2 でなければなりません。 Attribute %1 in derived complex type must have %2 value constraint like in base type. - + 派生複合型の属性 %1 は基底型のように %2 値制約を持たなければなりません。 Attribute %1 in derived complex type must have the same %2 value constraint like in base type. - + 派生複合型の属性 %1 は、基底型と同様に %2 値制約を持たなければなりません。 Attribute %1 in derived complex type must have %2 value constraint. - + 派生複合型の属性 %1 は %2 値制約を持たなければなりません。 processContent of base wildcard must be weaker than derived wildcard. - + 基底ワイルドカードの processContent は派生ワイルドカードよりも弱くなければなりません。 Element %1 exists twice with different types. - + 要素 %1 が異なる型で2つ存在しています。 Particle contains non-deterministic wildcards. - + パーティクルは非決定性ワイルドカードを含んでいます。 Base attribute %1 is required but derived attribute is not. - + 基底属性 %1 は必須ですが派生属性はそうなっていません。 Type of derived attribute %1 cannot be validly derived from type of base attribute. - + 派生属性 %1 の型は基底属性の型を有効に派生する事はできません。 Value constraint of derived attribute %1 does not match value constraint of base attribute. - + 派生属性 %1 の値制約は基底属性の値制約にマッチしません。 Derived attribute %1 does not exist in the base definition. - + 派生属性 %1 は基底定義の中に存在しません。 Derived attribute %1 does not match the wildcard in the base definition. - + 派生属性 %1 は基底定義のワイルドカードにマッチしません。 Base attribute %1 is required but missing in derived definition. - + 基底属性 %1 は必須ですが派生定義内に見つかりません。 Derived definition contains an %1 element that does not exists in the base definition - + 派生定義は %1 要素を含んでいますが基底定義内で存在していません Derived wildcard is not a subset of the base wildcard. - + 派生ワイルドカードは基底ワイルドカードのサブセットではありません。 %1 of derived wildcard is not a valid restriction of %2 of base wildcard - + 派生ワイルドカードの %1 は、基底ワイルドカードの %2 の制約として無効です Attribute %1 from base type is missing in derived type. - + 派生型で基底型の属性 %1 が見つかりません。 Type of derived attribute %1 differs from type of base attribute. - + 派生属性 %1 の型が基底属性の型と異なっています。 Base definition contains an %1 element that is missing in the derived definition - + 基底定義は %1 要素を含んでいますが派生定義内で見つかりません Can not process unknown element %1, expected elements are: %2. - + 未知の要素 %1 を処理できません、期待する要素は以下のものです: %2。 Element %1 is not allowed in this scope, possible elements are: %2. - + 要素 %1 はこのスコープ内で許可されていません、使用可能な要素は次のものです: %2。 Child element is missing in that scope, possible child elements are: %1. - + 子要素がそのスコープ内で見つかりません、使用可能な子要素は次のものです: %1。 Document is not a XML schema. - + ドキュメントは XML スキーマではありません。 %1 attribute of %2 element contains invalid content: {%3} is not a value of type %4. - + %2 要素の %1 属性は不正なコンテンツを含んでいます: {%3} は型 %4 の値ではありません。 %1 attribute of %2 element contains invalid content: {%3}. - + %2 要素の %1 属性は不正なコンテンツを含んでいます: {%3}。 Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema. - + インクルードしているスキーマの対象名前空間 %1 はインクルードしようとしているスキーマで定義されている対象名前空間 %2 と異なっています。 Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema. - + インポートしているスキーマの対象名前空間 %1 はインポートしようとしているスキーマで定義されている対象名前空間 %2 と異なっています。 %1 element is not allowed to have the same %2 attribute value as the target namespace %3. - + %1 要素は対象名前空間 %3 として %2 属性値を持つ事を許可されていません。 %1 element without %2 attribute is not allowed inside schema without target namespace. - + %2 属性なし %1 要素は対象名前空間なしのスキーマ内にある事を許可されていません。 %1 element is not allowed inside %2 element if %3 attribute is present. - + %3 属性が存在している場合、%2 要素内で %1 要素は許可されていません。 %1 element has neither %2 attribute nor %3 child element. - + %1 要素は %2 属性も %3 子要素のどちらも持っていません。 %1 element with %2 child element must not have a %3 attribute. - + %2 子要素付き %1 要素は %3 属性を持ってはいけません。 %1 attribute of %2 element must be %3 or %4. - + %2 要素の %1 属性は %3 か %4 でなければなりません。 %1 attribute of %2 element must have a value of %3. - + %2 要素の %1 属性の値は %3 でなければなりません。 %1 attribute of %2 element must have a value of %3 or %4. - + %2 要素の %1 属性の値は %3 か %4 でなければなりません。 %1 element must not have %2 and %3 attribute together. - + %1 要素は %2 と %3 属性を同時に持っていてはいけません。 Content of %1 attribute of %2 element must not be from namespace %3. - + %2 要素の %1 属性のコンテンツは名前空間 %3 のものであってはいけません。 %1 attribute of %2 element must not be %3. - + %2 要素の %1 属性は %3 であってはいけません。 %1 attribute of %2 element must have the value %3 because the %4 attribute is set. - + %2 要素の %1 属性は %4 属性がセットされているので値 %3 を持たなければなりません。 Specifying use='prohibited' inside an attribute group has no effect. - + 属性グループ内で定義されている use = 'prohibited' は効果がありません。 %1 element must have either %2 or %3 attribute. - + %1 要素は %2 か %3 属性のどちらかを持たなければなりません。 %1 element must have either %2 attribute or %3 or %4 as child element. - + %1 要素は %2 属性や子要素として %3 や %4 のどちらも持っていてはいけません。 %1 element requires either %2 or %3 attribute. - + %1 要素は %2 か %3 属性を必要とします。 Text or entity references not allowed inside %1 element - + テキストまたはエンティティ参照は %1 要素内で許可されていません %1 attribute of %2 element must contain %3, %4 or a list of URIs. - + %2 要素の %1 属性は %3、%4 または URI のリストを含んでいなければなりません。 %1 element is not allowed in this context. - + %1 要素はこのコンテキストで許可されていません。 %1 attribute of %2 element has larger value than %3 attribute. - + %2 要素の %1 属性は %3 属性よりも大きな値になっています。 Prefix of qualified name %1 is not defined. - + 修飾名 %1 のプレフィックスが定義されていません。 %1 attribute of %2 element must either contain %3 or the other values. - + %2 要素の %1 属性は %3 や他の値を含んではいけません。 Component with ID %1 has been defined previously. - + ID %1 のコンポーネントは以前に定義されています。 Element %1 already defined. - + 要素 %1 はすでに定義されています。 Attribute %1 already defined. - + 属性 %1 はすでに定義されています。 Type %1 already defined. - + 型 %1 はすでに定義されています。 Attribute group %1 already defined. - + 属性グループ %1 はすでに定義されています。 Element group %1 already defined. - + 要素グループ %1 はすでに定義されています。 Notation %1 already defined. - + 表記法 %1 はすでに定義されています。 Identity constraint %1 already defined. - + ID制約 %1 はすでに定義されています。 Duplicated facets in simple type %1. - + 単純型 %1 内でファセットが重複しています。 %1 references unknown %2 or %3 element %4. - + %1 は未知の %2 か %3 要素 %4 を参照しています。 %1 references identity constraint %2 that is no %3 or %4 element. - + %1 は %3 でも %4 要素でもないID制約 %2 を参照しています。 %1 has a different number of fields from the identity constraint %2 that it references. - + %1 のフィールド数が、自身が参照しているID制約 %2 のフィールド数と異なっています。 Base type %1 of %2 element cannot be resolved. - + %2 要素の基底型 %1 を解決できませんでした。 Item type %1 of %2 element cannot be resolved. - + %2 要素のアイテム型 %1 を解決できませんでした。 Member type %1 of %2 element cannot be resolved. - + %2 要素のメンバー型 %1 を解決できませんでした。 Type %1 of %2 element cannot be resolved. - + %2 要素の型 %1 を解決できませんでした。 Base type %1 of complex type cannot be resolved. - + 複合型の基底型 %1 を解決できませんでした。 %1 cannot have complex base type that has a %2. - + %1 は %2 を持った複合基底型を持つ事はできません。 Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type. - + 複合型 %1 のコンテンツモデルは %2 要素を含んでいますが非 empty 型を派生した拡張にする事はできません。 Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model. - + 複合型 %1 は、%3 要素をコンテンツモデルに含んでいる %2 の拡張にする事はできません。 Type of %1 element must be a simple type, %2 is not. - + %1 要素の型は %2 ではなく単純型にしなくてはいけません。 Substitution group %1 of %2 element cannot be resolved. - + %2 要素の代替グループ %1 を解決できませんでした。 Substitution group %1 has circular definition. - + 代替グループ %1 が循環参照しています。 Duplicated element names %1 in %2 element. - + %2 要素内で要素名 %1 が重複しています。 Reference %1 of %2 element cannot be resolved. - + %2 要素の参照 %1 を解決できませんでした。 Circular group reference for %1. - + グループ参照 %1 が循環しています。 %1 element is not allowed in this scope - + %1 要素はこのスコープ内で許可されていません %1 element cannot have %2 attribute with value other than %3. - + %1 要素は %3 以外の値の %2 属性を持つ事はできません。 %1 element cannot have %2 attribute with value other than %3 or %4. - + %1 要素は %3 や %4 以外の値の %2 属性を持つ事はできません。 %1 or %2 attribute of reference %3 does not match with the attribute declaration %4. - + 参照 %3 の %1 や %2 属性は属性宣言 %4 にマッチしません。 Attribute group %1 has circular reference. - + 属性グループ %1 が循環参照しています。 %1 attribute in %2 must have %3 use like in base type %4. - + %2 の属性 %1 は基底型 %4 のように %3 を所有しなくてはいけません。 Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2. - + %1 の属性ワイルドカードは、基底型 %2 の属性ワイルドカードの制約として無効です。 %1 has attribute wildcard but its base type %2 has not. - + %1 はワイルドカードを使用した属性を所有していますが基底型 %2 は所有していません。 Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible. - + 型 %1 の属性ワイルドカードの union と基底型 %2 の属性ワイルドカードは表現可能ではありません。 Enumeration facet contains invalid content: {%1} is not a value of type %2. - + 列挙型ファセットが不正なコンテンツを含んでいます: {%1} は、型 %2 の値ではありません。 Namespace prefix of qualified name %1 is not defined. - + 修飾名 %1 の名前空間プレフィックスが定義されていません。 %1 element %2 is not a valid restriction of the %3 element it redefines: %4. - + %1 要素 %2 は %3 要素が再定義している制約として無効です: %4。 %1 is not valid according to %2. - + %2 によると %1 は妥当ではありません。 String content does not match the length facet. - + string コンテンツが length ファセットにマッチしません。 String content does not match the minLength facet. - + string コンテンツが minLength ファセットにマッチしません。 String content does not match the maxLength facet. - + string コンテンツが maxLength ファセットにマッチしません。 String content does not match pattern facet. - + string コンテンツがパターンファセットにマッチしません。 String content is not listed in the enumeration facet. - + string コンテンツが列挙型ファセット内の一覧にありません。 Signed integer content does not match the maxInclusive facet. - + signed integer コンテンツが maxInclusive ファセットにマッチしません。 Signed integer content does not match the maxExclusive facet. - + signed integer コンテンツが maxExclusive ファセットにマッチしません。 Signed integer content does not match the minInclusive facet. - + signed integer コンテンツが minInclusive ファセットにマッチしません。 Signed integer content does not match the minExclusive facet. - + signed integer コンテンツが minExclusive ファセットにマッチしません。 Signed integer content is not listed in the enumeration facet. - + signed integer コンテンツが列挙型ファセット内の一覧にありません。 Signed integer content does not match pattern facet. - + signed integer コンテンツがパターンファセットにマッチしません。 Signed integer content does not match in the totalDigits facet. - + signed integer コンテンツが totalDigits ファセットで指定される値の範囲にマッチしません。 Unsigned integer content does not match the maxInclusive facet. - + unsigned integer コンテンツが maxInclusive ファセットにマッチしません。 Unsigned integer content does not match the maxExclusive facet. - + unsigned integer コンテンツが maxExclusive ファセットにマッチしません。 Unsigned integer content does not match the minInclusive facet. - + unsigned integer コンテンツが minInclusive ファセットにマッチしません。 Unsigned integer content does not match the minExclusive facet. - + unsigned integer コンテンツが minExclusive ファセットにマッチしません。 Unsigned integer content is not listed in the enumeration facet. - + unsigned integer コンテンツが列挙型ファセット内の一覧にありません。 Unsigned integer content does not match pattern facet. - + unsigned integer コンテンツがパターンファセットにマッチしません。 Unsigned integer content does not match in the totalDigits facet. - + unsigned integer コンテンツが totalDigits ファセットで指定される値の範囲にマッチしません。 Double content does not match the maxInclusive facet. - + double コンテンツが maxInclusive ファセットにマッチしません。 Double content does not match the maxExclusive facet. - + double コンテンツが maxExclusive ファセットにマッチしません。 Double content does not match the minInclusive facet. - + double コンテンツが minInclusive ファセットにマッチしません。 Double content does not match the minExclusive facet. - + double コンテンツが minExclusive ファセットにマッチしません。 Double content is not listed in the enumeration facet. - + double コンテンツが列挙型ファセット内の一覧にありません。 Double content does not match pattern facet. - + double コンテンツがパターンファセットにマッチしません。 Decimal content does not match in the fractionDigits facet. - + decimal コンテンツが fractionDigits ファセットで指定される値の範囲にマッチしません。 Decimal content does not match in the totalDigits facet. - + decimal コンテンツが totalDigits ファセットで指定される値の範囲にマッチしません。 Date time content does not match the maxInclusive facet. - + date time コンテンツが maxInclusive ファセットにマッチしません。 Date time content does not match the maxExclusive facet. - + date time コンテンツが maxExclusive ファセットにマッチしません。 Date time content does not match the minInclusive facet. - + date time コンテンツが minInclusive ファセットにマッチしません。 Date time content does not match the minExclusive facet. - + date time コンテンツが minExclusive ファセットにマッチしません。 Date time content is not listed in the enumeration facet. - + date time コンテンツが列挙型ファセット内の一覧にありません。 Date time content does not match pattern facet. - + date time コンテンツがパターンファセットにマッチしません。 Duration content does not match the maxInclusive facet. - + duration コンテンツが maxInclusive ファセットにマッチしません。 Duration content does not match the maxExclusive facet. - + duration コンテンツが maxExclusive ファセットにマッチしません。 Duration content does not match the minInclusive facet. - + duration コンテンツが minInclusive ファセットにマッチしません。 Duration content does not match the minExclusive facet. - + duration コンテンツが minExclusive ファセットにマッチしません。 Duration content is not listed in the enumeration facet. - + duration コンテンツが列挙型ファセット内の一覧にありません。 Duration content does not match pattern facet. - + duration コンテンツがパターンファセットにマッチしません。 Boolean content does not match pattern facet. - + boolean コンテンツがパターンファセットにマッチしません。 Binary content does not match the length facet. - + binary コンテンツが length ファセットにマッチしません。 Binary content does not match the minLength facet. - + binary コンテンツが minLength ファセットにマッチしません。 Binary content does not match the maxLength facet. - + binary コンテンツが maxLength ファセットにマッチしません。 Binary content is not listed in the enumeration facet. - + binary コンテンツが列挙型ファセット内の一覧にありません。 Invalid QName content: %1. - + 無効な QName コンテンツ: %1。 QName content is not listed in the enumeration facet. - + QName コンテンツが列挙型ファセット内の一覧にありません。 QName content does not match pattern facet. - + QName コンテンツがパターンファセットにマッチしません。 Notation content is not listed in the enumeration facet. - + notation コンテンツが列挙型ファセット内の一覧にありません。 List content does not match length facet. - + list コンテンツが length ファセットにマッチしません。 List content does not match minLength facet. - + list コンテンツが minLength ファセットにマッチしません。 List content does not match maxLength facet. - + list コンテンツが maxLength ファセットにマッチしません。 List content is not listed in the enumeration facet. - + list コンテンツが列挙型ファセット内の一覧にありません。 List content does not match pattern facet. - + list コンテンツがパターンファセットにマッチしません。 Union content is not listed in the enumeration facet. - + union コンテンツが列挙型ファセット内の一覧にありません。 Union content does not match pattern facet. - + union コンテンツがパターンファセットにマッチしません。 Data of type %1 are not allowed to be empty. - + 型 %1 のデータは空にする事を許容されていません。 Element %1 is missing child element. - + 要素 %1 に子要素がありません。 There is one IDREF value with no corresponding ID: %1. - + ID %1 に対応するIDREFがありません。 Loaded schema file is invalid. - + 読み込まれているスキーマファイルは無効です。 %1 contains invalid data. - + %1 は無効なデータを含んでいます。 xsi:schemaLocation namespace %1 has already appeared earlier in the instance document. - + xsi:schemaLocation 名前空間 %1 はインスタンスドキュメントの前に既に現れています。 xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute. - + 先頭の namespace ではない要素または属性の後に xsi:noNamespaceSchemaLocation を使用できません。 No schema defined for validation. - + 妥当性検証の為のスキーマが定義されていません。 No definition for element %1 available. - + 要素 %1 は使用できるように定義されていません。 Specified type %1 is not known to the schema. - + 指定された型 %1 はスキーマで未知です。 Element %1 is not defined in this scope. - + 要素 %1 がこのスコープ内で定義されていません。 Declaration for element %1 does not exist. - + 要素 %1 の宣言が存在しません。 Element %1 contains invalid content. - + 要素 %1 は不正な内容を含んでいます。 Element %1 is declared as abstract. - + 要素 %1 は抽象型として宣言されています。 Element %1 is not nillable. - + 要素 %1 は null を許可していません。 Attribute %1 contains invalid data: %2 - + 属性 %1 は不正なデータを含んでいます: %2 Element contains content although it is nillable. - + 要素は null が許容されていますが内容を含んでいます。 Fixed value constraint not allowed if element is nillable. - + null が許容されている要素への固定値制約は許容されていません。 Specified type %1 is not validly substitutable with element type %2. - + 指定された型 %1 は有効に置換できる要素型 %2 ではありません。 Complex type %1 is not allowed to be abstract. - + 複合型 %1 を抽象化する事は許可されていません。 Element %1 contains not allowed attributes. - + 要素 %1 は属性を含む事を許可されていません。 Element %1 contains not allowed child element. - + 要素 %1 は子要素を含む事を許可されていません。 Content of element %1 does not match its type definition: %2. - + 要素 %1 の内容が自身の型の定義とマッチしていません: %2。 Content of element %1 does not match defined value constraint. - + 要素 %1 の内容が定義されている値制約にマッチしていません。 Element %1 contains not allowed child content. - + 要素 %1 は子の内容を含む事を許可されていません。 Element %1 contains not allowed text content. - + 要素 %1 はテキストを含む事を許可されていません。 Element %1 cannot contain other elements, as it has a fixed content. - + 要素 %1 は固定値を持った他の要素を含む事はできません。 Element %1 is missing required attribute %2. - + 要素 %1 に要求された属性 %2 がありません。 Attribute %1 does not match the attribute wildcard. - + 属性 %1 は属性ワイルドカードにマッチしていません。 Declaration for attribute %1 does not exist. - + 属性 %1 の宣言が存在していません。 Element %1 contains two attributes of type %2. - + 要素 %1 が型 %2 の属性を2個含んでいます。 Attribute %1 contains invalid content. - + 属性 %1 は不正な内容を含んでいます。 Element %1 contains unknown attribute %2. - + 要素 %1 は未知の属性 %2 を含んでいます。 Content of attribute %1 does not match its type definition: %2. - + 属性 %1 の内容が自身の型の定義にマッチしていません: %2。 Content of attribute %1 does not match defined value constraint. - + 属性 %1 の内容が値制約の定義にマッチしていません。 Non-unique value found for constraint %1. - + 制約 %1 に一意ではない値が見つかりました。 Key constraint %1 contains absent fields. - + キー制約 %1 は欠落したフィールドを含んでいます。 Key constraint %1 contains references nillable element %2. - + キー制約 %1 は null を許容する要素 %2 の参照を含んでいます。 No referenced value found for key reference %1. - + キー参照 %1 によって参照される値が見つかりません。 More than one value found for field %1. - + フィールド %1 に2個以上の値があります。 Field %1 has no simple type. - + フィールド %1 が単純型を持っていません。 ID value '%1' is not unique. - + ID 値 '%1' が一意ではありません。 '%1' attribute contains invalid QName content: %2. - + '%1' 属性は不正な QName の内容を含んでいます: %2。 empty diff --git a/translations/qtconfig_ja.ts b/translations/qtconfig_ja.ts index e92a7d1..2c3c248 100644 --- a/translations/qtconfig_ja.ts +++ b/translations/qtconfig_ja.ts @@ -4,151 +4,114 @@ MainWindow - Desktop Settings (Default) デスクトップの設定(デフォルト) - Choose style and palette based on your desktop settings. デスクトップの設定に応じてスタイルとパレットを選択します。 - On The Spot On The Spot - - - - Auto (default) 自動(デフォルト) - Choose audio output automatically. オーディオ出力を自動的に選択します。 - - aRts aRts - Experimental aRts support for GStreamer. Gstreamer での aRts のサポート(Experimental)。 - Phonon GStreamer backend not available. Phonon の GStreamer バックエンドが見つかりません。 - Choose render method automatically 描画メソッドを自動的に選択します - - X11 X11 - Use X11 Overlays X11 のオーバーレイを使用 - - OpenGL OpenGL - Use OpenGL if available OpenGL が使用可能な場合は使用 - - Software ソフトウェア - Use simple software rendering ソフトウェアでの描画を使用 - No changes to be saved. 内容が変更されていません。 - Saving changes... 保存中… - Over The Spot Over The Spot - Off The Spot Off The Spot - Root Root - Select a Directory ディレクトリの選択 - <h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). <h3>%1</h3><br/>バージョン %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). - - - Qt Configuration Qt 設定ツール - Save Changes 変更の保存 - Save changes to settings? 変更内容を設定に保存しますか? - &Yes はい(&Y) - &No いいえ(&N) - &Cancel キャンセル(&C) @@ -156,363 +119,278 @@ MainWindowBase - Qt Configuration Qt 設定ツール - Appearance 外観 - GUI Style GUI スタイル - Select GUI &Style: GUI スタイルの選択(&S): - Preview プレビュー - Select &Palette: パレットの選択(&P): - Active Palette アクティブなパレット - Inactive Palette アクティブではないパレット - Disabled Palette 無効時のパレット - Build Palette パレットの設定 - &3-D Effects: &3D エフェクト: - Window Back&ground: ウィンドウのバックグラウンド(&G): - &Tune Palette... パレットを調整(&T)... - Please use the KDE Control Center to set the palette. KDE のコントロールセンターでパレットの設定をしてください。 - Fonts フォント - Default Font デフォルトのフォント - &Style: スタイル(&S): - &Point Size: ポイントサイズ(&P): - F&amily: ファミリー(&F): - Sample Text テキストのサンプル - Font Substitution フォントの置換 - S&elect or Enter a Family: ファミリーを選択するか入力してください(&E): - Current Substitutions: 現在の置換定義: - - Up 上へ - - Down 下へ - - Remove 削除 - Select s&ubstitute Family: 置換するファミリーの選択(&U): - - Add 追加 - Interface インターフェース - Feel Settings 一般的な設定 - - ms ミリ秒 - &Double Click Interval: ダブルクリックの間隔(&D): - No blinking 点滅しない - &Cursor Flash Time: カーソルの点滅の間隔(&C): - lines - Wheel &Scroll Lines: マウスホイールでのスクロール行数(&S): - Resolve symlinks in URLs URL のシンボリックリンクの解決 - GUI Effects GUI のエフェクト - &Enable 有効(&E) - Alt+E Alt+E - &Menu Effect: メニューのエフェクト(&E): - C&omboBox Effect: コンボボックスのエフェクト(&O): - &ToolTip Effect: ツールチップのエフェクト(&T): - Tool&Box Effect: ツールボックスのエフェクト(&B): - - - - Disable 無効 - - - - Animate アニメーション - - Fade フェード - Global Strut Global Strut - Minimum &Width: 幅の最小値(&W): - Minimum Hei&ght: 高さの最小値(&G): - - pixels ピクセル - Enhanced support for languages written right-to-left 右から左に書かれる言語のサポートの強化 - XIM Input Style: XIM のインプットスタイル: - On The Spot On The Spot - Over The Spot Over The Spot - Off The Spot Off The Spot - Root Root - Default Input Method: デフォルトのインプットメソッド: - Printer プリンタ - Enable Font embedding フォントを埋め込む - Font Paths フォントのパス - Browse... ブラウズ... - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. <b>ブラウズ</b>ボタンを押すかディレクトリを入力し、エンターキーか追加ボタンでリストに追加してください。 - Phonon Phonon - About Phonon Phonon について - - Current Version: 現在のバージョン: - - Not available 使用不可能 - - Website: ウェブサイト: - <!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; } @@ -525,12 +403,10 @@ p, li { white-space: pre-wrap; } <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 について - <!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; } @@ -543,22 +419,18 @@ p, li { white-space: pre-wrap; } <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 のバックエンドの設定 - Preferred audio sink: 優先するオーディオシンク: - Preferred render method: 優先する描画方法: - <!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; } @@ -571,57 +443,46 @@ p, li { white-space: pre-wrap; } <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;">注: これらの設定の変更によりアプリケーションが正常に起動しなくなる場合があります。</span></p></body></html> - &File ファイル(&F) - &Help ヘルプ(&H) - &Save 保存(&S) - Save 保存 - Ctrl+S Ctrl+S - E&xit 終了(&X) - Exit 終了 - &About Qt 設定ツールについて(&A) - About Qt 設定ツールについて - About &Qt &Qt について - About Qt Qt について @@ -629,208 +490,166 @@ p, li { white-space: pre-wrap; } PaletteEditorAdvancedBase - Tune Palette パレットの調整 - <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>パレットの編集</b><p>現在のウィジェットやフォームのパレットを変更してください。</p><p>自動生成されたパレットを使用するか、それぞれのグループ/役割に対して色を選択してください。</p><p>パレットの内容のプレビューセクションにある様々なウィジェットのレイアウトで確認できます。</p> - Select &Palette: パレットの選択(&P): - Active Palette アクティブなパレット - Inactive Palette アクティブではないパレット - Disabled Palette 無効時のパレット - Auto 自動 - Build inactive palette from active アクティブなパレットからアクティブではないパレットを構築 - Build disabled palette from active アクティブなパレットから無効時のパレットを構築 - Central color &roles 中央部の色の役割(&R) - Choose central color role 中央部の色の役割を選択してください - <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>色の役割の選択。</b><p>選択可能な中央部の役割: <ul> <li>ウィンドウ - 一般的な背景色。</li> <li>ウィンドウテキスト - 一般的な前景色。 </li> <li>ベース - テキスト入力ウィジェット等の背景色。通常は白などの明るい色。 </li> <li>テキスト - ベースと共に用いられる前景色。通常はウィンドウテキストと同じだが、ウィンドウとベースに対してよりよいコントラストが必要な場合に使用される。 </li> <li>ボタン - 一般的なボタンの背景色。Macintosh スタイルのようにウィンドウと異なる背景色を使用する場合に使用される。 </li> <li>ボタンテキスト - ボタンと共に用いられる前景色 </li> <li>ハイライト - アイテムが選択されていたり、ハイライトされていることを示すために使用される色。 </li> <li>ハイライトのテキスト - ハイライト時のテキストの色。 </li> <li>明るいテキスト - 黒などの背景色に対して使用されるテキストの色。ウィンドウテキストの反対の色。 </li> </ul> </p> - Window ウィンドウ - WindowText ウィンドウテキスト - Button ボタン - Base ベース - Text テキスト - BrightText 明るいテキスト - ButtonText ボタンテキスト - Highlight ハイライト - HighlightedText ハイライトのテキスト - &Select Color: 色の選択(&S): - - Choose a color 色を選択してください - Choose a color for the selected central color role. 選択された中央部の色の役割に使用する色を選択してください。 - 3-D shadow &effects 3Dの影の効果(&E) - Build &from button color ボタンの色から構築する(&F) - Generate shadings 影を生成する - Check to let 3D-effect colors be calculated from button-color. 3D効果の色をボタンの色から計算するにはチェックしてください。 - Choose 3D-effect color role 3D効果の色の役割の選択 - <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> <b>色の役割の選択。</b><p>選択可能な中央部の役割: <ul> <li>ライト - ボタンの色より明るい。 </li> <li>ミッドライト - ボタンとライトの間。 </li> <li>ミッド - ボタンとダークの間。 </li> <li>ダーク - ボタンより暗い。 </li> <li>シャドウ - とても暗い色。 </li> </ul> - Light ライト - Midlight ミッドライト - Mid ミッド - Dark ダーク - Shadow シャドウ - Select Co&lor: 色の選択(&L): - Choose a color for the selected effect color role. 選択の効果の色の役割に使用する色を選択してください。 - OK OK - Close dialog and apply all changes. 全ての変更を適用してダイアログを閉じる。 - Cancel キャンセル - Close dialog and discard all changes. 全ての変更を破棄してダイアログを閉じる。 @@ -838,7 +657,6 @@ p, li { white-space: pre-wrap; } PreviewFrame - Desktop settings will only take effect after an application restart. デスクトップの設定はアプリケーションの再起動後に反映されます。 @@ -846,62 +664,50 @@ p, li { white-space: pre-wrap; } PreviewWidgetBase - Preview Window プレビューウィンドウ - ButtonGroup ボタングループ - RadioButton1 ラジオボタン1 - RadioButton2 ラジオボタン2 - RadioButton3 ラジオボタン3 - ButtonGroup2 ボタングループ2 - CheckBox1 チェックボックス1 - CheckBox2 チェックボックス2 - LineEdit ラインエディタ - ComboBox コンボボックス - PushButton プッシュボタン - <p> <a href="http://qt.nokia.com">http://qt.nokia.com</a> </p> diff --git a/translations/qvfb_ja.ts b/translations/qvfb_ja.ts index cdf95c1..5dcfbc4 100644 --- a/translations/qvfb_ja.ts +++ b/translations/qvfb_ja.ts @@ -4,71 +4,54 @@ AnimationSaveWidget - - Record 録画 - Reset リセット - Save 保存 - Save in MPEG format (requires netpbm package installed) MPEG形式で保存(netpbmパッケージのインストールが必要) - - Click record to begin recording. 録画を開始するには「録画」をクリックしてください。 - - Finished saving. 保存が完了しました。 - Paused. Click record to resume, or save if done. 一時停止中。「録画」をクリック再開するか、保存をしてください。 - Pause 一時停止 - Recording... 録画中... - Saving... 保存中... - - Save animation... 動画を保存中... - Save canceled. 保存がキャンセルされました。 - Save failed! 保存に失敗しました! @@ -76,195 +59,154 @@ Config - Configure 設定 - Size サイズ - 176x220 "SmartPhone" 176x220 "スマートフォン" - 240x320 "PDA" 240x320 "PDA" - 320x240 "TV" / "QVGA" 320x240 "TV" / "QVGA" - 640x480 "VGA" 640x480 "VGA" - 800x480 800x480 - 800x600 800x600 - 1024x768 1024x768 - Custom それ以外 - Depth 色深度 - 1 bit monochrome 1 bit モノクロ - 2 bit grayscale 2 bit グレイスケール - 4 bit grayscale 4 bit グレイスケール - 8 bit 8 bit - 12 (16) bit 12(16) bit - 15 bit 15 bit - 16 bit 16 bit - 18 bit 18 bit - 24 bit 24 bit - 32 bit 32 bit - 32 bit ARGB 32 bit ARGB - Swap red and blue channels 赤と青のチャンネルを入れ替える - BGR format BGR フォーマット - Skin スキン - None なし - Emulate touch screen (no mouse move) タッチスクリーンのエミュレート(マウスムーブが無効になります) - Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) LCDスクリーンのエミュレート(3倍固定の拡大ズーム) - <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><i>以上の</i>サイズや色深度を変更した場合、ヴァーチャルフレームバッファ上で動作しているアプリケーションは終了します。<i>以下の</i>ガンマ値の変更の場合はアプリケーションは終了しません。 - Gamma ガンマ - Blue - - - - 1.0 1.0 - Green - All 全て - Red - Set all to 1.0 全て1.0にする - &OK &OK - &Cancel キャンセル(&C) @@ -272,57 +214,46 @@ DeviceSkin - The image file '%1' could not be loaded. 画像ファイル "%1" を読み込めません。 - The skin directory '%1' does not contain a configuration file. スキンのディレクトリ "%1" に設定ファイルがありません。 - The skin configuration file '%1' could not be opened. スキンの設定ファイル "%1" が開けません。 - The skin configuration file '%1' could not be read: %2 スキンの設定ファイル "%1" が読み込めません: %2 - Syntax error: %1 シンタックスエラー: %1 - The skin "up" image file '%1' does not exist. スキンの "up" の画像ファイル "%1" がありません。 - The skin "down" image file '%1' does not exist. スキンの "down" の画像ファイル "%1" がありません。 - The skin "closed" image file '%1' does not exist. スキンの "closed" の画像ファイル "%1" がありません。 - The skin cursor image file '%1' does not exist. スキンのカーソルの画像ファイル "%1" がありません。 - Syntax error in area definition: %1 エリア定義のシンタックスエラー: %1 - Mismatch in number of areas, expected %1, got %2. エリア数が正しくありません。%2 となってありますが %1 であるべきです。 @@ -330,170 +261,134 @@ QVFb - &Save image... 画像の保存(&S)... - &Animation... 動画の保存(&A)... - &Quit 終了(&Q) - Show &Cursor カーソルの表示(&C) - &Refresh Rate... リフレッシュレート(&R)... - Zoom scale &0.5 ズームスケール &0.5 - Zoom scale &1 ズームスケール &1 - Zoom scale &2 ズームスケール &2 - Zoom scale &3 ズームスケール &3 - Zoom scale &4 ズームスケール &4 - &File ファイル(&F) - &Configure... 設定の変更(&C)... - &View 表示(&V) - &No rotation ローテーションなし(&N) - &90° rotation &90° ローテーション - 1&80° rotation 1&80° ローテーション - 2&70° rotation 2&70° ローテーション - Zoom scale 0.7&5 ズームスケール 0.7&5 - Zoom &scale... ズームスケール(&S)... - &Help ヘルプ(&H) - &About... QVFB について(&A)... - Save Main Screen image メインスクリーンの画像の保存 - - snapshot.png スナップショット.png - - Portable Network Graphics (*.png) - Save Main Screen Image メインスクリーンの画像の保存 - - Save failed. Check that you have permission to write to the target directory. 保存に失敗しました。保存先のディレクトリn書き込み権限があるかを確認してください。 - Save Second Screen image サブスクリーンの画像の保存 - Save Second Screen Image サブスクリーンの画像の保存 - About QVFB QVFB について - <h2>The Qt for Embedded Linux Virtual X11 Framebuffer</h2><p>This application runs under Qt for X11, emulating a simple framebuffer, which the Qt for Embedded Linux server and clients can attach to just as if it was a hardware Linux framebuffer. <p>With the aid of this development tool, you can develop Qt for Embedded Linux applications under X11 without having to switch to a virtual console. This means you can comfortably use your other development tools such as GUI profilers and debuggers. <h2>The Qt for Embedded Linux Virtual X11 Framebuffer</h2><p>このアプリケーションは Qt for X11 上で動作し、Qt for Embedded Linux のサーバーとクライアントがハードウェアの Linux フレームバッファのように接続可能なシンプルなフレームバッファをエミュレートします。 <p>この開発ツールを使用すると Qt for Embedded Linux 向けのアプリケーションが X11 上でヴァーチャルコンソールへ切り替える事なく開発できるようになります。GUI のプロファイラやデバッガなどの他のツールを一緒に使用する時に便利でしょう。 - Browse... 他のスキンを参照... - Load Custom Skin... カスタムスキンを開く... - All QVFB Skins (*.skin) QVFB のスキン(*.skin) @@ -501,23 +396,18 @@ QVFbRateDialog - Target frame rate: ターゲットのフレームレート: - - %1fps %1fps - OK OK - Cancel キャンセル -- cgit v0.12 From 25ddfb434f13aa3bbc6ac303aa17dbe9582bf3f0 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 4 Oct 2010 15:42:51 +0300 Subject: Revert "When using complex transformations rendering goes easily off by one pixel." This reverts commit 2acdc634ee895af4a9738c0f6c2496e388afba38. Originally this fixed QT-3791 but it caused lots of problems in other sites. So reverting this will fix QT-4001 but reopens QT-3791. QT-4001 blocks Qt 4.7.1 but QT-3791 doesn't. Task-number: QT-4001 Reviewed-by: Jason Barron --- src/openvg/qpaintengine_vg.cpp | 158 +++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 92 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 74395a2..f6d2435 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -196,9 +196,7 @@ public: #endif QTransform transform; // Currently active transform. - bool affineTransform; // True if the transform is non-projective. - bool simpleTransform; // True if the transform is simple translate - // or 0, 90, 180, and 270 degree rotation + bool simpleTransform; // True if the transform is simple (non-projective). qreal penScale; // Pen scaling factor from "transform". QTransform pathTransform; // Calculated VG path transformation. @@ -379,7 +377,6 @@ void QVGPaintEnginePrivate::init() roundRectPath = 0; #endif - affineTransform = true; simpleTransform = true; pathTransformSet = false; penScale = 1.0; @@ -532,59 +529,12 @@ void QVGPaintEnginePrivate::setTransform vgLoadMatrix(mat); } -// Determine if a co-ordinate transform is simple enough to allow -// rectangle-based clipping with vgMask() and rounding translation -// to integers. Simple transforms most often result from origin translations. -static inline bool transformIsSimple(const QTransform& transform) -{ - QTransform::TransformationType type = transform.type(); - if (type == QTransform::TxNone || type == QTransform::TxTranslate) { - return true; - } else if (type == QTransform::TxScale) { - // Check for 0 and 180 degree rotations. - // (0 might happen after 4 rotations of 90 degrees). - qreal m11 = transform.m11(); - qreal m12 = transform.m12(); - qreal m21 = transform.m21(); - qreal m22 = transform.m22(); - if (m12 == 0.0f && m21 == 0.0f) { - if (m11 == 1.0f && m22 == 1.0f) - return true; // 0 degrees - else if (m11 == -1.0f && m22 == -1.0f) - return true; // 180 degrees. - if(m11 == 1.0f && m22 == -1.0f) - return true; // 0 degrees inverted y. - else if(m11 == -1.0f && m22 == 1.0f) - return true; // 180 degrees inverted y. - } - } else if (type == QTransform::TxRotate) { - // Check for 90, and 270 degree rotations. - qreal m11 = transform.m11(); - qreal m12 = transform.m12(); - qreal m21 = transform.m21(); - qreal m22 = transform.m22(); - if (m11 == 0.0f && m22 == 0.0f) { - if (m12 == 1.0f && m21 == -1.0f) - return true; // 90 degrees. - else if (m12 == -1.0f && m21 == 1.0f) - return true; // 270 degrees. - else if (m12 == -1.0f && m21 == -1.0f) - return true; // 90 degrees inverted y. - else if (m12 == 1.0f && m21 == 1.0f) - return true; // 270 degrees inverted y. - } - } - return false; -} - Q_DECL_IMPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) { VGfloat devh = pdev->height(); - simpleTransform = transformIsSimple(transform); - // Construct the VG transform by combining the Qt transform with // the following viewport transformation: // | 1 0 0 | @@ -607,9 +557,9 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) // so we will have to convert the co-ordinates ourselves. // Change the matrix to just the viewport transformation. pathTransform = viewport; - affineTransform = false; + simpleTransform = false; } else { - affineTransform = true; + simpleTransform = true; } pathTransformSet = false; @@ -638,7 +588,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) // Size is sufficient segments for drawRoundedRect() paths. QVarLengthArray segments; - if (sizeof(qreal) == sizeof(VGfloat) && elements && affineTransform) { + if (sizeof(qreal) == sizeof(VGfloat) && elements && simpleTransform) { // If Qt was compiled with qreal the same size as VGfloat, // then convert the segment types and use the incoming // points array directly. @@ -673,7 +623,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) int curvePos = 0; QPointF temp; - if (elements && affineTransform) { + if (elements && simpleTransform) { // Convert the members of the element array. for (int i = 0; i < count; ++i) { switch (elements[i]) { @@ -717,7 +667,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) } points += 2; } - } else if (elements && !affineTransform) { + } else if (elements && !simpleTransform) { // Convert the members of the element array after applying the // current transform to the path locally. for (int i = 0; i < count; ++i) { @@ -766,7 +716,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) } points += 2; } - } else if (count > 0 && affineTransform) { + } else if (count > 0 && simpleTransform) { // If there is no element array, then the path is assumed // to be a MoveTo followed by several LineTo's. coords.append(points[0]); @@ -779,7 +729,7 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) segments.append(VG_LINE_TO_ABS); --count; } - } else if (count > 0 && !affineTransform) { + } else if (count > 0 && !simpleTransform) { // Convert a simple path, and apply the transform locally. temp = transform.map(QPointF(points[0], points[1])); coords.append(temp.x()); @@ -840,7 +790,7 @@ VGPath QVGPaintEnginePrivate::painterPathToVGPath(const QPainterPath& path) bool haveStart = false; bool haveEnd = false; - if (affineTransform) { + if (simpleTransform) { // Convert the members of the element array. for (int i = 0; i < count; ++i) { switch (elements[i].type) { @@ -1615,6 +1565,36 @@ void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen) vgDestroyPath(vgpath); } +// Determine if a co-ordinate transform is simple enough to allow +// rectangle-based clipping with vgMask(). Simple transforms most +// often result from origin translations. +static inline bool clipTransformIsSimple(const QTransform& transform) +{ + QTransform::TransformationType type = transform.type(); + if (type == QTransform::TxNone || type == QTransform::TxTranslate) + return true; + if (type == QTransform::TxRotate) { + // Check for 0, 90, 180, and 270 degree rotations. + // (0 might happen after 4 rotations of 90 degrees). + qreal m11 = transform.m11(); + qreal m12 = transform.m12(); + qreal m21 = transform.m21(); + qreal m22 = transform.m22(); + if (m11 == 0.0f && m22 == 0.0f) { + if (m12 == 1.0f && m21 == -1.0f) + return true; // 90 degrees. + else if (m12 == -1.0f && m21 == 1.0f) + return true; // 270 degrees. + } else if (m12 == 0.0f && m21 == 0.0f) { + if (m11 == -1.0f && m22 == -1.0f) + return true; // 180 degrees. + else if (m11 == 1.0f && m22 == 1.0f) + return true; // 0 degrees. + } + } + return false; +} + #if defined(QVG_SCISSOR_CLIP) void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) @@ -1632,7 +1612,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) // We aren't using masking, so handle simple QRectF's only. if (path.shape() == QVectorPath::RectangleHint && - path.elementCount() == 4 && d->simpleTransform) { + path.elementCount() == 4 && clipTransformIsSimple(d->transform)) { // Clipping region that resulted from QPainter::setClipRect(QRectF). // Convert it into a QRect and apply. const qreal *points = path.points(); @@ -1782,7 +1762,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) // We don't have vgRenderToMask(), so handle simple QRectF's only. if (path.shape() == QVectorPath::RectangleHint && - path.elementCount() == 4 && d->simpleTransform) { + path.elementCount() == 4 && clipTransformIsSimple(d->transform)) { // Clipping region that resulted from QPainter::setClipRect(QRectF). // Convert it into a QRect and apply. const qreal *points = path.points(); @@ -1834,7 +1814,7 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) d->dirty |= QPaintEngine::DirtyClipRegion; // If we have a non-simple transform, then use path-based clipping. - if (op != Qt::NoClip && !d->simpleTransform) { + if (op != Qt::NoClip && !clipTransformIsSimple(d->transform)) { QPaintEngineEx::clip(rect, op); return; } @@ -1953,7 +1933,7 @@ void QVGPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) d->dirty |= QPaintEngine::DirtyClipRegion; // If we have a non-simple transform, then use path-based clipping. - if (op != Qt::NoClip && !d->simpleTransform) { + if (op != Qt::NoClip && !clipTransformIsSimple(d->transform)) { QPaintEngineEx::clip(region, op); return; } @@ -2530,14 +2510,14 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) // Check to see if we can use vgClear() for faster filling. if (brush.style() == Qt::SolidPattern && brush.isOpaque() && - d->simpleTransform && d->opacity == 1.0f && + clipTransformIsSimple(d->transform) && d->opacity == 1.0f && clearRect(rect, brush.color())) { return; } #if !defined(QVG_NO_MODIFY_PATH) VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rect.x(); coords[1] = rect.y(); coords[2] = rect.x() + rect.width(); @@ -2572,14 +2552,14 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QColor &color) Q_D(QVGPaintEngine); // Check to see if we can use vgClear() for faster filling. - if (d->simpleTransform && d->opacity == 1.0f && color.alpha() == 255 && + if (clipTransformIsSimple(d->transform) && d->opacity == 1.0f && color.alpha() == 255 && clearRect(rect, color)) { return; } #if !defined(QVG_NO_MODIFY_PATH) VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rect.x(); coords[1] = rect.y(); coords[2] = rect.x() + rect.width(); @@ -2612,7 +2592,7 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QColor &color) void QVGPaintEngine::drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode) { Q_D(QVGPaintEngine); - if (d->affineTransform) { + if (d->simpleTransform) { QVGPainterState *s = state(); VGPath vgpath = d->roundedRectPath(rect, xrad, yrad, mode); d->draw(vgpath, s->pen, s->brush); @@ -2631,7 +2611,7 @@ void QVGPaintEngine::drawRects(const QRect *rects, int rectCount) QVGPainterState *s = state(); for (int i = 0; i < rectCount; ++i, ++rects) { VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rects->x(); coords[1] = rects->y(); coords[2] = rects->x() + rects->width(); @@ -2672,7 +2652,7 @@ void QVGPaintEngine::drawRects(const QRectF *rects, int rectCount) QVGPainterState *s = state(); for (int i = 0; i < rectCount; ++i, ++rects) { VGfloat coords[8]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = rects->x(); coords[1] = rects->y(); coords[2] = rects->x() + rects->width(); @@ -2710,7 +2690,7 @@ void QVGPaintEngine::drawLines(const QLine *lines, int lineCount) QVGPainterState *s = state(); for (int i = 0; i < lineCount; ++i, ++lines) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = lines->x1(); coords[1] = lines->y1(); coords[2] = lines->x2(); @@ -2738,7 +2718,7 @@ void QVGPaintEngine::drawLines(const QLineF *lines, int lineCount) QVGPainterState *s = state(); for (int i = 0; i < lineCount; ++i, ++lines) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = lines->x1(); coords[1] = lines->y1(); coords[2] = lines->x2(); @@ -2764,7 +2744,7 @@ void QVGPaintEngine::drawEllipse(const QRectF &r) // Based on the description of vguEllipse() in the OpenVG specification. // We don't use vguEllipse(), to avoid unnecessary library dependencies. Q_D(QVGPaintEngine); - if (d->affineTransform) { + if (d->simpleTransform) { QVGPainterState *s = state(); VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, @@ -2837,7 +2817,7 @@ void QVGPaintEngine::drawPoints(const QPointF *points, int pointCount) for (int i = 0; i < pointCount; ++i, ++points) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = points->x(); coords[1] = points->y(); coords[2] = coords[0]; @@ -2871,7 +2851,7 @@ void QVGPaintEngine::drawPoints(const QPoint *points, int pointCount) for (int i = 0; i < pointCount; ++i, ++points) { VGfloat coords[4]; - if (d->affineTransform) { + if (d->simpleTransform) { coords[0] = points->x(); coords[1] = points->y(); coords[2] = coords[0]; @@ -2905,7 +2885,7 @@ void QVGPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonD QVarLengthArray coords; QVarLengthArray segments; for (int i = 0; i < pointCount; ++i, ++points) { - if (d->affineTransform) { + if (d->simpleTransform) { coords.append(points->x()); coords.append(points->y()); } else { @@ -2952,7 +2932,7 @@ void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDr QVarLengthArray coords; QVarLengthArray segments; for (int i = 0; i < pointCount; ++i, ++points) { - if (d->affineTransform) { + if (d->simpleTransform) { coords.append(points->x()); coords.append(points->y()); } else { @@ -2987,7 +2967,7 @@ void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDr void QVGPaintEnginePrivate::setImageOptions() { - if (opacity != 1.0f && affineTransform) { + if (opacity != 1.0f && simpleTransform) { if (opacity != paintOpacity) { VGfloat values[4]; values[0] = 1.0f; @@ -3034,10 +3014,7 @@ static void drawVGImage(QVGPaintEnginePrivate *d, QTransform transform(d->imageTransform); VGfloat scaleX = sr.width() == 0.0f ? 0.0f : r.width() / sr.width(); VGfloat scaleY = sr.height() == 0.0f ? 0.0f : r.height() / sr.height(); - if (d->simpleTransform) - transform.translate(qRound(r.x()), qRound(r.y())); - else - transform.translate(r.x(), r.y()); + transform.translate(r.x(), r.y()); transform.scale(scaleX, scaleY); d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform); @@ -3055,10 +3032,7 @@ static void drawVGImage(QVGPaintEnginePrivate *d, return; QTransform transform(d->imageTransform); - if(d->simpleTransform) - transform.translate(qRound(pos.x()), qRound(pos.y())); - else - transform.translate(pos.x(), pos.y()); + transform.translate(pos.x(), pos.y()); d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform); d->setImageOptions(); @@ -3101,7 +3075,7 @@ void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF QVGPixmapData *vgpd = static_cast(pd); if (!vgpd->isValid()) return; - if (d->affineTransform) + if (d->simpleTransform) drawVGImage(d, r, vgpd->toVGImage(), vgpd->size(), sr); else drawVGImage(d, r, vgpd->toVGImage(d->opacity), vgpd->size(), sr); @@ -3120,7 +3094,7 @@ void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) QVGPixmapData *vgpd = static_cast(pd); if (!vgpd->isValid()) return; - if (d->affineTransform) + if (d->simpleTransform) drawVGImage(d, pos, vgpd->toVGImage()); else drawVGImage(d, pos, vgpd->toVGImage(d->opacity)); @@ -3135,7 +3109,7 @@ void QVGPaintEngine::drawImage { Q_D(QVGPaintEngine); VGImage vgImg; - if (d->affineTransform || d->opacity == 1.0f) + if (d->simpleTransform || d->opacity == 1.0f) vgImg = toVGImageSubRect(image, sr.toRect(), flags); else vgImg = toVGImageWithOpacitySubRect(image, d->opacity, sr.toRect()); @@ -3158,7 +3132,7 @@ void QVGPaintEngine::drawImage(const QPointF &pos, const QImage &image) { Q_D(QVGPaintEngine); VGImage vgImg; - if (d->affineTransform || d->opacity == 1.0f) + if (d->simpleTransform || d->opacity == 1.0f) vgImg = toVGImage(image); else vgImg = toVGImageWithOpacity(image, d->opacity); @@ -3191,7 +3165,7 @@ void QVGPaintEngine::drawPixmapFragments(const QPainter::PixmapFragment *drawing QPixmapData *pd = pixmap.pixmapData(); if (!pd) return; // null QPixmap - if (pd->classId() != QPixmapData::OpenVGClass || !d->affineTransform) { + if (pd->classId() != QPixmapData::OpenVGClass || !d->simpleTransform) { QPaintEngineEx::drawPixmapFragments(drawingData, dataCount, pixmap, hints); return; } @@ -3416,7 +3390,7 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) // If we are not using a simple transform, then fall back // to the default Qt path stroking algorithm. - if (!d->affineTransform) { + if (!d->simpleTransform) { QPaintEngineEx::drawTextItem(p, textItem); return; } -- cgit v0.12 From 2ab99337faa0ec03721fb39cae52361f7ac4d780 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 4 Oct 2010 22:34:49 +0300 Subject: Fix gcc compilation problems in QtOpenGL. Actually was typo and for some reason rvct didn't catch that. Reviewed-by: TRUSTME --- src/opengl/gl2paintengineex/qtriangulator.cpp | 4 ++-- tests/auto/qglthreads/tst_qglthreads.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index ea072b4..bf21240 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -2025,7 +2025,7 @@ void QTriangulator::ComplexToSimple::fillPriorityQueue() 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(qint32)(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); + 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)) { QPodPoint upper = m_parent->m_vertices.at(m_edges.at(i).upper()); @@ -2214,7 +2214,7 @@ void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() 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(qint32)(m_edges.at(current->data).to))); + 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); diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp index cce3161..06131bd 100644 --- a/tests/auto/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/qglthreads/tst_qglthreads.cpp @@ -49,6 +49,10 @@ #include #endif +#ifdef Q_OS_SYMBIAN +#include // for usleep +#endif + #define RUNNING_TIME 5000 tst_QGLThreads::tst_QGLThreads(QObject *parent) @@ -209,6 +213,7 @@ public: p.drawText(image.rect(), Qt::AlignCenter, "This is an autotest"); p.end(); m_gl->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); + createdAndUploaded(image); } } -- cgit v0.12 From 5c30b5babfd1ed408a0c44dcaad2f1444acc4892 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 5 Oct 2010 08:31:26 +1000 Subject: Add missing license header. --- .../graphicsitems/qdeclarativetextlayout.cpp | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index ca2963b..e8b5fb2 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -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 QtDeclarative 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 "qdeclarativetextlayout_p.h" #include #include -- cgit v0.12 From 47284ca360c1875663207996740bf6ed6e93d364 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 5 Oct 2010 15:34:59 +1000 Subject: Document and test paintedWidth and paintedHeight properties of Image Task-number: QTBUG-14197 --- .../graphicsitems/qdeclarativeimage.cpp | 9 +++++ .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 41 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index 9cd9ad6..08d237f 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -253,6 +253,15 @@ void QDeclarativeImage::setFillMode(FillMode mode) emit fillModeChanged(); } +/*! + + \qmlproperty real Image::paintedWidth + \qmlproperty real Image::paintedHeight + + These properties hold the size of the image that is actually painted. + In most cases it is the same as \c width and \c height, but when using a \c fillMode like + \c PreserveAspectFit \c paintedWidth or \c paintedHeight can be smaller than \c width and \c height. +*/ qreal QDeclarativeImage::paintedWidth() const { Q_D(const QDeclarativeImage); diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 6fce2ad..8f9b2ea 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -83,6 +83,7 @@ private slots: void big(); void tiling_QTBUG_6716(); void noLoading(); + void paintedWidthHeight(); private: template @@ -395,6 +396,46 @@ void tst_qdeclarativeimage::noLoading() QTRY_COMPARE(statusSpy.count(), 2); } +void tst_qdeclarativeimage::paintedWidthHeight() +{ + { + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString(); + QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 200; height: 25; fillMode: Image.PreserveAspectFit }"; + + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->pixmap().width(), 300); + QCOMPARE(obj->pixmap().height(), 300); + QCOMPARE(obj->width(), 200.0); + QCOMPARE(obj->height(), 25.0); + QCOMPARE(obj->paintedWidth(), 25.0); + QCOMPARE(obj->paintedHeight(), 25.0); + QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png")); + + delete obj; + } + + { + QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString(); + QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }"; + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast(component.create()); + QVERIFY(obj != 0); + QCOMPARE(obj->pixmap().width(), 300); + QCOMPARE(obj->pixmap().height(), 300); + QCOMPARE(obj->width(), 26.0); + QCOMPARE(obj->height(), 175.0); + QCOMPARE(obj->paintedWidth(), 26.0); + QCOMPARE(obj->paintedHeight(), 26.0); + QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png")); + + delete obj; + } +} + /* Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index -- cgit v0.12 From a891f20bc370c24777e22be40499e695f97738f9 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 4 Oct 2010 17:16:36 +0200 Subject: Fix performance regression in QUuid::createUuid() After commit 4363d4eebce4afd2ce3b3d6da205f8037357099a, createUuid() would create a QFile, open it, read from it, and destroy it. This resulted in a pretty serious performance regression (report says around 2000 times slower, I measured 3600 times slower on my machine). This change creates one QFile per thread (since QFile is not thread safe) and leaves the file open until the thread exits (at which point QThreadStorage deletes the QFile). This approach is around 600 times faster than the current code, which is around 6 times slower than the original. Unfortunately, it is not possible to restore the original performance without reintroducing the problems that the commit mentioned above had fixed. Benchmark is included. Task-number: QTBUG-13877 Reviewed-by: thiago Reviewed-by: mgoetz --- src/corelib/plugin/quuid.cpp | 67 ++++++++++++++-------- tests/benchmarks/corelib/corelib.pro | 3 +- tests/benchmarks/corelib/plugin/plugin.pro | 2 + tests/benchmarks/corelib/plugin/quuid/quuid.pro | 6 ++ .../benchmarks/corelib/plugin/quuid/tst_quuid.cpp | 66 +++++++++++++++++++++ 5 files changed, 118 insertions(+), 26 deletions(-) create mode 100644 tests/benchmarks/corelib/plugin/plugin.pro create mode 100644 tests/benchmarks/corelib/plugin/quuid/quuid.pro create mode 100644 tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 6c1b6e7..983d249 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -582,48 +582,65 @@ QT_BEGIN_INCLUDE_NAMESPACE #include // for RAND_MAX QT_END_INCLUDE_NAMESPACE +#if !defined(QT_BOOTSTRAPPED) && defined(Q_OS_UNIX) +Q_GLOBAL_STATIC(QThreadStorage, devUrandomStorage); +#endif + QUuid QUuid::createUuid() { QUuid result; uint *data = &(result.data1); -#ifdef Q_OS_UNIX - QFile devUrandom; - devUrandom.setFileName(QLatin1String("/dev/urandom")); - if (devUrandom.open(QIODevice::ReadOnly)) { - qint64 numToRead = 4 * sizeof(uint); - devUrandom.read((char *) data, numToRead); // should read 128-bits of data +#if defined(Q_OS_UNIX) + QFile *devUrandom; +# if !defined(QT_BOOTSTRAPPED) + devUrandom = devUrandomStorage()->localData(); + if (!devUrandom) { + devUrandom = new QFile(QLatin1String("/dev/urandom")); + devUrandom->open(QIODevice::ReadOnly | QIODevice::Unbuffered); + devUrandomStorage()->setLocalData(devUrandom); + } +# else + QFile file(QLatin1String("/dev/urandom")); + devUrandom = &file; + devUrandom->open(QIODevice::ReadOnly | QIODevice::Unbuffered); +# endif + enum { AmountToRead = 4 * sizeof(uint) }; + if (devUrandom->isOpen() + && devUrandom->read((char *) data, AmountToRead) == AmountToRead) { + // we got what we wanted, nothing more to do + ; } else #endif { static const int intbits = sizeof(int)*8; static int randbits = 0; if (!randbits) { - int r = 0; + int r = 0; int max = RAND_MAX; do { ++r; } while ((max=max>>1)); randbits = r; } - // Seed the PRNG once per thread with a combination of current time, a - // stack address and a serial counter (since thread stack addresses are - // re-used). + // Seed the PRNG once per thread with a combination of current time, a + // stack address and a serial counter (since thread stack addresses are + // re-used). #ifndef QT_BOOTSTRAPPED - static QThreadStorage uuidseed; - if (!uuidseed.hasLocalData()) - { - int *pseed = new int; - static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); - qsrand(*pseed = QDateTime::currentDateTime().toTime_t() - + quintptr(&pseed) - + serial.fetchAndAddRelaxed(1)); - uuidseed.setLocalData(pseed); - } + static QThreadStorage uuidseed; + if (!uuidseed.hasLocalData()) + { + int *pseed = new int; + static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2); + qsrand(*pseed = QDateTime::currentDateTime().toTime_t() + + quintptr(&pseed) + + serial.fetchAndAddRelaxed(1)); + uuidseed.setLocalData(pseed); + } #else - static bool seeded = false; - if (!seeded) - qsrand(QDateTime::currentDateTime().toTime_t() - + quintptr(&seeded)); + static bool seeded = false; + if (!seeded) + qsrand(QDateTime::currentDateTime().toTime_t() + + quintptr(&seeded)); #endif int chunks = 16 / sizeof(uint); @@ -631,7 +648,7 @@ QUuid QUuid::createUuid() uint randNumber = 0; for (int filled = 0; filled < intbits; filled += randbits) randNumber |= qrand()< +#include +#include + +class tst_bench_QUuid : public QObject +{ + Q_OBJECT + +public: + tst_bench_QUuid() + { } + +private slots: + void createUuid(); +}; + +void tst_bench_QUuid::createUuid() +{ + QBENCHMARK { + QUuid::createUuid(); + } +} + +QTEST_MAIN(tst_bench_QUuid); +#include "tst_quuid.moc" -- cgit v0.12 From 68f4fa74312241b70604127405bec90aba49c186 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 5 Oct 2010 11:23:13 +0300 Subject: Quick fix for OSX and Windows/Mingw compilation errors. On OSX AssertMacros.h header has macro called verify() and QRBTree::verify() function was substituted by this macro. On Windows/Mingw includes need to point to exported private include folder. Reviewed-by: Kim --- 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 bf21240..b839b00 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -57,8 +57,8 @@ #include -#include "qgl_p.h" -#include "qglextensions_p.h" +#include +#include QT_BEGIN_NAMESPACE @@ -625,7 +625,7 @@ struct QRBTree // 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; + inline bool validate() const; private: void rotateLeft(Node *node); @@ -1038,7 +1038,7 @@ bool QRBTree::checkRedBlackProperty(Node *top) const } template -inline bool QRBTree::verify() const +inline bool QRBTree::validate() const { return checkRedBlackProperty(root) && blackDepth(root) != -1; } @@ -2854,7 +2854,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() m_edges.at(j).node = node; m_edges.at(j).helper = i; m_edgeList.attachAfter(leftEdgeNode, node); - Q_ASSERT(m_edgeList.verify()); + Q_ASSERT(m_edgeList.validate()); } else { leftEdgeNode = searchEdgeLeftOfEdge(i); QRBTree::Node *node = m_edgeList.newNode(); @@ -2862,7 +2862,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() m_edges.at(i).node = node; m_edges.at(i).helper = i; m_edgeList.attachAfter(leftEdgeNode, node); - Q_ASSERT(m_edgeList.verify()); + Q_ASSERT(m_edgeList.validate()); } break; case MergeVertex: @@ -2881,7 +2881,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() 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()); + Q_ASSERT(m_edgeList.validate()); } else { qWarning("Inconsistent polygon. (#5)"); } @@ -2890,7 +2890,7 @@ void QTriangulator::SimpleToMonotone::monotoneDecomposition() 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()); + Q_ASSERT(m_edgeList.validate()); } else { qWarning("Inconsistent polygon. (#6)"); } -- cgit v0.12 From 17e1f24b84ea4cbfab53cbd8d66963f744eb1d66 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 5 Oct 2010 10:58:50 +0200 Subject: Work around OpenGL driver reading arrays asyncronously Some drivers, e.g. the Nvidia driver on Windows, will sometimes read the coordinate arrays asyncronously, which causes a crash if they are allocated on the stack. Reviewed-by: Kim --- .../gl2paintengineex/qtextureglyphcache_gl.cpp | 46 +++++++++++----------- .../gl2paintengineex/qtextureglyphcache_gl_p.h | 3 ++ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 3f10454..9a15260 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -64,6 +64,24 @@ QGLTextureGlyphCache::QGLTextureGlyphCache(const QGLContext *context, QFontEngin qDebug(" -> QGLTextureGlyphCache() %p for context %p.", this, ctx); #endif setContext(context); + + m_vertexCoordinateArray[0] = -1.0f; + m_vertexCoordinateArray[1] = -1.0f; + m_vertexCoordinateArray[2] = 1.0f; + m_vertexCoordinateArray[3] = -1.0f; + m_vertexCoordinateArray[4] = 1.0f; + m_vertexCoordinateArray[5] = 1.0f; + m_vertexCoordinateArray[6] = -1.0f; + m_vertexCoordinateArray[7] = 1.0f; + + m_textureCoordinateArray[0] = 0.0f; + m_textureCoordinateArray[1] = 0.0f; + m_textureCoordinateArray[2] = 1.0f; + m_textureCoordinateArray[3] = 0.0f; + m_textureCoordinateArray[4] = 1.0f; + m_textureCoordinateArray[5] = 1.0f; + m_textureCoordinateArray[6] = 0.0f; + m_textureCoordinateArray[7] = 1.0f; } QGLTextureGlyphCache::~QGLTextureGlyphCache() @@ -183,26 +201,6 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) glViewport(0, 0, oldWidth, oldHeight); - GLfloat vertexCoordinateArray[8]; - vertexCoordinateArray[0] = -1.0f; - vertexCoordinateArray[1] = -1.0f; - vertexCoordinateArray[2] = 1.0f; - vertexCoordinateArray[3] = -1.0f; - vertexCoordinateArray[4] = 1.0f; - vertexCoordinateArray[5] = 1.0f; - vertexCoordinateArray[6] = -1.0f; - vertexCoordinateArray[7] = 1.0f; - - GLfloat textureCoordinateArray[8]; - textureCoordinateArray[0] = 0.0f; - textureCoordinateArray[1] = 0.0f; - textureCoordinateArray[2] = 1.0f; - textureCoordinateArray[3] = 0.0f; - textureCoordinateArray[4] = 1.0f; - textureCoordinateArray[5] = 1.0f; - textureCoordinateArray[6] = 0.0f; - textureCoordinateArray[7] = 1.0f; - QGLShaderProgram *blitProgram = 0; if (pex == 0) { if (m_blitProgram == 0) { @@ -236,8 +234,8 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) m_blitProgram->link(); } - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray); - glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray); + glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, m_vertexCoordinateArray); + glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, m_textureCoordinateArray); m_blitProgram->bind(); QGLContextPrivate* ctx_d = const_cast(ctx->d_func()); @@ -247,8 +245,8 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) blitProgram = m_blitProgram; } else { - pex->setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, vertexCoordinateArray); - pex->setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, textureCoordinateArray); + pex->setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, m_vertexCoordinateArray); + pex->setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, m_textureCoordinateArray); pex->shaderManager->useBlitProgram(); blitProgram = pex->shaderManager->blitProgram(); diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index 7e2c625..f75cf68 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -147,6 +147,9 @@ private: QGL2PaintEngineExPrivate *pex; QGLShaderProgram *m_blitProgram; FilterMode m_filterMode; + + GLfloat m_vertexCoordinateArray[8]; + GLfloat m_textureCoordinateArray[8]; }; QT_END_NAMESPACE -- cgit v0.12 From faba550d704312a29d9485bcaaa506331f102301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 29 Sep 2010 13:13:27 +0200 Subject: Fixed arm X11 build. Without we get error: invalid conversion from 'const void*' to 'void*' Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/qatomic_arm.h b/src/corelib/arch/qatomic_arm.h index 9df02a2..bca3375 100644 --- a/src/corelib/arch/qatomic_arm.h +++ b/src/corelib/arch/qatomic_arm.h @@ -107,7 +107,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() // kernel places a restartable cmpxchg implementation at a fixed address extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr); -extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval, volatile void *ptr); +extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, const void *newval, volatile void *ptr); #define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast(0xffff0fc0)) #define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast(0xffff0fc0)) -- cgit v0.12 From 8ed3d9e33de7b4ee93b007ebde16ce42885ba95c Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 5 Oct 2010 12:06:10 +0200 Subject: QtScript/JavaScriptCore: Backport random number generator seeding fix Backported changes: || || JavaScriptCore/wtf/RandomNumber.h should provide using WTF::* || || || Don't seed the JS random number generator from time() || Task-number: QTBUG-13440 Reviewed-by: Simon Hausmann --- .../javascriptcore/JavaScriptCore/ChangeLog | 31 ++++++++++++++++++++++ .../JavaScriptCore/runtime/JSGlobalData.cpp | 1 - .../JavaScriptCore/runtime/JSGlobalData.h | 2 -- .../JavaScriptCore/runtime/JSGlobalObject.h | 4 +++ .../JavaScriptCore/runtime/MathObject.cpp | 2 +- .../JavaScriptCore/wtf/RandomNumber.h | 3 +++ src/3rdparty/javascriptcore/VERSION | 4 +-- 7 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index fbaf5d2..fd6c3f7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,24 @@ +2010-08-24 Oliver Hunt + + Reviewed by Geoff Garen. + + Don't seed the JS random number generator from time() + https://bugs.webkit.org/show_bug.cgi?id=41868 + + + Switch to using the secure random number generator to + seed the fast random generator, and make the generator + be per global object. + + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::JSGlobalData): + * runtime/JSGlobalData.h: + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + (JSC::JSGlobalObject::weakRandomNumber): + * runtime/MathObject.cpp: + (JSC::mathProtoFuncRandom): + 2010-06-18 Tucker Jay Reviewed by NOBODY (OOPS!). @@ -94,6 +115,16 @@ * wtf/Platform.h: +2010-05-06 Fumitoshi Ukai + + Reviewed by Alexey Proskuryakov. + + JavaScriptCore/wtf/RandomNumber.h should provide using WTF::* + https://bugs.webkit.org/show_bug.cgi?id=38719 + + * wtf/RandomNumber.h: + Add using directives. + 2010-04-28 Simon Hausmann , Kent Hansen Reviewed by Darin Adler. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp index 34b5f82..1c25c16 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp @@ -144,7 +144,6 @@ JSGlobalData::JSGlobalData(bool isShared) , firstStringifierToMark(0) , markStack(jsArrayVPtr) , cachedUTCOffset(NaN) - , weakRandom(static_cast(currentTime())) #ifndef NDEBUG , mainThreadOnly(false) #endif diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h index 49a6c4c..dcd3289 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h @@ -184,8 +184,6 @@ namespace JSC { UString cachedDateString; double cachedDateStringValue; - - WeakRandom weakRandom; #ifndef NDEBUG bool mainThreadOnly; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h index 340e04d..7c20272 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h @@ -31,6 +31,7 @@ #include "StructureChain.h" #include #include +#include namespace JSC { @@ -91,6 +92,7 @@ namespace JSC { , datePrototype(0) , regExpPrototype(0) , methodCallDummy(0) + , weakRandom(static_cast(randomNumber() * (std::numeric_limits::max() + 1.0))) { } @@ -154,6 +156,7 @@ namespace JSC { RefPtr globalData; HashSet codeBlocks; + WeakRandom weakRandom; }; public: @@ -271,6 +274,7 @@ namespace JSC { return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags)); } + double weakRandomNumber() { return d()->weakRandom.get(); } protected: static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesMarkChildren | OverridesGetPropertyNames | JSVariableObject::StructureFlags; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp index 8f22fba..807cfe7 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp @@ -210,7 +210,7 @@ JSValue JSC_HOST_CALL mathProtoFuncPow(ExecState* exec, JSObject*, JSValue, cons JSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState* exec, JSObject*, JSValue, const ArgList&) { - return jsDoubleNumber(exec, exec->globalData().weakRandom.get()); + return jsDoubleNumber(exec, exec->lexicalGlobalObject()->weakRandomNumber()); } JSValue JSC_HOST_CALL mathProtoFuncRound(ExecState* exec, JSObject*, JSValue, const ArgList& args) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h index fe1687c..e54e9ae 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RandomNumber.h @@ -39,4 +39,7 @@ namespace WTF { } +using WTF::randomNumber; +using WTF::weakRandomNumber; + #endif diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index 6f5fb7c..9991ac0 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - javascriptcore-snapshot-28062010 branch/tag + javascriptcore-snapshot-05102010 branch/tag and has the sha1 checksum - 0fccd26d3624e80cf68873701ef70ad72ca66bec + 82ead85cfea5859044eeb25b33314dcc0fa5eea1 -- cgit v0.12 From 5e2796c35fb829aae3e9870ac1d738a296b08a6e Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 28 Jul 2010 10:36:33 +0200 Subject: QNAM: New specialized QNetworkReply for data: URLs Implement a QNetworkReplyDataImpl for data: URLs. This avoids having the overhead of a special backend class of QNetworkReplyImpl. Also move the instantiation to the begin of QNAM::createRequest() so no network sesssion is needed. Reviewed-by: Thiago Macieira Reviewed-by: Peter Hartmann --- src/network/access/access.pri | 2 + src/network/access/qnetworkaccessmanager.cpp | 6 ++ src/network/access/qnetworkreplydataimpl.cpp | 146 +++++++++++++++++++++++++++ src/network/access/qnetworkreplydataimpl_p.h | 98 ++++++++++++++++++ 4 files changed, 252 insertions(+) create mode 100644 src/network/access/qnetworkreplydataimpl.cpp create mode 100644 src/network/access/qnetworkreplydataimpl_p.h diff --git a/src/network/access/access.pri b/src/network/access/access.pri index e255a0d..9cd2096 100644 --- a/src/network/access/access.pri +++ b/src/network/access/access.pri @@ -27,6 +27,7 @@ HEADERS += \ access/qnetworkreply.h \ access/qnetworkreply_p.h \ access/qnetworkreplyimpl_p.h \ + access/qnetworkreplydataimpl_p.h \ access/qnetworkreplyfileimpl_p.h \ access/qabstractnetworkcache_p.h \ access/qabstractnetworkcache.h \ @@ -55,6 +56,7 @@ SOURCES += \ access/qnetworkrequest.cpp \ access/qnetworkreply.cpp \ access/qnetworkreplyimpl.cpp \ + access/qnetworkreplydataimpl.cpp \ access/qnetworkreplyfileimpl.cpp \ access/qabstractnetworkcache.cpp \ access/qnetworkdiskcache.cpp diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 9738a4f..add75bf 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -54,6 +54,7 @@ #include "qnetworkaccessfilebackend_p.h" #include "qnetworkaccessdatabackend_p.h" #include "qnetworkaccessdebugpipebackend_p.h" +#include "qnetworkreplydataimpl_p.h" #include "qnetworkreplyfileimpl_p.h" #include "QtCore/qbuffer.h" @@ -955,6 +956,11 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera return new QNetworkReplyFileImpl(this, req, op); } + if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation) + && req.url().scheme().toLower() == QLatin1String("data")) { + return new QNetworkReplyDataImpl(this, req, op); + } + #ifndef QT_NO_BEARERMANAGEMENT // Return a disabled network reply if network access is disabled. // Except if the scheme is empty or file://. diff --git a/src/network/access/qnetworkreplydataimpl.cpp b/src/network/access/qnetworkreplydataimpl.cpp new file mode 100644 index 0000000..9e74a21 --- /dev/null +++ b/src/network/access/qnetworkreplydataimpl.cpp @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** 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 QtNetwork 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 "qnetworkreplydataimpl_p.h" +#include "private/qdataurl_p.h" + +QT_BEGIN_NAMESPACE + +QNetworkReplyDataImplPrivate::QNetworkReplyDataImplPrivate() + : QNetworkReplyPrivate() +{ +} + +QNetworkReplyDataImplPrivate::~QNetworkReplyDataImplPrivate() +{ +} + +QNetworkReplyDataImpl::~QNetworkReplyDataImpl() +{ +} + +QNetworkReplyDataImpl::QNetworkReplyDataImpl(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op) + : QNetworkReply(*new QNetworkReplyDataImplPrivate(), parent) +{ + Q_D(QNetworkReplyDataImpl); + setRequest(req); + setUrl(req.url()); + setOperation(op); + setFinished(true); + QNetworkReply::open(QIODevice::ReadOnly); + + QUrl url = req.url(); + + // FIXME qDecodeDataUrl should instead be rewritten to have the QByteArray + // and the mime type as an output parameter and return a bool instead + d->decodeDataUrlResult = qDecodeDataUrl(url); + + if (! d->decodeDataUrlResult.first.isNull()) { + QString &mimeType = d->decodeDataUrlResult.first; + qint64 size = d->decodeDataUrlResult.second.size(); + setHeader(QNetworkRequest::ContentTypeHeader, mimeType); + setHeader(QNetworkRequest::ContentLengthHeader, size); + QMetaObject::invokeMethod(this, "metaDataChanged", Qt::QueuedConnection); + + d->decodedData.setBuffer(&d->decodeDataUrlResult.second); + d->decodedData.open(QIODevice::ReadOnly); + + QMetaObject::invokeMethod(this, "downloadProgress", Qt::QueuedConnection, + Q_ARG(qint64,size), Q_ARG(qint64, size)); + QMetaObject::invokeMethod(this, "readyRead", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection); + } else { + // something wrong with this URI + const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", + "Invalid URI: %1").arg(url.toString()); + setError(QNetworkReply::ProtocolFailure, msg); + QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, + Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProtocolFailure)); + QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection); + } +} + +void QNetworkReplyDataImpl::close() +{ + QNetworkReply::close(); +} + +void QNetworkReplyDataImpl::abort() +{ + QNetworkReply::close(); +} + +qint64 QNetworkReplyDataImpl::bytesAvailable() const +{ + Q_D(const QNetworkReplyDataImpl); + return QNetworkReply::bytesAvailable() + d->decodedData.bytesAvailable(); +} + +bool QNetworkReplyDataImpl::isSequential () const +{ + return true; +} + +qint64 QNetworkReplyDataImpl::size() const +{ + Q_D(const QNetworkReplyDataImpl); + return d->decodedData.size(); +} + +/*! + \internal +*/ +qint64 QNetworkReplyDataImpl::readData(char *data, qint64 maxlen) +{ + Q_D(QNetworkReplyDataImpl); + + // TODO idea: + // Instead of decoding the whole data into new memory, we could decode on demand. + // Note that this might be tricky to do. + + return d->decodedData.read(data, maxlen); +} + + +QT_END_NAMESPACE + +#include "moc_qnetworkreplydataimpl_p.cpp" + diff --git a/src/network/access/qnetworkreplydataimpl_p.h b/src/network/access/qnetworkreplydataimpl_p.h new file mode 100644 index 0000000..6c62d28 --- /dev/null +++ b/src/network/access/qnetworkreplydataimpl_p.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** 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 QtNetwork 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 QNETWORKREPLYDATAIMPL_H +#define QNETWORKREPLYDATAIMPL_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of the Network Access API. This header file may change from +// version to version without notice, or even be removed. +// +// We mean it. +// + +#include "qnetworkreply.h" +#include "qnetworkreply_p.h" +#include "qnetworkaccessmanager.h" +#include + +QT_BEGIN_NAMESPACE + + +class QNetworkReplyDataImplPrivate; +class QNetworkReplyDataImpl: public QNetworkReply +{ + Q_OBJECT +public: + QNetworkReplyDataImpl(QObject *parent, const QNetworkRequest &req, const QNetworkAccessManager::Operation op); + ~QNetworkReplyDataImpl(); + virtual void abort(); + + // reimplemented from QNetworkReply + virtual void close(); + virtual qint64 bytesAvailable() const; + virtual bool isSequential () const; + qint64 size() const; + + virtual qint64 readData(char *data, qint64 maxlen); + + Q_DECLARE_PRIVATE(QNetworkReplyDataImpl) +}; + +class QNetworkReplyDataImplPrivate: public QNetworkReplyPrivate +{ +public: + QNetworkReplyDataImplPrivate(); + ~QNetworkReplyDataImplPrivate(); + + QPair decodeDataUrlResult; + QBuffer decodedData; + + Q_DECLARE_PUBLIC(QNetworkReplyDataImpl) +}; + +QT_END_NAMESPACE + +#endif // QNETWORKREPLYDATAIMPL_H -- cgit v0.12 From edcec6164cb96a1e26586025e7c72532a9220a38 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 5 Oct 2010 13:29:12 +0200 Subject: QNAM: Fix usage of toString of QUrl Reviewed-by: Thiago Macieira --- src/network/access/qnetworkreplydataimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qnetworkreplydataimpl.cpp b/src/network/access/qnetworkreplydataimpl.cpp index 9e74a21..36f9356 100644 --- a/src/network/access/qnetworkreplydataimpl.cpp +++ b/src/network/access/qnetworkreplydataimpl.cpp @@ -90,7 +90,7 @@ QNetworkReplyDataImpl::QNetworkReplyDataImpl(QObject *parent, const QNetworkRequ } else { // something wrong with this URI const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", - "Invalid URI: %1").arg(url.toString()); + "Invalid URI: %1").arg(QString::fromLatin1(url.toEncoded())); setError(QNetworkReply::ProtocolFailure, msg); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QNetworkReply::NetworkError, QNetworkReply::ProtocolFailure)); -- cgit v0.12 From dda652beae0de6931071be599f7ee4020a81a499 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 5 Oct 2010 13:33:23 +0200 Subject: QNAM: Remove QNetworkAccessDataBackend The QNetworkReplyDataImpl is now used instead. --- src/network/access/access.pri | 2 - src/network/access/qnetworkaccessdatabackend.cpp | 125 ----------------------- src/network/access/qnetworkaccessmanager.cpp | 4 +- 3 files changed, 1 insertion(+), 130 deletions(-) delete mode 100644 src/network/access/qnetworkaccessdatabackend.cpp diff --git a/src/network/access/access.pri b/src/network/access/access.pri index 9cd2096..4c21ba5 100644 --- a/src/network/access/access.pri +++ b/src/network/access/access.pri @@ -12,7 +12,6 @@ HEADERS += \ access/qnetworkaccessmanager_p.h \ access/qnetworkaccesscache_p.h \ access/qnetworkaccessbackend_p.h \ - access/qnetworkaccessdatabackend_p.h \ access/qnetworkaccessdebugpipebackend_p.h \ access/qnetworkaccesshttpbackend_p.h \ access/qnetworkaccessfilebackend_p.h \ @@ -45,7 +44,6 @@ SOURCES += \ access/qnetworkaccessmanager.cpp \ access/qnetworkaccesscache.cpp \ access/qnetworkaccessbackend.cpp \ - access/qnetworkaccessdatabackend.cpp \ access/qnetworkaccessdebugpipebackend.cpp \ access/qnetworkaccessfilebackend.cpp \ access/qnetworkaccesscachebackend.cpp \ diff --git a/src/network/access/qnetworkaccessdatabackend.cpp b/src/network/access/qnetworkaccessdatabackend.cpp deleted file mode 100644 index efb6e3e..0000000 --- a/src/network/access/qnetworkaccessdatabackend.cpp +++ /dev/null @@ -1,125 +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 QtNetwork 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 "qnetworkaccessdatabackend_p.h" -#include "qnetworkrequest.h" -#include "qnetworkreply.h" -#include "qurlinfo.h" -#include "private/qdataurl_p.h" -#include - -QT_BEGIN_NAMESPACE - -QNetworkAccessBackend * -QNetworkAccessDataBackendFactory::create(QNetworkAccessManager::Operation, - const QNetworkRequest &request) const -{ - if (request.url().scheme() == QLatin1String("data")) - return new QNetworkAccessDataBackend; - - return 0; -} - -QNetworkAccessDataBackend::QNetworkAccessDataBackend() -{ -} - -QNetworkAccessDataBackend::~QNetworkAccessDataBackend() -{ -} - -void QNetworkAccessDataBackend::open() -{ - QUrl uri = request().url(); - - if (operation() != QNetworkAccessManager::GetOperation && - operation() != QNetworkAccessManager::HeadOperation) { - // data: doesn't support anything but GET - const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", - "Operation not supported on %1") - .arg(uri.toString()); - error(QNetworkReply::ContentOperationNotPermittedError, msg); - 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 - const QString msg = QCoreApplication::translate("QNetworkAccessDataBackend", - "Invalid URI: %1").arg(uri.toString()); - error(QNetworkReply::ProtocolFailure, msg); - finished(); -} - -void QNetworkAccessDataBackend::closeDownstreamChannel() -{ -} - -void QNetworkAccessDataBackend::closeUpstreamChannel() -{ -} - -bool QNetworkAccessDataBackend::waitForDownstreamReadyRead(int) -{ - return false; -} - -bool QNetworkAccessDataBackend::waitForUpstreamBytesWritten(int) -{ - return false; -} - -QT_END_NAMESPACE diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index add75bf..85b0f92 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -52,7 +52,6 @@ #include "qnetworkaccesshttpbackend_p.h" #include "qnetworkaccessftpbackend_p.h" #include "qnetworkaccessfilebackend_p.h" -#include "qnetworkaccessdatabackend_p.h" #include "qnetworkaccessdebugpipebackend_p.h" #include "qnetworkreplydataimpl_p.h" #include "qnetworkreplyfileimpl_p.h" @@ -70,7 +69,6 @@ QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC(QNetworkAccessHttpBackendFactory, httpBackend) #endif // QT_NO_HTTP Q_GLOBAL_STATIC(QNetworkAccessFileBackendFactory, fileBackend) -Q_GLOBAL_STATIC(QNetworkAccessDataBackendFactory, dataBackend) #ifndef QT_NO_FTP Q_GLOBAL_STATIC(QNetworkAccessFtpBackendFactory, ftpBackend) #endif // QT_NO_FTP @@ -84,7 +82,7 @@ static void ensureInitialized() #ifndef QT_NO_HTTP (void) httpBackend(); #endif // QT_NO_HTTP - (void) dataBackend(); + #ifndef QT_NO_FTP (void) ftpBackend(); #endif -- cgit v0.12 From 2b47265f59b1874a829aff539fe88fb0b70de147 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 5 Oct 2010 13:35:35 +0200 Subject: QNAM: Move out function calls to new variable --- src/network/access/qnetworkaccessmanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 85b0f92..8c17916 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -946,16 +946,17 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera Q_D(QNetworkAccessManager); bool isLocalFile = req.url().isLocalFile(); + QString scheme = req.url().scheme().toLower(); // fast path for GET on file:// URLs // The QNetworkAccessFileBackend will right now only be used for PUT if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation) - && (isLocalFile || req.url().scheme() == QLatin1String("qrc"))) { + && (isLocalFile || scheme == QLatin1String("qrc"))) { return new QNetworkReplyFileImpl(this, req, op); } if ((op == QNetworkAccessManager::GetOperation || op == QNetworkAccessManager::HeadOperation) - && req.url().scheme().toLower() == QLatin1String("data")) { + && scheme == QLatin1String("data")) { return new QNetworkReplyDataImpl(this, req, op); } -- cgit v0.12 From b3f895fd97deda0c7c5bfd704c04450e7afee748 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Tue, 5 Oct 2010 16:43:33 +0300 Subject: QS60Style: QDateEdit - Layout issues In portrait orientation, QDateEdit's calendar popup (QCalendarWidget) does not fit into screen. As a fix, the pixel metric PM_FocusFrameHMargin, is reduced from 13 to 3 in qHD screens (640*360). Also, the explicit halving of the pixel metric for QTableViews is removed. The pixel metric resulted in 27 pixel text margins (2 * pm + 1)for calendar widgets, which is clearly a bit too much. Task-number: QTBUG-14126 Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 3a01f3f..718774e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -106,8 +106,8 @@ const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** generated pixel metrics *** {5,0,-909,0,0,2,0,0,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106}, {5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106}, -{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, -{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,0,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, +{7,0,-909,0,0,2,0,0,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135}, {7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106} // *** End of generated data *** }; @@ -2530,11 +2530,6 @@ int QS60Style::pixelMetric(PixelMetric metric, const QStyleOption *option, const //without having to define custom pixel metric metricValue *= 2; - if (widget && (metric == PM_FocusFrameHMargin)) - if (qobject_cast(widget)) - //Halve the focus frame margin for table items - metricValue /= 2; - return metricValue; } -- cgit v0.12 From 7bf2de5adf62f45c8d7fcba22e2cf9ea427b5b37 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Tue, 5 Oct 2010 16:54:20 +0200 Subject: Adding a threshold for partial updates. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 841 Reviewed-by: Samuel Rødal --- src/opengl/qwindowsurface_gl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index f98dcff..8157b2a 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -534,8 +534,9 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & } } #endif - if (d_ptr->paintedRegion.boundingRect() != geometry() && - hasPartialUpdateSupport()) { + if (hasPartialUpdateSupport() && + d_ptr->paintedRegion.boundingRect().width() * d_ptr->paintedRegion.boundingRect().height() < + geometry().width() * geometry().height() * 0.2) { context()->d_func()->swapRegion(&d_ptr->paintedRegion); } else context()->swapBuffers(); -- cgit v0.12 From 06afa508f2de34cbce9a2798d9418d62e480c283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 5 Oct 2010 17:48:37 +0200 Subject: Issue a warning and disable webkit build when xrender is disabled on X11 Nsplugin fails to build when xrender is disabled and webkit is enabled. This commit modifies configure to automatically disable webkit on X11 when this situation occurs. Reviewed by: Simon Hausmann --- configure | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure b/configure index ceedaaa..826025d 100755 --- a/configure +++ b/configure @@ -5745,6 +5745,12 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi fi + # Additional check to decide if WebKit support will be included + if [ "$CFG_XRENDER" = "no" ] && [ "$CFG_WEBKIT" != "no" ]; then + echo "Warning: -no-xrender will disable the QtWebkit module." + CFG_WEBKIT="no" + fi + # auto-detect MIT-SHM support if [ "$CFG_MITSHM" != "no" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/mitshm "mitshm" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then -- cgit v0.12 From cace0a51e21ff8275b887025b562fc79bec9f32f Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Tue, 5 Oct 2010 11:28:35 -0500 Subject: Revert "QWorkspace: fix hardcoded min size overwriting the real min size" This reverts commit b3a46493a1a74bd7918bd68638c28cf6e84eb57f. --- src/gui/widgets/qworkspace.cpp | 15 ++++++--------- tests/auto/qworkspace/tst_qworkspace.cpp | 10 ---------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/gui/widgets/qworkspace.cpp b/src/gui/widgets/qworkspace.cpp index 3a9b30c..7180c4d 100644 --- a/src/gui/widgets/qworkspace.cpp +++ b/src/gui/widgets/qworkspace.cpp @@ -2551,6 +2551,7 @@ QWorkspaceChild::QWorkspaceChild(QWidget* window, QWorkspace *parent, Qt::Window this, SLOT(titleBarDoubleClicked())); } + setMinimumSize(128, 0); int fw = style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth, 0, this); setContentsMargins(fw, fw, fw, fw); @@ -2701,15 +2702,11 @@ QSize QWorkspaceChild::sizeHint() const QSize QWorkspaceChild::minimumSizeHint() const { - QSize s; - if (!childWidget) { - s = QWidget::minimumSizeHint(); - } else { - s = childWidget->minimumSize(); - if (s.isEmpty()) - s = childWidget->minimumSizeHint(); - } - s = s.expandedTo(QSize(128, 0)); + if (!childWidget) + return QWidget::minimumSizeHint() + baseSize(); + QSize s = childWidget->minimumSize(); + if (s.isEmpty()) + s = childWidget->minimumSizeHint(); return s + baseSize(); } diff --git a/tests/auto/qworkspace/tst_qworkspace.cpp b/tests/auto/qworkspace/tst_qworkspace.cpp index 9039eb3..4cf76b5 100644 --- a/tests/auto/qworkspace/tst_qworkspace.cpp +++ b/tests/auto/qworkspace/tst_qworkspace.cpp @@ -44,7 +44,6 @@ #include #include #include -#include #include #if defined(QT3_SUPPORT) #include @@ -592,25 +591,16 @@ void tst_QWorkspace::childSize() MyChild *child = new MyChild(&ws); child->show(); - ws.addWindow(child); QCOMPARE(child->size(), child->sizeHint()); delete child; child = new MyChild(&ws); child->setFixedSize(200, 200); child->show(); - ws.addWindow(child); QCOMPARE(child->size(), child->minimumSize()); - QCOMPARE(child->parentWidget()->metaObject()->className(), "QWorkspaceChild"); - QVERIFY(child->parentWidget()->width() >= 200); - // check that the minimum size is respected, using closestAcceptableSize - // like QSizeGrip does. - const QSize newSize = QLayout::closestAcceptableSize(child->parentWidget(), QSize(100, 100)); - QVERIFY(newSize.width() >= 200); delete child; child = new MyChild(&ws); - ws.addWindow(child); child->resize(150, 150); child->show(); QCOMPARE(child->size(), QSize(150,150)); -- cgit v0.12 From 07256884f745e93d98687b213d037baf4be538a1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Oct 2010 17:20:31 +0200 Subject: make custom command handling in vc(x)proj files sane instead of glueing the commands with "&&" and having a monster hack (\r\h) for the case where they cannot be and-ed, glue them with newlines and error checks. this ensures that we a) never have excessively long lines, b) don't need the monster hack and c) commands always have proper error checks, just like in makefiles. Reviewed-by: mariusSO --- qmake/generators/win32/msbuild_objectmodel.cpp | 44 ++++++++--------------- qmake/generators/win32/msbuild_objectmodel.h | 2 +- qmake/generators/win32/msvc_objectmodel.cpp | 49 +++++++++++--------------- qmake/generators/win32/msvc_objectmodel.h | 3 +- qmake/generators/win32/msvc_vcproj.cpp | 26 ++++---------- qmake/generators/win32/msvc_vcproj.h | 1 - qmake/generators/win32/msvc_vcxproj.cpp | 14 ++++---- 7 files changed, 50 insertions(+), 89 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 2505056..c963f46 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -377,6 +377,16 @@ inline XmlOutput::xml_output valueTagT( const triState v) } +static QString vcxCommandSeparator() +{ + // MSBuild puts the contents of the custom commands into a batch file and calls it. + // As we want every sub-command to be error-checked (as is done by makefile-based + // backends), we insert the checks ourselves, using the undocumented jump target. + static QString cmdSep = + QLatin1String(" if errorlevel 1 goto VCEnd "); + return cmdSep; +} + // VCXCLCompilerTool ------------------------------------------------- VCXCLCompilerTool::VCXCLCompilerTool() : BrowseInformation(_False), @@ -2142,32 +2152,6 @@ VCXCustomBuildTool::VCXCustomBuildTool() XmlOutput &operator<<(XmlOutput &xml, const VCXCustomBuildTool &tool) { - // The code below offers two ways to split custom build step commands. - // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated - // in all generators. However, if you use $$escape_expand(\n\r) (or \n\h) instead, the VCPROJ - // generator will instead of binding the commands with " && " will insert a proper newline into - // the VCPROJ file. We sometimes use this method of splitting commands if the custom buildstep - // contains a command-line which is too big to run on certain OS. - QString cmds; - int end = tool.CommandLine.count(); - for(int i = 0; i < end; ++i) { - QString cmdl = tool.CommandLine.at(i); - if (cmdl.contains("\r\t")) { - if (i == end - 1) - cmdl = cmdl.trimmed(); - cmdl.replace("\r\t", " && "); - } else if (cmdl.contains("\r\n")) { - ; - } else if (cmdl.contains("\r\\h")) { - // The above \r\n should work, but doesn't, so we have this hack - cmdl.replace("\r\\h", "\r\n"); - } else { - if (i < end - 1) - cmdl += " && "; - } - cmds += cmdl; - } - if ( !tool.AdditionalDependencies.isEmpty() ) { xml << tag("AdditionalInputs") @@ -2175,11 +2159,11 @@ XmlOutput &operator<<(XmlOutput &xml, const VCXCustomBuildTool &tool) << valueTagDefX(tool.AdditionalDependencies, "AdditionalInputs", ";"); } - if( !cmds.isEmpty() ) + if( !tool.CommandLine.isEmpty() ) { xml << tag("Command") << attrTag("Condition", QString("'$(Configuration)|$(Platform)'=='%1'").arg(tool.ConfigName)) - << valueTag(cmds); + << valueTag(tool.CommandLine.join(vcxCommandSeparator())); } if ( !tool.Description.isEmpty() ) @@ -2249,7 +2233,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCXEventTool &tool) { return xml << tag(tool.EventName) - << attrTagS(_Command, tool.CommandLine) + << attrTagS(_Command, tool.CommandLine.join(vcxCommandSeparator())) << attrTagS(_Message, tool.Description) << closetag(tool.EventName); } @@ -2525,7 +2509,7 @@ bool VCXFilter::addExtraCompiler(const VCXFilterFile &info) if (!CustomBuildTool.Description.isEmpty()) CustomBuildTool.Description += " & "; CustomBuildTool.Description += cmd_name; - CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts); + CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed()); int space = cmd.indexOf(' '); QFileInfo finf(cmd.left(space)); if (CustomBuildTool.ToolPath.isEmpty()) diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h index 567985d..acca6c1 100644 --- a/qmake/generators/win32/msbuild_objectmodel.h +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -382,7 +382,7 @@ protected: public: // Variables - QString CommandLine; + QStringList CommandLine; QString Description; triState UseInBuild; QString EventName; diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 980e686..df414ea 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -280,6 +280,24 @@ inline XmlOutput::xml_output attrX(const char *name, const QStringList &v, const return attr(name, v.join(s)); } +// VCToolBase ------------------------------------------------- +QStringList VCToolBase::fixCommandLine(const QString &input) +{ + // The splitting regexp is a bit bizarre for backwards compat reasons (why else ...). + return input.split(QRegExp(QLatin1String("\n\t|\r\\h|\r\n"))); +} + +static QString vcCommandSeparator() +{ + // MSVC transforms the build tree into a single batch file, simply pasting the contents + // of the custom commands into it, and putting an "if errorlevel goto" statement behind it. + // As we want every sub-command to be error-checked (as is done by makefile-based + // backends), we insert the checks ourselves, using the undocumented jump target. + static QString cmdSep = + QLatin1String(" if errorlevel 1 goto VCReportError "); + return cmdSep; +} + // VCCLCompilerTool ------------------------------------------------- VCCLCompilerTool::VCCLCompilerTool() : AssemblerOutput(asmListingNone), @@ -1913,36 +1931,11 @@ VCCustomBuildTool::VCCustomBuildTool() XmlOutput &operator<<(XmlOutput &xml, const VCCustomBuildTool &tool) { - // The code below offers two ways to split custom build step commands. - // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated - // in all generators. However, if you use $$escape_expand(\n\r) (or \n\h) instead, the VCPROJ - // generator will instead of binding the commands with " && " will insert a proper newline into - // the VCPROJ file. We sometimes use this method of splitting commands if the custom buildstep - // contains a command-line which is too big to run on certain OS. - QString cmds; - int end = tool.CommandLine.count(); - for(int i = 0; i < end; ++i) { - QString cmdl = tool.CommandLine.at(i); - if (cmdl.contains("\r\t")) { - if (i == end - 1) - cmdl = cmdl.trimmed(); - cmdl.replace("\r\t", " && "); - } else if (cmdl.contains("\r\n")) { - ; - } else if (cmdl.contains("\r\\h")) { - // The above \r\n should work, but doesn't, so we have this hack - cmdl.replace("\r\\h", "\r\n"); - } else { - if (i < end - 1) - cmdl += " && "; - } - cmds += cmdl; - } return xml << tag(_Tool) << attrS(_Name, tool.ToolName) << attrX(_AdditionalDependencies, tool.AdditionalDependencies, ";") - << attrS(_CommandLine, cmds) + << attrS(_CommandLine, tool.CommandLine.join(vcCommandSeparator())) << attrS(_Description, tool.Description) << attrX(_Outputs, tool.Outputs, ";") << attrS(_Path, tool.ToolPath) @@ -2002,7 +1995,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCEventTool &tool) << tag(_Tool) << attrS(_Name, tool.ToolName) << attrS(_Path, tool.ToolPath) - << attrS(_CommandLine, tool.CommandLine) + << attrS(_CommandLine, tool.CommandLine.join(vcCommandSeparator())) << attrS(_Description, tool.Description) << attrT(_ExcludedFromBuild, tool.ExcludedFromBuild) << closetag(_Tool); @@ -2296,7 +2289,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) if (!CustomBuildTool.Description.isEmpty()) CustomBuildTool.Description += " & "; CustomBuildTool.Description += cmd_name; - CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts); + CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed()); int space = cmd.indexOf(' '); QFileInfo finf(cmd.left(space)); if (CustomBuildTool.ToolPath.isEmpty()) diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 97f8570..22013e0 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -475,6 +475,7 @@ public: for (QStringList::ConstIterator it=options.begin(); (it!=options.end()); it++) parseOption((*it).toLatin1()); } + static QStringList fixCommandLine(const QString &input); }; class VCConfiguration; @@ -746,7 +747,7 @@ protected: public: // Variables - QString CommandLine; + QStringList CommandLine; QString Description; triState ExcludedFromBuild; QString ToolName; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 8686ae8..cff7a14 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1027,37 +1027,23 @@ void VcprojGenerator::initPreBuildEventTools() { } -QString VcprojGenerator::fixCommandLine(DotNET version, const QString &input) const -{ - QString result = input; - - if (version >= NET2005) - result = result.replace(QLatin1Char('\n'), QLatin1String(" ")); - - return result; -} - void VcprojGenerator::initPostBuildEventTools() { VCConfiguration &conf = vcProject.Configuration; if(!project->values("QMAKE_POST_LINK").isEmpty()) { - QString cmdline = fixCommandLine(conf.CompilerVersion, var("QMAKE_POST_LINK")); + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK")); conf.postBuild.CommandLine = cmdline; - if (conf.CompilerVersion < NET2005) - cmdline = cmdline.replace("\n", "&&"); - conf.postBuild.Description = cmdline; + conf.postBuild.Description = cmdline.join(QLatin1String("\r\n")); } QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE"); bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if(useSignature) - conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + - (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + conf.postBuild.CommandLine.prepend( + QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { - if(!conf.postBuild.CommandLine.isEmpty()) - conf.postBuild.CommandLine += " && "; conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); } @@ -1186,9 +1172,9 @@ void VcprojGenerator::initPreLinkEventTools() { VCConfiguration &conf = vcProject.Configuration; if(!project->values("QMAKE_PRE_LINK").isEmpty()) { - QString cmdline = fixCommandLine(conf.CompilerVersion, var("QMAKE_PRE_LINK")); - conf.preLink.Description = cmdline; + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK")); conf.preLink.CommandLine = cmdline; + conf.preLink.Description = cmdline.join(QLatin1String("\r\n")); } } diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 8f028a1..05e765e 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -130,7 +130,6 @@ protected: QList mergedProjects; private: - QString fixCommandLine(DotNET version, const QString &input) const; QUuid increaseUUID(const QUuid &id); friend class VCFilter; }; diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 271d9ae..396d2bf 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -380,9 +380,9 @@ void VcxprojGenerator::initPostBuildEventTools() { VCXConfiguration &conf = vcxProject.Configuration; if(!project->values("QMAKE_POST_LINK").isEmpty()) { - QString cmdline = var("QMAKE_POST_LINK"); + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK")); conf.postBuild.CommandLine = cmdline; - conf.postBuild.Description = cmdline; + conf.postBuild.Description = cmdline.join(QLatin1String("\r\n")); conf.postBuild.UseInBuild = _True; } @@ -390,14 +390,12 @@ void VcxprojGenerator::initPostBuildEventTools() bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") && !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); if(useSignature) { - conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + - (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + conf.postBuild.CommandLine.prepend( + QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); conf.postBuild.UseInBuild = _True; } if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { - if(!conf.postBuild.CommandLine.isEmpty()) - conf.postBuild.CommandLine += " && "; conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); conf.postBuild.UseInBuild = _True; @@ -530,9 +528,9 @@ void VcxprojGenerator::initPreLinkEventTools() { VCXConfiguration &conf = vcxProject.Configuration; if(!project->values("QMAKE_PRE_LINK").isEmpty()) { - QString cmdline = var("QMAKE_PRE_LINK"); - conf.preLink.Description = cmdline; + QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK")); conf.preLink.CommandLine = cmdline; + conf.preLink.Description = cmdline.join(QLatin1String("\r\n")); conf.preLink.UseInBuild = _True; } } -- cgit v0.12 From 474295602d473078aebff00a8d2e8265cdc5d424 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Oct 2010 19:12:02 +0200 Subject: make QMAKE_POST_LINK handling in nmake generator sane there is no point in &&-ing it with a possibly present signature command - putting it on a line of its own works just fine - with the added benefit of not breaking if it contains operators itself. Reviewed-by: mariusSO --- qmake/generators/win32/msvc_nmake.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 92e8aeb..907f8dc 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -310,10 +310,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) t << "\n\tsigntool sign /F " << signature << " $(DESTDIR_TARGET)"; } if(!project->isEmpty("QMAKE_POST_LINK")) { - if (useSignature) - t << " && " << var("QMAKE_POST_LINK"); - else - t << "\n\t" << var("QMAKE_POST_LINK"); + t << "\n\t" << var("QMAKE_POST_LINK"); } t << endl; } -- cgit v0.12 From edb1e43f0ad7aece24929d95542490da7f88321f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Oct 2010 19:27:00 +0200 Subject: rebuild configure.exe --- configure.exe | Bin 1402368 -> 1325568 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index e2f4331..f8d520a 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From d75dad653d651eb725b238ad9db4dccd6a1f1d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 5 Oct 2010 18:12:03 +0200 Subject: qmake: Ensure right library order when reducing duplicate libraries Commit 3ed9e2788e8 changed the logic from using lookahead to checking if the library already existed in the arguments parsed so far. This broke the case -lFoo -lBar -lFoo where Bar depends on symbols in Foo. Since we were reducing this to -lFoo -lBar, the linker would not know which missing symbols to include from Foo when encountering the -lFoo argument. We now keep the library order when building the final argument list, by making sure the position of a duplicated library is always that of the last instance of that library. Task-number: QTBUG-13944 Reviewed-by: Simon Hausmann --- qmake/generators/unix/unixmake.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index da4bbb7..c26fcb4 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -636,11 +636,13 @@ UnixMakefileGenerator::processPrlFiles() if(opt.startsWith("-L") || (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { - if(lit == 0 || !lflags[arch].contains(opt)) + if(!lflags[arch].contains(opt)) lflags[arch].append(opt); } else if(opt.startsWith("-l")) { - if(lit == l.size()-1 || !lflags[arch].contains(opt)) - lflags[arch].append(opt); + // Make sure we keep the dependency-order of libraries + if (lflags[arch].contains(opt)) + lflags[arch].removeAll(opt); + lflags[arch].append(opt); } else if(Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-framework")) { if(opt.length() > 11) opt = opt.mid(11); @@ -672,7 +674,7 @@ UnixMakefileGenerator::processPrlFiles() lflags[arch].append(opt); } } else if(!opt.isNull()) { - if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) + if(!lflags[arch].contains(opt)) lflags[arch].append(opt); } } -- cgit v0.12 From 9c2361fa3b0ce2417a26537a3ecfe17c2b3ca6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 5 Oct 2010 18:23:57 +0200 Subject: qmake: Include -pthread when reducing duplicate library arguments Reviwed-by: Simon Hausmann --- qmake/generators/unix/unixmake.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index c26fcb4..71a6061 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -638,7 +638,7 @@ UnixMakefileGenerator::processPrlFiles() (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { if(!lflags[arch].contains(opt)) lflags[arch].append(opt); - } else if(opt.startsWith("-l")) { + } else if(opt.startsWith("-l") || opt == "-pthread") { // Make sure we keep the dependency-order of libraries if (lflags[arch].contains(opt)) lflags[arch].removeAll(opt); -- cgit v0.12 From bb8ba98542e1ed363d4218b9a9a4e68a6c4b5337 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 6 Oct 2010 11:26:23 +1000 Subject: Create Loader components in correct context Task-number: QTBUG-13481 --- src/declarative/graphicsitems/qdeclarativeloader.cpp | 4 +++- .../qdeclarativeloader/data/CreationContextLoader.qml | 15 +++++++++++++++ .../qdeclarativeloader/data/creationContext.qml | 8 ++++++++ .../qdeclarativeloader/tst_qdeclarativeloader.cpp | 14 ++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml create mode 100644 tests/auto/declarative/qdeclarativeloader/data/creationContext.qml diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp index 1066c2b..5647b14 100644 --- a/src/declarative/graphicsitems/qdeclarativeloader.cpp +++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp @@ -337,7 +337,9 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded() return; } - QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(q)); + QDeclarativeContext *creationContext = component->creationContext(); + if (!creationContext) creationContext = qmlContext(q); + QDeclarativeContext *ctxt = new QDeclarativeContext(creationContext); ctxt->setContextObject(q); QDeclarativeComponent *c = component; diff --git a/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml new file mode 100644 index 0000000..bfc9a8d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/CreationContextLoader.qml @@ -0,0 +1,15 @@ +import QtQuick 1.0 + +Loader { + id: myLoader + property int testProperty: 1912 + sourceComponent: loaderComponent + Component { + id: loaderComponent + Item { + Component.onCompleted: { + test = (myLoader.testProperty == 1912); + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml new file mode 100644 index 0000000..5297978 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeloader/data/creationContext.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +Item { + property bool test: false + + CreationContextLoader { + } +} diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 8d04616..1bde55b 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -89,6 +89,7 @@ private slots: void deleteComponentCrash(); void nonItem(); void vmeErrors(); + void creationContext(); private: QDeclarativeEngine engine; @@ -562,6 +563,19 @@ void tst_QDeclarativeLoader::vmeErrors() delete loader; } +// QTBUG-13481 +void tst_QDeclarativeLoader::creationContext() +{ + QDeclarativeComponent component(&engine, TEST_FILE("creationContext.qml")); + + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test").toBool(), true); + + delete o; +} + QTEST_MAIN(tst_QDeclarativeLoader) #include "tst_qdeclarativeloader.moc" -- cgit v0.12 From 0030599cbe39c9fc7d6f2632b4e66a54b1b46417 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 6 Oct 2010 13:59:19 +1000 Subject: Ensure PathView updates positions when path changes. Fixes regression caused by optimization added in commit 35a51442ed21f58c06b21293eeb56e843251ee82. Task-number: QTBUG-14239 Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 17 +++++++++++++++-- src/declarative/graphicsitems/qdeclarativepathview_p.h | 1 + .../qdeclarativepathview/data/pathUpdate.qml | 18 ++++++++++++++++++ .../qdeclarativepathview/tst_qdeclarativepathview.cpp | 18 ++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index d134929..3ae8788 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -300,6 +300,19 @@ void QDeclarativePathViewPrivate::setHighlightPosition(qreal pos) } } +void QDeclarativePathView::pathUpdated() +{ + Q_D(QDeclarativePathView); + QList::iterator it = d->items.begin(); + while (it != d->items.end()) { + QDeclarativeItem *item = *it; + if (QDeclarativePathViewAttached *att = d->attached(item)) + att->m_percent = -1; + ++it; + } + refill(); +} + void QDeclarativePathViewPrivate::updateItem(QDeclarativeItem *item, qreal percent) { if (QDeclarativePathViewAttached *att = attached(item)) { @@ -526,9 +539,9 @@ void QDeclarativePathView::setPath(QDeclarativePath *path) if (d->path == path) return; if (d->path) - disconnect(d->path, SIGNAL(changed()), this, SLOT(refill())); + disconnect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated())); d->path = path; - connect(d->path, SIGNAL(changed()), this, SLOT(refill())); + connect(d->path, SIGNAL(changed()), this, SLOT(pathUpdated())); if (d->isValid() && isComponentComplete()) { d->clear(); if (d->attType) { diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p.h index 62a8c44..7775b1c 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview_p.h +++ b/src/declarative/graphicsitems/qdeclarativepathview_p.h @@ -186,6 +186,7 @@ private Q_SLOTS: void modelReset(); void createdItem(int index, QDeclarativeItem *item); void destroyingItem(QDeclarativeItem *item); + void pathUpdated(); private: friend class QDeclarativePathViewAttached; diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml new file mode 100644 index 0000000..0c99e7f --- /dev/null +++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml @@ -0,0 +1,18 @@ +import Qt 4.7 + +Rectangle { + width: 400 + height: 400 + + PathView { + id: view + objectName: "pathView" + anchors.fill: parent + model: 10 + delegate: Rectangle { objectName: "wrapper"; color: "green"; width: 100; height: 100 } + path: Path { + startX: view.width/2; startY: 0 + PathLine { x: view.width/2; y: view.height } + } + } +} diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 65007a6..3a2a577 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -86,6 +86,7 @@ private slots: void package(); void emptyModel(); void closed(); + void pathUpdate(); private: QDeclarativeView *createView(); @@ -808,6 +809,23 @@ void tst_QDeclarativePathView::closed() } } +// QTBUG-14239 +void tst_QDeclarativePathView::pathUpdate() +{ + QDeclarativeView *canvas = createView(); + QVERIFY(canvas); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/pathUpdate.qml")); + + QDeclarativePathView *pathView = canvas->rootObject()->findChild("pathView"); + QVERIFY(pathView); + + QDeclarativeItem *item = findItem(pathView, "wrapper", 0); + QVERIFY(item); + QCOMPARE(item->x(), 150.0); + + delete canvas; +} + QDeclarativeView *tst_QDeclarativePathView::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); -- cgit v0.12 From 4647f24469ec93b3b66628472af5462fbe957439 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 6 Oct 2010 12:41:16 +1000 Subject: Update QtGui def files --- src/s60installs/bwins/QtGuiu.def | 5 ++++- src/s60installs/eabi/QtGuiu.def | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 9a61523..7cc2752 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12892,5 +12892,8 @@ EXPORTS ?setTimeout@QTapAndHoldGesture@@SAXH@Z @ 12891 NONAME ; void QTapAndHoldGesture::setTimeout(int) ?qmljsDebugArguments@QApplicationPrivate@@2VQString@@A @ 12892 NONAME ; class QString QApplicationPrivate::qmljsDebugArguments ?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@PAVQGraphicsItem@@@Z @ 12893 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(class QGraphicsItem *) const - ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12894 NONAME ; class QString QFont::lastResortFont(void) const + ?maxTextureHeight@QTextureGlyphCache@@UBEHXZ @ 12894 NONAME ; int QTextureGlyphCache::maxTextureHeight(void) const + ?maxTextureWidth@QTextureGlyphCache@@UBEHXZ @ 12895 NONAME ; int QTextureGlyphCache::maxTextureWidth(void) const + ?convertToPostscriptFontFamilyName@QFontEngine@@SA?AVQByteArray@@ABV2@@Z @ 12896 NONAME ; class QByteArray QFontEngine::convertToPostscriptFontFamilyName(class QByteArray const &) + ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12897 NONAME ; class QString QFont::lastResortFont(void) const diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index 634b7af..4e867a3 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -12098,4 +12098,5 @@ EXPORTS _ZN20QGraphicsItemPrivate26childrenBoundingRectHelperEP10QTransformP6QRectFP13QGraphicsItem @ 12097 NONAME _ZNK20QGraphicsItemPrivate21effectiveBoundingRectEP13QGraphicsItem @ 12098 NONAME _ZNK5QFont14lastResortFontEv @ 12099 NONAME + _ZN11QFontEngine33convertToPostscriptFontFamilyNameERK10QByteArray @ 12100 NONAME -- cgit v0.12 From 695b54e671b55bd8103dee8b30ee76309dbd26c1 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 6 Oct 2010 14:01:56 +1000 Subject: Fix minehunt execution from QtDemo Task-number: QTBUG-14250 Reviewed-by: Martin Jones --- demos/declarative/minehunt/main.cpp | 2 +- demos/declarative/minehunt/minehunt.pro | 1 + demos/declarative/minehunt/minehunt.qrc | 20 ++++++++++++++++++++ demos/qtdemo/menumanager.cpp | 1 + demos/qtdemo/xml/examples.xml | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 demos/declarative/minehunt/minehunt.qrc diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp index 8bbaee9..2b286ef 100644 --- a/demos/declarative/minehunt/main.cpp +++ b/demos/declarative/minehunt/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) canvas.setResizeMode(QDeclarativeView::SizeRootObjectToView); #endif canvas.engine()->rootContext()->setContextObject(game); - canvas.setSource(QString("minehunt.qml")); + canvas.setSource(QString("qrc:minehunt.qml")); QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit())); #ifdef Q_OS_SYMBIAN diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 7a491ab..753ca4e 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -6,6 +6,7 @@ CONFIG += qt plugin # Input HEADERS += minehunt.h SOURCES += main.cpp minehunt.cpp +RESOURCES = minehunt.qrc sources.files = minehunt.qml minehunt.pro MinehuntCore sources.path = $$[QT_INSTALL_DEMOS]/declarative/minehunt diff --git a/demos/declarative/minehunt/minehunt.qrc b/demos/declarative/minehunt/minehunt.qrc new file mode 100644 index 0000000..fa8e27d --- /dev/null +++ b/demos/declarative/minehunt/minehunt.qrc @@ -0,0 +1,20 @@ + + + minehunt.qml + MinehuntCore/Explosion.qml + MinehuntCore/Tile.qml + MinehuntCore/qmldir + MinehuntCore/pics/background.png + MinehuntCore/pics/back.png + MinehuntCore/pics/bomb-color.png + MinehuntCore/pics/bomb.png + MinehuntCore/pics/face-sad.png + MinehuntCore/pics/face-smile-big.png + MinehuntCore/pics/face-smile.png + MinehuntCore/pics/flag-color.png + MinehuntCore/pics/flag.png + MinehuntCore/pics/front.png + MinehuntCore/pics/quit.png + MinehuntCore/pics/star.png + + diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp index fe3c5aa..ea9146e 100644 --- a/demos/qtdemo/menumanager.cpp +++ b/demos/qtdemo/menumanager.cpp @@ -518,6 +518,7 @@ QString MenuManager::resolveExeFile(const QString &name) dir.cd(dirName); dir.cd(fileName); + fileName = fileName.split("/").last(); QFile unixFile(dir.path() + "/" + fileName); if (unixFile.exists()) return unixFile.fileName(); QFile winR(dir.path() + "\\release\\" + fileName + ".exe"); diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index 0ab048e..27f72bb 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -18,7 +18,7 @@ - + -- cgit v0.12 From cd4389efee184d2ad65b52c5ef64793868f1a004 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 6 Oct 2010 15:12:46 +1000 Subject: Ensure the TextInput cursor blinks immediately when enabled. Previously we relied on cursorPosChanged being called to do the update, but that isn't called in all circumstances. Now we explicitly update when the cursor is enabled or disabled. Task-number: QTBUG-13993 --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 4817999..637dd77 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -417,7 +417,11 @@ void QDeclarativeTextInput::setCursorVisible(bool on) return; d->cursorVisible = on; d->control->setCursorBlinkPeriod(on?QApplication::cursorFlashTime():0); - //d->control should emit the cursor update regions + QRect r = d->control->cursorRect(); + if (d->control->inputMask().isEmpty()) + updateRect(r); + else + updateRect(); emit cursorVisibleChanged(d->cursorVisible); } -- cgit v0.12 From 8209815ee6eea3cbc1ca7b71ce8b68ae8930c0bd Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 6 Oct 2010 15:38:39 +1000 Subject: Autotest Task-number: QTBUG-14089 --- .../data/aliasPropertyChangeSignals.qml | 16 ++++++++++++++++ .../qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml new file mode 100644 index 0000000..7944deb --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/aliasPropertyChangeSignals.qml @@ -0,0 +1,16 @@ +import QtQuick 1.0 + +QtObject { + id: root + + property alias aliasProperty: root.realProperty + onAliasPropertyChanged: root.test = true + + property int realProperty: 0 + + property bool test: false + + Component.onCompleted: { + root.realProperty = 10; + } +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 8609a7e..3c82fc5 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -119,6 +119,7 @@ private slots: void cppnamespace(); void aliasProperties(); void aliasPropertiesAndSignals(); + void aliasPropertyChangeSignals(); void componentCompositeType(); void i18n(); void i18n_data(); @@ -1816,6 +1817,20 @@ void tst_qdeclarativelanguage::initTestCase() out.write(in.readAll()); } +void tst_qdeclarativelanguage::aliasPropertyChangeSignals() +{ + QDeclarativeComponent component(&engine, TEST_FILE("aliasPropertyChangeSignals.qml")); + + VERIFY_ERRORS(0); + QObject *o = component.create(); + QVERIFY(o != 0); + + QEXPECT_FAIL("", "QTBUG-14089", Abort); + QCOMPARE(o->property("test").toBool(), true); + + delete o; +} + QTEST_MAIN(tst_qdeclarativelanguage) #include "tst_qdeclarativelanguage.moc" -- cgit v0.12 From 9979154d2fd757396ef4685dbbb9bad95c3bf7ff Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 6 Oct 2010 10:02:45 +0300 Subject: QS60Style: Highlighted TreeBranch indicator is incorrect Part of the fix for QTBUG-13553 incorrectly uses commonstyle to draw branch highlight, when it should use QS60Style. As a fix, commonstyle should not be used unless theme palette has been tempered with. Task-number: QTBUG-13699 Reviewed-by: Miikka Heikkinen --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 718774e..1e32bd8 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2453,7 +2453,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_PanelItemViewRow: // ### Qt 5: remove #ifndef QT_NO_ITEMVIEWS if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(option)) { - if (QS60StylePrivate::equalToThemePalette(vopt->palette.base().texture().cacheKey(), QPalette::Base)) { + if (!QS60StylePrivate::equalToThemePalette(vopt->palette.base().texture().cacheKey(), QPalette::Base)) { //QPalette::Base has been changed, let commonstyle draw the item commonStyleDraws = true; } else { -- cgit v0.12 From 9d2078629b54a44defda7fa491824df437ffea11 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 6 Oct 2010 17:43:22 +1000 Subject: Allow default QApplication::startDragDistance() to be defined in platformdefs.h Task-number: QT-3930 Reviewed-by: Joona Petrell --- src/gui/kernel/qapplication.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index fdacefc..3323fbc 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -477,11 +477,14 @@ bool Q_GUI_EXPORT qt_tab_all_widgets = true; bool qt_in_tab_key_event = false; int qt_antialiasing_threshold = -1; static int drag_time = 500; +#ifndef QT_GUI_DRAG_DISTANCE +#define QT_GUI_DRAG_DISTANCE 4 +#endif #ifdef Q_OS_SYMBIAN // The screens are a bit too small to for your thumb when using only 4 pixels drag distance. -static int drag_distance = 12; +static int drag_distance = 12; //XXX move to qplatformdefs.h #else -static int drag_distance = 4; +static int drag_distance = QT_GUI_DRAG_DISTANCE; #endif static Qt::LayoutDirection layout_direction = Qt::LeftToRight; QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut -- cgit v0.12 From 98b7536850241a85d20e541db80e354b8bc72d37 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 6 Oct 2010 09:53:35 +0200 Subject: QNAM: Compile fix for Symbian.. hopefully. --- src/network/access/qnetworkreplydataimpl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/access/qnetworkreplydataimpl.cpp b/src/network/access/qnetworkreplydataimpl.cpp index 36f9356..52cfe95 100644 --- a/src/network/access/qnetworkreplydataimpl.cpp +++ b/src/network/access/qnetworkreplydataimpl.cpp @@ -41,6 +41,8 @@ #include "qnetworkreplydataimpl_p.h" #include "private/qdataurl_p.h" +#include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 7d79beeb4c88d4e5fb8d7aecd8dd07419b465f55 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 6 Oct 2010 17:55:15 +1000 Subject: Set reasonable QT_GUI_DRAG_DISTANCE in mkspecs/linux-g++-maemo/qplatformdefs.h Task-number: QT-3930 --- mkspecs/linux-g++-maemo/qplatformdefs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/linux-g++-maemo/qplatformdefs.h b/mkspecs/linux-g++-maemo/qplatformdefs.h index d7feb9e..df6152a 100644 --- a/mkspecs/linux-g++-maemo/qplatformdefs.h +++ b/mkspecs/linux-g++-maemo/qplatformdefs.h @@ -42,3 +42,4 @@ #include "../linux-g++/qplatformdefs.h" #define QT_GUI_DOUBLE_CLICK_RADIUS 20 +#define QT_GUI_DRAG_DISTANCE 16 -- cgit v0.12 From 97d436160c87876cdc272b3ce0bb09256d78405c Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 6 Oct 2010 09:54:15 +0200 Subject: Remove unused/incorrect TFX commands pertaining to layers on Symbian. These commands have been renamed in the Symbian^4 code line, but since they are not currently used by the effects engine, we simply remove them for now to avoid causing build breakages on platforms that use the older version. Reviewed-by: Jani Hautakangas --- src/gui/kernel/qapplication_s60.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 1127c84..296f24f 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -152,18 +152,12 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible) if (backingStore.data()) { backingStore.registerWidget(widget); } else { -#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS - S60->wsSession().SendEffectCommand(ETfxCmdRestoreLayer); -#endif backingStore.create(window); backingStore.registerWidget(widget); qt_widget_private(widget)->invalidateBuffer(widget->rect()); widget->repaint(); } } else { -#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS - S60->wsSession().SendEffectCommand(ETfxCmdDeallocateLayer); -#endif backingStore.unregisterWidget(widget); // In order to ensure that any resources used by the window surface // are immediately freed, we flush the WSERV command buffer. -- cgit v0.12 From d1e415f30b080f0aafefb13aa402634e5710b343 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Wed, 6 Oct 2010 10:14:21 +0200 Subject: Define QVG_SCISSOR_CLIP for QtOpenVG on Symbian. I avoided adding this flag for ages since I wasn't convinced that it was needed on all Symbian OpenVG hardware, but not having it has caused more problems since people report problems when it is not enabled. Simple solution is just to add it. Task-number: QTBUG-11311 Reviewed-by: Jani Hautakangas --- src/openvg/openvg.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvg/openvg.pro b/src/openvg/openvg.pro index eb60331..c05af90 100644 --- a/src/openvg/openvg.pro +++ b/src/openvg/openvg.pro @@ -35,7 +35,7 @@ contains(QT_CONFIG, egl) { } symbian { - DEFINES += QVG_RECREATE_ON_SIZE_CHANGE QVG_BUFFER_SCROLLING + DEFINES += QVG_RECREATE_ON_SIZE_CHANGE QVG_BUFFER_SCROLLING QVG_SCISSOR_CLIP SOURCES += \ qvg_symbian.cpp } -- cgit v0.12 From 6b118e981b0da4e7bcfd99be6ba1d0123885e7b3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 6 Oct 2010 10:29:55 +0200 Subject: fix regexp in "make custom command handling in vc(x)proj files sane" --- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index df414ea..f5ca1be 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -284,7 +284,7 @@ inline XmlOutput::xml_output attrX(const char *name, const QStringList &v, const QStringList VCToolBase::fixCommandLine(const QString &input) { // The splitting regexp is a bit bizarre for backwards compat reasons (why else ...). - return input.split(QRegExp(QLatin1String("\n\t|\r\\h|\r\n"))); + return input.split(QRegExp(QLatin1String("\n\t|\r\\\\h|\r\n"))); } static QString vcCommandSeparator() -- cgit v0.12 From 651135cf53aacc4f580cc382b8192bd313366ed8 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 6 Oct 2010 18:52:44 +1000 Subject: Do not show 'More' button when in fullscreen view. Task-number: QTBUG-11813 --- demos/declarative/flickr/mobile/ImageDetails.qml | 2 ++ demos/declarative/flickr/mobile/ToolBar.qml | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 5dd3b4e..9d1464e 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -172,6 +172,8 @@ Flipable { states: State { name: "Back" PropertyChanges { target: itemRotation; angle: 180 } + PropertyChanges { target: toolBar; button2Visible: false } + PropertyChanges { target: toolBar; button1Label: "Back" } } transitions: Transition { diff --git a/demos/declarative/flickr/mobile/ToolBar.qml b/demos/declarative/flickr/mobile/ToolBar.qml index 55f19d2..d8abb14 100644 --- a/demos/declarative/flickr/mobile/ToolBar.qml +++ b/demos/declarative/flickr/mobile/ToolBar.qml @@ -46,20 +46,24 @@ Item { property alias button1Label: button1.text property alias button2Label: button2.text + property alias button2Visible: button2.visible + signal button1Clicked signal button2Clicked BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } - Button { - id: button1 - anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32 - onClicked: toolbar.button1Clicked() - } + Row { + anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30 + Button { + id: button1 + width: 140; height: 32 + onClicked: toolbar.button1Clicked() + } - Button { - id: button2 - anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32 - onClicked: toolbar.button2Clicked() + Button { + id: button2; width: 140; height: 32 + onClicked: toolbar.button2Clicked() + } } } -- cgit v0.12 From f532679ca11914b453e22342f2ae5e9f790ce47a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 6 Oct 2010 11:48:24 +0200 Subject: Fixes assert in QDeclarativeWebView If QDeclarativeWebView was instantiated twice an assert was triggered by QWebSettings::enablePersistentStorage(); This patch is crtical for tooling (Bauhaus) Task-number: QTBUG-14278 Reviewed-by: Aaron Kennedy --- src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp index 94f08bd..e4f70de 100644 --- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -249,7 +249,11 @@ void QDeclarativeWebView::init() { d = new QDeclarativeWebViewPrivate(this); - QWebSettings::enablePersistentStorage(); + if (QWebSettings::iconDatabasePath().isNull() && + QWebSettings::globalSettings()->localStoragePath().isNull() && + QWebSettings::offlineStoragePath().isNull() && + QWebSettings::offlineWebApplicationCachePath().isNull()) + QWebSettings::enablePersistentStorage(); setAcceptedMouseButtons(Qt::LeftButton); setFlag(QGraphicsItem::ItemHasNoContents, true); -- cgit v0.12 From 62ee836fafe515c03b0be716585f8c2354e188f7 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 5 Oct 2010 17:39:57 +0200 Subject: Fix copying large data to non-Qt applications In send_selection when we decide to use INCR properties we set the given property value to be INCR atom, however we were also sending SelectionNotify event containing the name of the property that the client should watch as INCR, which is wrong, we should send the original property that we were asked to use instead. This fixes copying large junks of data from Qt application, for example copying text (>200k) to gedit or images to gimp. Task-number: QTBUG-8644 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qclipboard_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index 4b75f0a..b7ca2d4 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -836,7 +836,7 @@ static Atom send_selection(QClipboardData *d, Atom target, Window window, Atom p ATOM(INCR), 32, PropModeReplace, (uchar *) &bytes, 1); (void)new QClipboardINCRTransaction(window, property, atomFormat, dataFormat, data, increment); - return ATOM(INCR); + return property; } // make sure we can perform the XChangeProperty in a single request -- cgit v0.12 From 4b81cb847647450f4bad8a0d9a278d43ebdfecc6 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 6 Oct 2010 10:31:37 +0200 Subject: Fixed a buffer overrun when pasting large data from non-Qt apps When we receive a COMPOUND_TEXT data and convert it to multi-byte, if the new length is less than the original buffer, we resize the buffer, but then we need to make sure we reset the buffer_offset variable, which is returned as a "size" of the buffer to a caller. The conversion to COMPOUND_TEXT format was totally wrong, we were using the wrong length of the input text, so the converted string was truncated. Task-number: QTBUG-8644 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qclipboard_x11.cpp | 22 +++++++++------------- src/gui/kernel/qdnd_x11.cpp | 2 +- src/gui/kernel/qmotifdnd_x11.cpp | 2 +- src/gui/kernel/qt_x11_p.h | 2 +- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp index b7ca2d4..55548ef 100644 --- a/src/gui/kernel/qclipboard_x11.cpp +++ b/src/gui/kernel/qclipboard_x11.cpp @@ -595,7 +595,7 @@ static inline int maxSelectionIncr(Display *dpy) { return XMaxRequestSize(dpy) > 65536 ? 65536*4 : XMaxRequestSize(dpy)*4 - 100; } bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deleteProperty, - QByteArray *buffer, int *size, Atom *type, int *format, bool nullterm) + QByteArray *buffer, int *size, Atom *type, int *format) { int maxsize = maxSelectionIncr(display); ulong bytes_left; // bytes_after @@ -641,13 +641,13 @@ bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deletePrope break; } - int newSize = proplen + (nullterm ? 1 : 0); + int newSize = proplen; buffer->resize(newSize); bool ok = (buffer->size() == newSize); VDEBUG("QClipboard: read_property(): buffer resized to %d", buffer->size()); - if (ok) { + if (ok && newSize) { // could allocate buffer while (bytes_left) { @@ -683,23 +683,19 @@ bool QX11Data::clipboardReadProperty(Window win, Atom property, bool deletePrope XTextProperty textprop; textprop.encoding = *type; textprop.format = *format; - textprop.nitems = length; + textprop.nitems = buffer_offset; textprop.value = (unsigned char *) buffer->data(); char **list_ret = 0; int count; if (XmbTextPropertyToTextList(display, &textprop, &list_ret, &count) == Success && count && list_ret) { - offset = strlen(list_ret[0]); - buffer->resize(offset + (nullterm ? 1 : 0)); + offset = buffer_offset = strlen(list_ret[0]); + buffer->resize(offset); memcpy(buffer->data(), list_ret[0], offset); } if (list_ret) XFreeStringList(list_ret); } - - // zero-terminate (for text) - if (nullterm) - buffer->data()[buffer_offset] = '\0'; } // correct size, not 0-term. @@ -742,7 +738,7 @@ QByteArray QX11Data::clipboardReadIncrementalProperty(Window win, Atom property, if (event.xproperty.atom != property || event.xproperty.state != PropertyNewValue) continue; - if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0, false)) { + if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0)) { if (length == 0) { // no more data, we're done if (nullterm) { buf.resize(offset+1); @@ -1070,7 +1066,7 @@ bool QClipboard::event(QEvent *e) QByteArray multi_data; if (req->property == XNone || !X11->clipboardReadProperty(req->requestor, req->property, false, &multi_data, - 0, &multi_type, &multi_format, 0) + 0, &multi_type, &multi_format) || multi_format != 32) { // MULTIPLE property not formatted correctly XSendEvent(dpy, req->requestor, False, NoEventMask, &event); @@ -1292,7 +1288,7 @@ QByteArray QClipboardWatcher::getDataInFormat(Atom fmtatom) const Atom type; XSelectInput(dpy, win, PropertyChangeMask); - if (X11->clipboardReadProperty(win, ATOM(_QT_SELECTION), true, &buf, 0, &type, 0, false)) { + if (X11->clipboardReadProperty(win, ATOM(_QT_SELECTION), true, &buf, 0, &type, 0)) { if (type == ATOM(INCR)) { int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0; buf = X11->clipboardReadIncrementalProperty(win, ATOM(_QT_SELECTION), nbytes, false); diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 92dd0a1..68d7688 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -1887,7 +1887,7 @@ static QVariant xdndObtainData(const char *format, QVariant::Type requestedType) if (got) { Atom type; - if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0, false)) { + if (X11->clipboardReadProperty(tw->effectiveWinId(), ATOM(XdndSelection), true, &result, 0, &type, 0)) { if (type == ATOM(INCR)) { int nbytes = result.size() >= 4 ? *((int*)result.data()) : 0; result = X11->clipboardReadIncrementalProperty(tw->effectiveWinId(), ATOM(XdndSelection), nbytes, false); diff --git a/src/gui/kernel/qmotifdnd_x11.cpp b/src/gui/kernel/qmotifdnd_x11.cpp index 0a7b350..3334455 100644 --- a/src/gui/kernel/qmotifdnd_x11.cpp +++ b/src/gui/kernel/qmotifdnd_x11.cpp @@ -766,7 +766,7 @@ QVariant QX11Data::motifdndObtainData(const char *mimeType) if (got) { Atom type; - if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0, false)) { + if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0)) { } } diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 7383382..d62d9c3 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -350,7 +350,7 @@ struct QX11Data // from qclipboard_x11.cpp bool clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout); bool clipboardReadProperty(Window win, Atom property, bool deleteProperty, - QByteArray *buffer, int *size, Atom *type, int *format, bool nullterm); + QByteArray *buffer, int *size, Atom *type, int *format); QByteArray clipboardReadIncrementalProperty(Window win, Atom property, int nbytes, bool nullterm); // from qdnd_x11.cpp -- cgit v0.12 From e98962aab2db1c3760b324d6640fa8b510b7e04c Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 6 Oct 2010 12:46:45 +0200 Subject: tst_qtcpsocket: Attempt to reproduce QTBUG-14268 The test (un)fortunately passes :-) Task-number: QTBUG-14268 --- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 31cae40..5b77006 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -201,6 +201,9 @@ private slots: void proxyFactory_data(); void proxyFactory(); + void qtbug14268_peek(); + + protected slots: void nonBlockingIMAP_hostFound(); void nonBlockingIMAP_connected(); @@ -251,6 +254,41 @@ enum ProxyTests { int tst_QTcpSocket::loopLevel = 0; +class SocketPair: public QObject +{ + Q_OBJECT +public: + QTcpSocket *endPoints[2]; + + SocketPair(QObject *parent = 0) + : QObject(parent) + { + endPoints[0] = endPoints[1] = 0; + } + + bool create() + { + QTcpServer server; + server.listen(); + + QTcpSocket *active = new QTcpSocket(this); + active->connectToHost("127.0.0.1", server.serverPort()); + + if (!active->waitForConnected(1000)) + return false; + + if (!server.waitForNewConnection(1000)) + return false; + + QTcpSocket *passive = server.nextPendingConnection(); + passive->setParent(this); + + endPoints[0] = active; + endPoints[1] = passive; + return true; + } +}; + tst_QTcpSocket::tst_QTcpSocket() { Q_SET_DEFAULT_IAP @@ -2467,6 +2505,39 @@ void tst_QTcpSocket::proxyFactory() delete socket; } +void tst_QTcpSocket::qtbug14268_peek() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + SocketPair socketPair; + QVERIFY(socketPair.create()); + QTcpSocket *outgoing = socketPair.endPoints[0]; + QTcpSocket *incoming = socketPair.endPoints[1]; + + QVERIFY(incoming->state() == QTcpSocket::ConnectedState); + QVERIFY(outgoing->state() == QTcpSocket::ConnectedState); + + outgoing->write("abc"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc")); + + outgoing->write("def"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abcdef")); + + outgoing->write("ghi"); + QVERIFY(outgoing->waitForBytesWritten(2000)); + QVERIFY(incoming->waitForReadyRead(2000)); + QVERIFY(incoming->peek(128*1024) == QByteArray("abcdefghi")); + + QVERIFY(incoming->read(128*1024) == QByteArray("abcdefghi")); +} + + QTEST_MAIN(tst_QTcpSocket) #include "tst_qtcpsocket.moc" -- cgit v0.12 From ccd3f663c8c96e266b173a6f825bccec830007e1 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 6 Oct 2010 10:31:06 +0200 Subject: Fix crash when constructing QThreadStorage after global destructors have run In this particular case, the destructors vector used by QThreadStorageData has already been destroyed, yet a new QThreadStorage is being allocated. This can only happen during global destruction, at which point we assume that there is only one thread. In order to keep QThreadStorage working, we need somewhere to store the data, and the best place we have in this situation is at the tail of the current thread's tls vector. The destructor is ignored, since we have no where to store it, and no way to actually call it. Task-number: QTBUG-10084 Reviewed-by: thiago Reviewed-by: olivier --- src/corelib/thread/qthreadstorage.cpp | 21 +++++++- tests/auto/qthreadstorage/crashOnExit.cpp | 64 ++++++++++++++++++++++++ tests/auto/qthreadstorage/crashOnExit.pro | 4 ++ tests/auto/qthreadstorage/qthreadstorage.pro | 8 +-- tests/auto/qthreadstorage/tst_qthreadstorage.cpp | 9 ++++ tests/auto/qthreadstorage/tst_qthreadstorage.pro | 4 ++ 6 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 tests/auto/qthreadstorage/crashOnExit.cpp create mode 100644 tests/auto/qthreadstorage/crashOnExit.pro create mode 100644 tests/auto/qthreadstorage/tst_qthreadstorage.pro diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp index 88d73cc..2fc04f5 100644 --- a/src/corelib/thread/qthreadstorage.cpp +++ b/src/corelib/thread/qthreadstorage.cpp @@ -79,6 +79,21 @@ QThreadStorageData::QThreadStorageData(void (*func)(void *)) { QMutexLocker locker(mutex()); DestructorMap *destr = destructors(); + if (!destr) { + /* + the destructors vector has already been destroyed, yet a new + QThreadStorage is being allocated. this can only happen during global + destruction, at which point we assume that there is only one thread. + in order to keep QThreadStorage working, we need somewhere to store + the data, best place we have in this situation is at the tail of the + current thread's tls vector. the destructor is ignored, since we have + no where to store it, and no way to actually call it. + */ + QThreadData *data = QThreadData::current(); + id = data->tls.count(); + DEBUG_MSG("QThreadStorageData: Allocated id %d, destructor %p cannot be stored", id, func); + return; + } for (id = 0; id < destr->count(); id++) { if (destr->at(id) == 0) break; @@ -139,13 +154,15 @@ void **QThreadStorageData::set(void *p) data->thread); QMutexLocker locker(mutex()); - void (*destructor)(void *) = destructors()->value(id); + DestructorMap *destr = destructors(); + void (*destructor)(void *) = destr ? destr->value(id) : 0; locker.unlock(); void *q = value; value = 0; - destructor(q); + if (destructor) + destructor(q); } // store new data diff --git a/tests/auto/qthreadstorage/crashOnExit.cpp b/tests/auto/qthreadstorage/crashOnExit.cpp new file mode 100644 index 0000000..96515a0 --- /dev/null +++ b/tests/auto/qthreadstorage/crashOnExit.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include + +class Class +{ +public: + ~Class() + { + // trigger creation of a new QThreadStorage, after the previous QThreadStorage from main() was destructed + static QThreadStorage threadstorage; + threadstorage.setLocalData(new int); + threadstorage.setLocalData(new int); + } +}; + +int main() +{ + // instantiate the class that will use QThreadStorage from its destructor, it's destructor will be run last + static Class instance; + // instantiate QThreadStorage, it's destructor (and the global destructors for QThreadStorages internals) will run first + static QThreadStorage threadstorage; + threadstorage.setLocalData(new int); + threadstorage.setLocalData(new int); +} diff --git a/tests/auto/qthreadstorage/crashOnExit.pro b/tests/auto/qthreadstorage/crashOnExit.pro new file mode 100644 index 0000000..918ef39 --- /dev/null +++ b/tests/auto/qthreadstorage/crashOnExit.pro @@ -0,0 +1,4 @@ +SOURCES += crashOnExit.cpp +QT = core +CONFIG-=app_bundle +CONFIG+=console diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro index 3071098..a06f89c 100644 --- a/tests/auto/qthreadstorage/qthreadstorage.pro +++ b/tests/auto/qthreadstorage/qthreadstorage.pro @@ -1,4 +1,4 @@ -load(qttest_p4) -SOURCES += tst_qthreadstorage.cpp -QT = core -symbian:LIBS += -llibpthread +TEMPLATE = subdirs +SUBDIRS = \ + tst_qthreadstorage.pro \ + crashOnExit.pro diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp index d8b404f..097d729 100644 --- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp @@ -76,6 +76,7 @@ private slots: void autoDelete(); void adoptedThreads(); void ensureCleanupOrder(); + void QTBUG13877_crashOnExit(); }; class Pointer @@ -293,5 +294,13 @@ void tst_QThreadStorage::ensureCleanupOrder() QVERIFY(First::order < Second::order); } +void tst_QThreadStorage::QTBUG13877_crashOnExit() +{ + QProcess process; + process.start("./crashOnExit"); + QVERIFY(process.waitForFinished()); + QVERIFY(process.exitStatus() != QProcess::CrashExit); +} + QTEST_MAIN(tst_QThreadStorage) #include "tst_qthreadstorage.moc" diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.pro b/tests/auto/qthreadstorage/tst_qthreadstorage.pro new file mode 100644 index 0000000..3071098 --- /dev/null +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.pro @@ -0,0 +1,4 @@ +load(qttest_p4) +SOURCES += tst_qthreadstorage.cpp +QT = core +symbian:LIBS += -llibpthread -- cgit v0.12 From 83b4cad278e2c3b0ca16affc76a82ddce9d6149a Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 6 Oct 2010 13:46:15 +0200 Subject: tst_qtcpserver: Another attempt to reproduce QTBUG-14268 The test (un)fortunately passes :-) Task-number: QTBUG-14268 --- tests/auto/qtcpserver/tst_qtcpserver.cpp | 53 ++++++++++++++++++++++++++++++++ tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 15 ++++----- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index b2151b9..ab2a32d 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -105,6 +105,8 @@ private slots: void invalidProxy(); void proxyFactory_data(); void proxyFactory(); + + void qtbug14268_peek(); }; // Testing get/set functions @@ -662,5 +664,56 @@ void tst_QTcpServer::proxyFactory() QTEST(int(server.serverError()), "expectedError"); } +class Qtbug14268Helper : public QObject +{ + Q_OBJECT +public: + QByteArray lastDataPeeked; +public slots: + void newConnection() { + QTcpServer* server=static_cast(sender()); + QTcpSocket* s=server->nextPendingConnection(); + connect(s,SIGNAL(readyRead()),this,SLOT(onServerReadyRead())); + } + void onServerReadyRead() { + QTcpSocket* clientSocket=static_cast(sender()); + lastDataPeeked = clientSocket->peek(128*1024).toHex(); + QTestEventLoop::instance().exitLoop(); + } +}; + +// there is a similar test inside tst_qtcpsocket that uses the waitFor* functions instead +void tst_QTcpServer::qtbug14268_peek() +{ + QFETCH_GLOBAL(bool, setProxy); + if (setProxy) + return; + + QTcpServer server; + server.listen(); + + Qtbug14268Helper helper; + QObject::connect(&server, SIGNAL(newConnection()), &helper, SLOT(newConnection())); + + QTcpSocket client; + client.connectToHost(QHostAddress::LocalHost, server.serverPort()); + QVERIFY(client.waitForConnected(2000)); + + client.write("abc\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a")); + + client.write("def\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a")); + + client.write("ghi\n"); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a6768690a")); +} + QTEST_MAIN(tst_QTcpServer) #include "tst_qtcpserver.moc" diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 5b77006..2dbe5b7 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -2505,6 +2505,7 @@ void tst_QTcpSocket::proxyFactory() delete socket; } +// there is a similar test inside tst_qtcpserver that uses the event loop instead void tst_QTcpSocket::qtbug14268_peek() { QFETCH_GLOBAL(bool, setProxy); @@ -2519,22 +2520,22 @@ void tst_QTcpSocket::qtbug14268_peek() QVERIFY(incoming->state() == QTcpSocket::ConnectedState); QVERIFY(outgoing->state() == QTcpSocket::ConnectedState); - outgoing->write("abc"); + outgoing->write("abc\n"); QVERIFY(outgoing->waitForBytesWritten(2000)); QVERIFY(incoming->waitForReadyRead(2000)); - QVERIFY(incoming->peek(128*1024) == QByteArray("abc")); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\n")); - outgoing->write("def"); + outgoing->write("def\n"); QVERIFY(outgoing->waitForBytesWritten(2000)); QVERIFY(incoming->waitForReadyRead(2000)); - QVERIFY(incoming->peek(128*1024) == QByteArray("abcdef")); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\n")); - outgoing->write("ghi"); + outgoing->write("ghi\n"); QVERIFY(outgoing->waitForBytesWritten(2000)); QVERIFY(incoming->waitForReadyRead(2000)); - QVERIFY(incoming->peek(128*1024) == QByteArray("abcdefghi")); + QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\nghi\n")); - QVERIFY(incoming->read(128*1024) == QByteArray("abcdefghi")); + QVERIFY(incoming->read(128*1024) == QByteArray("abc\ndef\nghi\n")); } -- cgit v0.12 From 3874cd95e203da40d5205ef6455d7f56cba6923a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 6 Oct 2010 14:33:39 +0200 Subject: Fix GL glyph cache with broken-fbo-fallback When reading from the resized image, we have to use the actual width of the image, since we're reading the bits directly. This used to work because the width never changed. Reviewed-by: Gunnar --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 9a15260..b8576cb 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -164,7 +164,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) if (ctx->d_ptr->workaround_brokenFBOReadBack) { QImageTextureGlyphCache::resizeTextureData(width, height); Q_ASSERT(image().depth() == 8); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits()); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits()); glDeleteTextures(1, &oldTexture); return; } -- cgit v0.12 From e84ab1fee7f44a28ee82793f83b0b27d04d28c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 6 Oct 2010 14:19:44 +0200 Subject: QGraphicsItem device coordinate cache unefficient in portrait mode Problem was that we always invalidated the cache whenever the item was rotated. This is however not required for simple rotations such as 90, 180 and 270 degrees. This commit also removes the somewhat arbitrary logic which takes the desktop size into account. We now use the viewport size instead. Auto test included. Task-number: QT-3779 Reviewed-by: yoann --- src/gui/graphicsview/qgraphicsscene.cpp | 76 ++++++++++++++++++++------ tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 76 ++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 18 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e58b93c..a0015dc 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4362,6 +4362,50 @@ static void _q_paintIntoCache(QPixmap *pix, QGraphicsItem *item, const QRegion & } } +// Copied from qpaintengine_vg.cpp +// Returns true for 90, 180, and 270 degree rotations. +static inline bool transformIsSimple(const QTransform& transform) +{ + QTransform::TransformationType type = transform.type(); + if (type == QTransform::TxNone || type == QTransform::TxTranslate) { + return true; + } else if (type == QTransform::TxScale) { + // Check for 0 and 180 degree rotations. + // (0 might happen after 4 rotations of 90 degrees). + qreal m11 = transform.m11(); + qreal m12 = transform.m12(); + qreal m21 = transform.m21(); + qreal m22 = transform.m22(); + if (m12 == 0.0f && m21 == 0.0f) { + if (m11 == 1.0f && m22 == 1.0f) + return true; // 0 degrees + else if (m11 == -1.0f && m22 == -1.0f) + return true; // 180 degrees. + if(m11 == 1.0f && m22 == -1.0f) + return true; // 0 degrees inverted y. + else if(m11 == -1.0f && m22 == 1.0f) + return true; // 180 degrees inverted y. + } + } else if (type == QTransform::TxRotate) { + // Check for 90, and 270 degree rotations. + qreal m11 = transform.m11(); + qreal m12 = transform.m12(); + qreal m21 = transform.m21(); + qreal m22 = transform.m22(); + if (m11 == 0.0f && m22 == 0.0f) { + if (m12 == 1.0f && m21 == -1.0f) + return true; // 90 degrees. + else if (m12 == -1.0f && m21 == 1.0f) + return true; // 270 degrees. + else if (m12 == -1.0f && m21 == -1.0f) + return true; // 90 degrees inverted y. + else if (m12 == 1.0f && m21 == 1.0f) + return true; // 270 degrees inverted y. + } + } + return false; +} + /*! \internal @@ -4530,32 +4574,28 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte if (invertable) diff *= painter->worldTransform(); deviceData->lastTransform = painter->worldTransform(); - if (!invertable - || diff.type() > QTransform::TxTranslate - || painter->worldTransform().type() > QTransform::TxScale) { + bool allowPartialCacheExposure = false; + bool simpleTransform = invertable && diff.type() <= QTransform::TxTranslate + && transformIsSimple(painter->worldTransform()); + if (!simpleTransform) { pixModified = true; itemCache->allExposed = true; itemCache->exposed.clear(); + deviceData->cacheIndent = QPoint(); pix = QPixmap(); + } else { + allowPartialCacheExposure = deviceData->cacheIndent != QPoint(); } - // ### This is a pretty bad way to determine when to start partial - // exposure for DeviceCoordinateCache but it's the least intrusive - // approach for now. -#if 0 - // Only if the device rect isn't fully contained. - bool allowPartialCacheExposure = !viewRect.contains(deviceRect); -#else - // Only if deviceRect is 20% taller or wider than the desktop. - bool allowPartialCacheExposure = false; - if (widget) { - QRect desktopRect = QApplication::desktop()->availableGeometry(widget); - allowPartialCacheExposure = (desktopRect.width() * 1.2 < deviceRect.width() - || desktopRect.height() * 1.2 < deviceRect.height()); + // Allow partial cache exposure if the device rect isn't fully contained and + // deviceRect is 20% taller or wider than the viewRect. + if (!allowPartialCacheExposure && !viewRect.contains(deviceRect)) { + allowPartialCacheExposure = (viewRect.width() * 1.2 < deviceRect.width()) + || (viewRect.height() * 1.2 < deviceRect.height()); } -#endif + QRegion scrollExposure; - if (deviceData->cacheIndent != QPoint() || allowPartialCacheExposure) { + if (allowPartialCacheExposure) { // Part of pixmap is drawn. Either device contains viewrect (big // item covers whole screen) or parts of device are outside the // viewport. In either case the device rect must be the intersect diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 25ec040..2901dd5 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -445,6 +445,7 @@ private slots: void textItem_shortcuts(); void scroll(); void stopClickFocusPropagation(); + void deviceCoordinateCache_simpleRotations(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -10560,6 +10561,81 @@ void tst_QGraphicsItem::stopClickFocusPropagation() QVERIFY(itemWithFocus->hasFocus()); } +void tst_QGraphicsItem::deviceCoordinateCache_simpleRotations() +{ + // Make sure we don't invalidate the cache when applying simple + // (90, 180, 270, 360) rotation transforms to the item. + QGraphicsRectItem *item = new QGraphicsRectItem(0, 0, 300, 200); + item->setBrush(Qt::red); + item->setCacheMode(QGraphicsItem::DeviceCoordinateCache); + + QGraphicsScene scene; + scene.setSceneRect(0, 0, 300, 200); + scene.addItem(item); + + MyGraphicsView view(&scene); + view.show(); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.repaints > 0); + + QGraphicsItemCache *itemCache = QGraphicsItemPrivate::get(item)->extraItemCache(); + Q_ASSERT(itemCache); + QPixmapCache::Key currentKey = itemCache->deviceData.value(view.viewport()).key; + + // Trigger an update and verify that the cache is unchanged. + QPixmapCache::Key oldKey = currentKey; + view.reset(); + view.viewport()->update(); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QCOMPARE(currentKey, oldKey); + + // Check 90, 180, 270 and 360 degree rotations. + for (int angle = 90; angle <= 360; angle += 90) { + // Rotate item and verify that the cache was invalidated. + oldKey = currentKey; + view.reset(); + QTransform transform; + transform.translate(150, 100); + transform.rotate(angle); + transform.translate(-150, -100); + item->setTransform(transform); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QVERIFY(currentKey != oldKey); + + // IMPORTANT PART: + // Trigger an update and verify that the cache is unchanged. + oldKey = currentKey; + view.reset(); + view.viewport()->update(); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QCOMPARE(currentKey, oldKey); + } + + // 45 degree rotation. + oldKey = currentKey; + view.reset(); + QTransform transform; + transform.translate(150, 100); + transform.rotate(45); + transform.translate(-150, -100); + item->setTransform(transform); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QVERIFY(currentKey != oldKey); + + // Trigger an update and verify that the cache was invalidated. + // We should always invalidate the cache for non-trivial transforms. + oldKey = currentKey; + view.reset(); + view.viewport()->update(); + QTRY_VERIFY(view.repaints > 0); + currentKey = itemCache->deviceData.value(view.viewport()).key; + QVERIFY(currentKey != oldKey); +} + void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor() { struct Item : public QGraphicsTextItem -- cgit v0.12 From 0ece9b7f45e2cda9dfeb8dbab9b51ad39433c07e Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:30 +0200 Subject: Refactored PreviewWidget in qtconfig Removed the legacy code and behavior. Now this part of qtconfig doesn't need the qt3support module to be built. Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/main.cpp | 1 - tools/qtconfig/previewwidget.cpp | 15 +- tools/qtconfig/previewwidget.h | 12 +- tools/qtconfig/previewwidget.ui | 268 +++++++++++++++++++++++++++ tools/qtconfig/previewwidgetbase.cpp | 88 --------- tools/qtconfig/previewwidgetbase.h | 68 ------- tools/qtconfig/previewwidgetbase.ui | 340 ----------------------------------- tools/qtconfig/qtconfig.pro | 6 +- 8 files changed, 285 insertions(+), 513 deletions(-) create mode 100644 tools/qtconfig/previewwidget.ui delete mode 100644 tools/qtconfig/previewwidgetbase.cpp delete mode 100644 tools/qtconfig/previewwidgetbase.h delete mode 100644 tools/qtconfig/previewwidgetbase.ui diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp index 928cf01..47b0994 100644 --- a/tools/qtconfig/main.cpp +++ b/tools/qtconfig/main.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include "ui_previewwidgetbase.h" #include "mainwindow.h" #include #include diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp index 757b448..9fa9591 100644 --- a/tools/qtconfig/previewwidget.cpp +++ b/tools/qtconfig/previewwidget.cpp @@ -44,15 +44,16 @@ QT_BEGIN_NAMESPACE -PreviewWidget::PreviewWidget( QWidget *parent, const char *name ) - : PreviewWidgetBase( parent, name ) +PreviewWidget::PreviewWidget(QWidget *parent) + : QWidget(parent) { + setupUi(this); + // install event filter on child widgets - QObjectList l = queryList("QWidget"); - for (int i = 0; i < l.size(); ++i) { - QObject * obj = l.at(i); - obj->installEventFilter(this); - ((QWidget*)obj)->setFocusPolicy(Qt::NoFocus); + QList l = findChildren(); + foreach(QWidget* w, l) { + w->installEventFilter(this); + w->setFocusPolicy(Qt::NoFocus); } } diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index 37e9cba..ee5ae02 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -42,21 +42,21 @@ #ifndef PREVIEWWIDGET_H #define PREVIEWWIDGET_H -#include "previewwidgetbase.h" +#include "ui_previewwidget.h" QT_BEGIN_NAMESPACE -class PreviewWidget : public PreviewWidgetBase +class PreviewWidget : public QWidget, public Ui::PreviewWidget { Q_OBJECT public: - PreviewWidget( QWidget *parent = 0, const char *name = 0 ); + PreviewWidget(QWidget* parent = 0); - void closeEvent(QCloseEvent *); - bool eventFilter(QObject *, QEvent *); + void closeEvent(QCloseEvent*); + bool eventFilter(QObject*, QEvent*); }; QT_END_NAMESPACE -#endif +#endif // PREVIEWWIDGET_H diff --git a/tools/qtconfig/previewwidget.ui b/tools/qtconfig/previewwidget.ui new file mode 100644 index 0000000..12de30d --- /dev/null +++ b/tools/qtconfig/previewwidget.ui @@ -0,0 +1,268 @@ + + + ********************************************************************* +** +** 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 tools applications 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$ +** +********************************************************************* + PreviewWidget + + + + 0 + 0 + 414 + 318 + + + + + 0 + 0 + + + + Preview Window + + + + 6 + + + 11 + + + + + 6 + + + 0 + + + + + 6 + + + 0 + + + + + GroupBox + + + + 6 + + + 11 + + + + + RadioButton1 + + + true + + + + + + + RadioButton2 + + + + + + + RadioButton3 + + + + + + + + + + GroupBox2 + + + + 6 + + + 11 + + + + + CheckBox1 + + + true + + + + + + + CheckBox2 + + + + + + + + + + 50 + + + + + + + + + 6 + + + 0 + + + + + LineEdit + + + + + + + + ComboBox + + + + + + + + 6 + + + 0 + + + + + + + + PushButton + + + + + + + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + + + + + 32767 + 50 + + + + true + + + <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> + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + + diff --git a/tools/qtconfig/previewwidgetbase.cpp b/tools/qtconfig/previewwidgetbase.cpp deleted file mode 100644 index 9234b6f..0000000 --- a/tools/qtconfig/previewwidgetbase.cpp +++ /dev/null @@ -1,88 +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 tools applications 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 "previewwidgetbase.h" - -#include - -QT_BEGIN_NAMESPACE - -/* - * Constructs a PreviewWidgetBase as a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - */ -PreviewWidgetBase::PreviewWidgetBase(QWidget* parent, const char* name, Qt::WindowFlags fl) - : QWidget(parent, name, fl) -{ - setupUi(this); - - - // signals and slots connections - init(); -} - -/* - * Destroys the object and frees any allocated resources - */ -PreviewWidgetBase::~PreviewWidgetBase() -{ - destroy(); - // no need to delete child widgets, Qt does it all for us -} - -/* - * Sets the strings of the subwidgets using the current - * language. - */ -void PreviewWidgetBase::languageChange() -{ - retranslateUi(this); -} - -void PreviewWidgetBase::init() -{ -} - -void PreviewWidgetBase::destroy() -{ -} - -QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidgetbase.h b/tools/qtconfig/previewwidgetbase.h deleted file mode 100644 index 829415e..0000000 --- a/tools/qtconfig/previewwidgetbase.h +++ /dev/null @@ -1,68 +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 tools applications 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 PREVIEWWIDGETBASE_H -#define PREVIEWWIDGETBASE_H - -#include "ui_previewwidgetbase.h" -#include - -QT_BEGIN_NAMESPACE - -class PreviewWidgetBase : public QWidget, public Ui::PreviewWidgetBase -{ - Q_OBJECT - -public: - PreviewWidgetBase(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = 0); - ~PreviewWidgetBase(); - -protected slots: - virtual void languageChange(); - - virtual void init(); - virtual void destroy(); - -}; - -QT_END_NAMESPACE - -#endif // PREVIEWWIDGETBASE_H diff --git a/tools/qtconfig/previewwidgetbase.ui b/tools/qtconfig/previewwidgetbase.ui deleted file mode 100644 index 701bf84..0000000 --- a/tools/qtconfig/previewwidgetbase.ui +++ /dev/null @@ -1,340 +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 tools applications 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$ -** -********************************************************************* - - PreviewWidgetBase - - - PreviewWidgetBase - - - - 0 - 0 - 378 - 236 - - - - - 1 - 1 - 0 - 0 - - - - Preview Window - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - ButtonGroup1 - - - ButtonGroup - - - - unnamed - - - 11 - - - 6 - - - - - RadioButton1 - - - RadioButton1 - - - true - - - - - - - RadioButton2 - - - RadioButton2 - - - - - - - RadioButton3 - - - RadioButton3 - - - - - - - - - - ButtonGroup2 - - - ButtonGroup2 - - - - unnamed - - - 11 - - - 6 - - - - - CheckBox1 - - - CheckBox1 - - - true - - - - - - - CheckBox2 - - - CheckBox2 - - - - - - - - - - ProgressBar1 - - - 50 - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - LineEdit1 - - - LineEdit - - - - - - - ComboBox1 - - - - ComboBox - - - - - - - - unnamed - - - 0 - - - 6 - - - - - SpinBox1 - - - - - - - PushButton1 - - - PushButton - - - - - - - - - ScrollBar1 - - - Qt::Horizontal - - - - - - - Slider1 - - - Qt::Horizontal - - - - - - - textView - - - - 32767 - 50 - - - - true - - - <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> - - - - - - - - - - - - 20 - 20 - - - - Expanding - - - Vertical - - - - - - qPixmapFromMimeSource - diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index d1fd320..b0f2563 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -14,11 +14,11 @@ contains(QT_CONFIG, phonon) { DEFINES += HAVE_PHONON } SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \ - mainwindowbase.cpp paletteeditoradvancedbase.cpp previewwidgetbase.cpp + mainwindowbase.cpp paletteeditoradvancedbase.cpp HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \ - mainwindowbase.h paletteeditoradvancedbase.h previewwidgetbase.h + mainwindowbase.h paletteeditoradvancedbase.h -FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidgetbase.ui +FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidget.ui RESOURCES = qtconfig.qrc PROJECTNAME = Qt Configuration -- cgit v0.12 From 24ea581ffff713a591157b6ca3d4749824020a0a Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:31 +0200 Subject: Removed more legacy code from qtconfig and fixed codestyle issues Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/previewframe.cpp | 15 +++++++-------- tools/qtconfig/previewframe.h | 10 +++++----- tools/qtconfig/previewwidget.cpp | 4 ++-- tools/qtconfig/previewwidget.h | 6 +++--- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp index 3b46e8d..95d64cf 100644 --- a/tools/qtconfig/previewframe.cpp +++ b/tools/qtconfig/previewframe.cpp @@ -47,8 +47,8 @@ QT_BEGIN_NAMESPACE -PreviewFrame::PreviewFrame( QWidget *parent, const char *name ) - : QFrame( parent, name ) +PreviewFrame::PreviewFrame(QWidget *parent) + : QFrame(parent) { setMinimumSize(200, 200); setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); @@ -82,23 +82,22 @@ void PreviewFrame::setPreviewVisible(bool visible) workspace->viewport()->update(); } -Workspace::Workspace(PreviewFrame* parent, const char* name) +Workspace::Workspace(PreviewFrame* parent) : QMdiArea(parent) { previewFrame = parent; PreviewWidget *previewWidget = previewFrame->widget(); - setObjectName(QLatin1String(name)); QMdiSubWindow *frame = addSubWindow(previewWidget, Qt::Window); - frame->move(10,10); + frame->move(10, 10); frame->show(); } void Workspace::paintEvent( QPaintEvent* ) { - QPainter p (viewport()); + QPainter p(viewport()); p.fillRect(rect(), palette().color(backgroundRole()).dark()); - p.setPen( QPen( Qt::white ) ); - p.drawText ( 0, height() / 2, width(), height(), Qt::AlignHCenter, previewFrame->previewText()); + p.setPen(QPen(Qt::white)); + p.drawText(0, height() / 2, width(), height(), Qt::AlignHCenter, previewFrame->previewText()); } QT_END_NAMESPACE diff --git a/tools/qtconfig/previewframe.h b/tools/qtconfig/previewframe.h index de364e4..b21e529 100644 --- a/tools/qtconfig/previewframe.h +++ b/tools/qtconfig/previewframe.h @@ -54,11 +54,11 @@ class Workspace : public QMdiArea Q_OBJECT public: - Workspace( PreviewFrame* parent = 0, const char* name = 0 ); + Workspace(PreviewFrame *parent = 0); ~Workspace() {} protected: - void paintEvent( QPaintEvent* ); + void paintEvent(QPaintEvent *); private: PreviewFrame *previewFrame; }; @@ -68,14 +68,14 @@ class PreviewFrame : public QFrame Q_OBJECT public: - PreviewFrame( QWidget *parent = 0, const char *name = 0 ); + PreviewFrame(QWidget *parent = 0); void setPreviewPalette(QPalette); void setPreviewVisible(bool val); QString previewText() const; PreviewWidget *widget() const { return previewWidget; } private: - Workspace *workspace; - PreviewWidget *previewWidget; + Workspace *workspace; + PreviewWidget *previewWidget; QString m_previewWindowText; }; diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp index 9fa9591..abbf669 100644 --- a/tools/qtconfig/previewwidget.cpp +++ b/tools/qtconfig/previewwidget.cpp @@ -50,8 +50,8 @@ PreviewWidget::PreviewWidget(QWidget *parent) setupUi(this); // install event filter on child widgets - QList l = findChildren(); - foreach(QWidget* w, l) { + QList l = findChildren(); + foreach(QWidget *w, l) { w->installEventFilter(this); w->setFocusPolicy(Qt::NoFocus); } diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index ee5ae02..1452932 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -51,10 +51,10 @@ class PreviewWidget : public QWidget, public Ui::PreviewWidget Q_OBJECT public: - PreviewWidget(QWidget* parent = 0); + PreviewWidget(QWidget *parent = 0); - void closeEvent(QCloseEvent*); - bool eventFilter(QObject*, QEvent*); + void closeEvent(QCloseEvent *); + bool eventFilter(QObject *, QEvent *); }; QT_END_NAMESPACE -- cgit v0.12 From 10c33f225c65517a481610c3373ecd16f0f6dcdf Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:32 +0200 Subject: Refactored PaletteEditorAdvanced in qtconfig The widget was redrawn and now makes use of QDialogButtonBox. The ColorButton's are created more correctly for now. Also, all of the Qt4 ColorRoles are now supported. All the legacy code was dropped so it must not depend of qt3support. Some refactoring job also was done and much of unused code was removed. Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 5 +- tools/qtconfig/paletteeditoradvanced.cpp | 541 ++++++++--------------- tools/qtconfig/paletteeditoradvanced.h | 60 ++- tools/qtconfig/paletteeditoradvanced.ui | 416 ++++++++++++++++++ tools/qtconfig/paletteeditoradvancedbase.cpp | 144 ------- tools/qtconfig/paletteeditoradvancedbase.h | 78 ---- tools/qtconfig/paletteeditoradvancedbase.ui | 617 --------------------------- tools/qtconfig/qtconfig.pro | 6 +- 8 files changed, 623 insertions(+), 1244 deletions(-) create mode 100644 tools/qtconfig/paletteeditoradvanced.ui delete mode 100644 tools/qtconfig/paletteeditoradvancedbase.cpp delete mode 100644 tools/qtconfig/paletteeditoradvancedbase.h delete mode 100644 tools/qtconfig/paletteeditoradvancedbase.ui diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 9675f99..3895418 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -753,9 +753,8 @@ void MainWindow::updateColorButtons() void MainWindow::tunePalette() { bool ok; - QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, - backgroundMode(), this); - if (! ok) + QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, backgroundRole(), this); + if (!ok) return; editPalette = pal; diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index 2728557..fa108e7 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -42,26 +42,41 @@ #include "paletteeditoradvanced.h" #include "colorbutton.h" -#include -#include -#include -#include -#include -#include - QT_BEGIN_NAMESPACE -PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent, - const char * name, bool modal, Qt::WindowFlags f ) - : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0) +PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent) + : QDialog(parent), selectedPalette(0) { - // work around buggy UI file - comboEffect->setEnabled(false); + setupUi(this); + + // create a ColorButton's + buttonCentral = new ColorButton(groupCentral); + buttonCentral->setToolTip(tr("Choose a color")); + buttonCentral->setWhatsThis(tr("Choose a color for the selected central color role.")); + layoutCentral->addWidget(buttonCentral); + labelCentral->setBuddy(buttonCentral); + + buttonEffect = new ColorButton(groupEffect); + buttonEffect->setToolTip(tr("Choose a color")); + buttonEffect->setWhatsThis(tr("Choose a color for the selected effect color role.")); buttonEffect->setEnabled(false); + layoutEffect->addWidget(buttonEffect); + labelEffect->setBuddy(buttonEffect); + + // signals and slots connections + connect(paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); + connect(comboCentral, SIGNAL(activated(int)), SLOT(onCentral(int))); + connect(buttonCentral, SIGNAL(clicked()), SLOT(onChooseCentralColor())); + connect(buttonEffect, SIGNAL(clicked()), SLOT(onChooseEffectColor())); + connect(comboEffect, SIGNAL(activated(int)), SLOT(onEffect(int))); + connect(checkBuildEffect, SIGNAL(toggled(bool)), SLOT(onToggleBuildEffects(bool))); + connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); + connect(checkBuildInactive, SIGNAL(toggled(bool)), SLOT(onToggleBuildInactive(bool))); + connect(checkBuildDisabled, SIGNAL(toggled(bool)), SLOT(onToggleBuildDisabled(bool))); + onToggleBuildEffects(true); editPalette = QApplication::palette(); - setPreviewPalette( editPalette ); } PaletteEditorAdvanced::~PaletteEditorAdvanced() @@ -76,12 +91,12 @@ void PaletteEditorAdvanced::onToggleBuildInactive( bool v ) } if (v) { - buildInactive(); + build(QPalette::Inactive); updateColorButtons(); } } -void PaletteEditorAdvanced::onToggleBuildDisabled( bool v ) +void PaletteEditorAdvanced::onToggleBuildDisabled(bool v) { if (selectedPalette == 2) { groupCentral->setDisabled(v); @@ -89,7 +104,7 @@ void PaletteEditorAdvanced::onToggleBuildDisabled( bool v ) } if (v) { - buildDisabled(); + build(QPalette::Disabled); updateColorButtons(); } } @@ -115,385 +130,192 @@ void PaletteEditorAdvanced::paletteSelected(int p) void PaletteEditorAdvanced::onChooseCentralColor() { - switch(selectedPalette) { - case 0: - default: - mapToActiveCentralRole( buttonCentral->color() ); - break; - case 1: - mapToInactiveCentralRole( buttonCentral->color() ); - break; - case 2: - mapToDisabledCentralRole( buttonCentral->color() ); - break; + QPalette::ColorGroup group = groupFromIndex(selectedPalette); + editPalette.setColor(group, centralFromIndex(comboCentral->currentIndex()), + buttonCentral->color()); + + buildEffect(group); + if (group == QPalette::Active) { + if(checkBuildInactive->isChecked()) + build(QPalette::Inactive); + if(checkBuildDisabled->isChecked()) + build(QPalette::Disabled); } + updateColorButtons(); } void PaletteEditorAdvanced::onChooseEffectColor() { - switch(selectedPalette) { - case 0: - default: - mapToActiveEffectRole( buttonEffect->color() ); - break; - case 1: - mapToInactiveEffectRole( buttonEffect->color() ); - break; - case 2: - mapToDisabledEffectRole( buttonEffect->color() ); - break; + QPalette::ColorGroup group = groupFromIndex(selectedPalette); + editPalette.setColor(group, effectFromIndex(comboEffect->currentIndex()), + buttonEffect->color()); + + if (group == QPalette::Active) { + if(checkBuildInactive->isChecked()) + build(QPalette::Inactive); + if(checkBuildDisabled->isChecked()) + build(QPalette::Disabled); } + updateColorButtons(); } -void PaletteEditorAdvanced::onToggleBuildEffects( bool on ) +void PaletteEditorAdvanced::onToggleBuildEffects(bool on) { - if (!on) return; - buildActiveEffect(); - buildInactiveEffect(); - buildDisabledEffect(); + if (on) { + for (int i = 0; i < QPalette::NColorGroups; i++) + buildEffect(QPalette::ColorGroup(i)); + } } -QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item ) +QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item) { switch( item ) { - case 0: - return QColorGroup::Window; - case 1: - return QColorGroup::WindowText; - case 2: - return QColorGroup::Button; - case 3: - return QColorGroup::Base; - case 4: - return QColorGroup::Text; - case 5: - return QColorGroup::BrightText; - case 6: - return QColorGroup::ButtonText; - case 7: - return QColorGroup::Highlight; - case 8: - return QColorGroup::HighlightedText; - default: - return QColorGroup::NColorRoles; + case 0: + default: + return QPalette::Active; + case 1: + return QPalette::Inactive; + case 2: + return QPalette::Disabled; } } -QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item ) + +QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item) { switch( item ) { case 0: - return QColorGroup::Light; + return QPalette::Window; case 1: - return QColorGroup::Midlight; + return QPalette::WindowText; case 2: - return QColorGroup::Mid; + return QPalette::Base; case 3: - return QColorGroup::Dark; + return QPalette::AlternateBase; case 4: - return QColorGroup::Shadow; + return QPalette::ToolTipBase; + case 5: + return QPalette::ToolTipText; + case 6: + return QPalette::Text; + case 7: + return QPalette::Button; + case 8: + return QPalette::ButtonText; + case 9: + return QPalette::BrightText; + case 10: + return QPalette::Highlight; + case 11: + return QPalette::HighlightedText; + case 12: + return QPalette::Link; + case 13: + return QPalette::LinkVisited; default: - return QColorGroup::NColorRoles; + return QPalette::NoRole; } } -void PaletteEditorAdvanced::onCentral( int item ) +QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item) { - QColor c; - - switch(selectedPalette) { + switch( item ) { case 0: - default: - c = editPalette.active().color( centralFromItem(item) ); - break; + return QPalette::Light; case 1: - c = editPalette.inactive().color( centralFromItem(item) ); - break; + return QPalette::Midlight; case 2: - c = editPalette.disabled().color( centralFromItem(item) ); - break; - } - - buttonCentral->setColor(c); -} - -void PaletteEditorAdvanced::onEffect( int item ) -{ - QColor c; - switch(selectedPalette) { - case 0: + return QPalette::Mid; + case 3: + return QPalette::Dark; + case 4: + return QPalette::Shadow; default: - c = editPalette.active().color( effectFromItem(item) ); - break; - case 1: - editPalette.inactive().color( effectFromItem(item) ); - break; - case 2: - editPalette.disabled().color( effectFromItem(item) ); - break; + return QPalette::NoRole; } - buttonEffect->setColor(c); -} - -void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c ) -{ - QColorGroup cg = editPalette.active(); - cg.setColor( centralFromItem(comboCentral->currentItem()), c ); - editPalette.setActive( cg ); - - buildActiveEffect(); - if(checkBuildInactive->isChecked()) - buildInactive(); - if(checkBuildDisabled->isChecked()) - buildDisabled(); - - setPreviewPalette( editPalette ); -} - -void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c ) -{ - QColorGroup cg = editPalette.active(); - cg.setColor( effectFromItem(comboEffect->currentItem()), c ); - editPalette.setActive( cg ); - - if(checkBuildInactive->isChecked()) - buildInactive(); - if(checkBuildDisabled->isChecked()) - buildDisabled(); - - setPreviewPalette( editPalette ); -} - -void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm ) -{ - QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); - QColorGroup cg = editPalette.active(); - if ( !pm.isNull() ) - cg.setBrush( role, QBrush( cg.color( role ), pm ) ); - else - cg.setBrush( role, QBrush( cg.color( role ) ) ); - editPalette.setActive( cg ); - - - buildActiveEffect(); - if(checkBuildInactive->isChecked()) - buildInactive(); - if(checkBuildDisabled->isChecked()) - buildDisabled(); - - setPreviewPalette( editPalette ); -} - -void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c ) -{ - QColorGroup cg = editPalette.inactive(); - cg.setColor( centralFromItem(comboCentral->currentItem()), c ); - editPalette.setInactive( cg ); - - buildInactiveEffect(); - - setPreviewPalette( editPalette ); } -void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c ) +void PaletteEditorAdvanced::onCentral(int item) { - QColorGroup cg = editPalette.inactive(); - cg.setColor( effectFromItem(comboEffect->currentItem()), c ); - editPalette.setInactive( cg ); - - setPreviewPalette( editPalette ); -} - -void PaletteEditorAdvanced::mapToInactivePixmapRole( const QPixmap& pm ) -{ - QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); - QColorGroup cg = editPalette.inactive(); - if ( !pm.isNull() ) - cg.setBrush( role, QBrush( cg.color( role ), pm ) ); - else - cg.setBrush( role, QBrush( cg.color( role ) ) ); - editPalette.setInactive( cg ); - - setPreviewPalette( editPalette ); -} - -void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c ) -{ - QColorGroup cg = editPalette.disabled(); - cg.setColor( centralFromItem(comboCentral->currentItem()), c ); - editPalette.setDisabled( cg ); - - buildDisabledEffect(); - - setPreviewPalette( editPalette ); -} - -void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c ) -{ - QColorGroup cg = editPalette.disabled(); - cg.setColor( effectFromItem(comboEffect->currentItem()), c ); - editPalette.setDisabled( cg ); - - setPreviewPalette( editPalette ); + QColor c = editPalette.color(groupFromIndex(selectedPalette), centralFromIndex(item)); + buttonCentral->setColor(c); } -void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm ) +void PaletteEditorAdvanced::onEffect(int item) { - QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); - QColorGroup cg = editPalette.disabled(); - if ( !pm.isNull() ) - cg.setBrush( role, QBrush( cg.color( role ), pm ) ); - else - cg.setBrush( role, QBrush( cg.color( role ) ) ); - - editPalette.setDisabled( cg ); - - setPreviewPalette( editPalette ); + QColor c = editPalette.color(groupFromIndex(selectedPalette), effectFromIndex(item)); + buttonEffect->setColor(c); } -void PaletteEditorAdvanced::buildActiveEffect() +QPalette PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup, + const QPalette &basePalette) { - QColorGroup cg = editPalette.active(); - QColor btn = cg.color( QColorGroup::Button ); + QPalette result(basePalette); - QPalette temp( btn, btn ); + if (colorGroup == QPalette::Active) { + QPalette calculatedPalette(basePalette.color(colorGroup, QPalette::Button), + basePalette.color(colorGroup, QPalette::Window)); - for (int i = 0; i<5; i++) - cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) ); - - editPalette.setActive( cg ); - setPreviewPalette( editPalette ); - - updateColorButtons(); -} - -void PaletteEditorAdvanced::buildInactive() -{ - editPalette.setInactive( editPalette.active() ); - if ( checkBuildEffect->isChecked() ) - buildInactiveEffect(); + for (int i = 0; i < 5; i++) { + QPalette::ColorRole effectRole = effectFromIndex(i); + result.setColor(colorGroup, effectRole, + calculatedPalette.color(colorGroup, effectRole)); + } + } else { - setPreviewPalette( editPalette ); - updateColorButtons(); + QColor btn = basePalette.color(colorGroup, QPalette::Button); + + result.setColor(colorGroup, QPalette::Light, btn.lighter()); + result.setColor(colorGroup, QPalette::Midlight, btn.lighter(115)); + result.setColor(colorGroup, QPalette::Mid, btn.darker(150)); + result.setColor(colorGroup, QPalette::Dark, btn.darker()); + result.setColor(colorGroup, QPalette::Shadow, Qt::black); } + return result; } -void PaletteEditorAdvanced::buildInactiveEffect() +void PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup) { - QColorGroup cg = editPalette.inactive(); - - QColor light, midlight, mid, dark, shadow; - QColor btn = cg.color( QColorGroup::Button ); - - light = btn.light(150); - midlight = btn.light(115); - mid = btn.dark(150); - dark = btn.dark(); - shadow = Qt::black; - - cg.setColor( QColorGroup::Light, light ); - cg.setColor( QColorGroup::Midlight, midlight ); - cg.setColor( QColorGroup::Mid, mid ); - cg.setColor( QColorGroup::Dark, dark ); - cg.setColor( QColorGroup::Shadow, shadow ); - - editPalette.setInactive( cg ); - setPreviewPalette( editPalette ); + editPalette = buildEffect(colorGroup, editPalette); updateColorButtons(); } -void PaletteEditorAdvanced::buildDisabled() +void PaletteEditorAdvanced::build(QPalette::ColorGroup colorGroup) { - QColorGroup cg = editPalette.active(); - cg.setColor( QColorGroup::ButtonText, Qt::darkGray ); - cg.setColor( QColorGroup::WindowText, Qt::darkGray ); - cg.setColor( QColorGroup::Text, Qt::darkGray ); - cg.setColor( QColorGroup::HighlightedText, Qt::darkGray ); - editPalette.setDisabled( cg ); - - if ( checkBuildEffect->isChecked() ) - buildDisabledEffect(); - else { - setPreviewPalette( editPalette ); - updateColorButtons(); - } -} - -void PaletteEditorAdvanced::buildDisabledEffect() -{ - QColorGroup cg = editPalette.disabled(); - - QColor light, midlight, mid, dark, shadow; - QColor btn = cg.color( QColorGroup::Button ); - - light = btn.light(150); - midlight = btn.light(115); - mid = btn.dark(150); - dark = btn.dark(); - shadow = Qt::black; + if (colorGroup != QPalette::Active) { + for (int i = 0; i < QPalette::NColorRoles; i++) + editPalette.setColor(colorGroup, QPalette::ColorRole(i), + editPalette.color(QPalette::Active, QPalette::ColorRole(i))); - cg.setColor( QColorGroup::Light, light ); - cg.setColor( QColorGroup::Midlight, midlight ); - cg.setColor( QColorGroup::Mid, mid ); - cg.setColor( QColorGroup::Dark, dark ); - cg.setColor( QColorGroup::Shadow, shadow ); + if (colorGroup == QPalette::Disabled) { + editPalette.setColor(colorGroup, QPalette::ButtonText, Qt::darkGray); + editPalette.setColor(colorGroup, QPalette::WindowText, Qt::darkGray); + editPalette.setColor(colorGroup, QPalette::Text, Qt::darkGray); + editPalette.setColor(colorGroup, QPalette::HighlightedText, Qt::darkGray); + } - editPalette.setDisabled( cg ); - setPreviewPalette( editPalette ); - updateColorButtons(); -} - -void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal ) -{ - QColorGroup cg; - - switch (selectedPalette) { - case 0: - default: - cg = pal.active(); - break; - case 1: - cg = pal.inactive(); - break; - case 2: - cg = pal.disabled(); - break; + if (checkBuildEffect->isChecked()) + buildEffect(colorGroup); + else + updateColorButtons(); } - previewPalette.setActive( cg ); - previewPalette.setInactive( cg ); - previewPalette.setDisabled( cg ); } void PaletteEditorAdvanced::updateColorButtons() { - QColor central, effect; - switch (selectedPalette) { - case 0: - default: - central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) ); - effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) ); - break; - case 1: - central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) ); - effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) ); - break; - case 2: - central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) ); - effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) ); - break; - } - - buttonCentral->setColor(central); - buttonEffect->setColor(effect); + QPalette::ColorGroup colorGroup = groupFromIndex(selectedPalette); + buttonCentral->setColor(editPalette.color(colorGroup, + centralFromIndex(comboCentral->currentIndex()))); + buttonEffect->setColor(editPalette.color(colorGroup, + effectFromIndex(comboEffect->currentIndex()))); } -void PaletteEditorAdvanced::setPal( const QPalette& pal ) +void PaletteEditorAdvanced::setPal(const QPalette &pal) { editPalette = pal; - setPreviewPalette( pal ); updateColorButtons(); } @@ -502,51 +324,51 @@ QPalette PaletteEditorAdvanced::pal() const return editPalette; } -void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode ) +void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role) { int initRole = 0; - switch( mode ) { - case Qt::PaletteBackground: + switch(role) { + case QPalette::Window: initRole = 0; break; - case Qt::PaletteForeground: + case QPalette::WindowText: initRole = 1; break; - case Qt::PaletteButton: + case QPalette::Base: initRole = 2; break; - case Qt::PaletteBase: + case QPalette::AlternateBase: initRole = 3; break; - case Qt::PaletteText: + case QPalette::ToolTipBase: initRole = 4; break; - case Qt::PaletteBrightText: + case QPalette::ToolTipText: initRole = 5; break; - case Qt::PaletteButtonText: + case QPalette::Text: initRole = 6; break; - case Qt::PaletteHighlight: + case QPalette::Button: initRole = 7; break; - case Qt::PaletteHighlightedText: + case QPalette::ButtonText: initRole = 8; break; - case Qt::PaletteLight: + case QPalette::BrightText: initRole = 9; break; - case Qt::PaletteMidlight: + case QPalette::Highlight: initRole = 10; break; - case Qt::PaletteDark: + case QPalette::HighlightedText: initRole = 11; break; - case Qt::PaletteMid: + case QPalette::Link: initRole = 12; break; - case Qt::PaletteShadow: + case QPalette::LinkVisited: initRole = 13; break; default: @@ -554,36 +376,27 @@ void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode ) break; } - if ( initRole <= -1 ) return; - - if (initRole > 8 ) { - comboEffect->setCurrentItem( initRole - 9 ); - } - else { - comboCentral->setCurrentItem( initRole ); - } + if (initRole != -1) + comboCentral->setCurrentIndex(initRole); } -QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init, - Qt::BackgroundMode mode, QWidget* parent, - const char* name ) +QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init, + QPalette::ColorRole backgroundRole, QWidget *parent) { - PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( parent, name, true ); - dlg->setupBackgroundMode( mode ); + PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent); + dlg->setupBackgroundRole(backgroundRole); if ( init != QPalette() ) dlg->setPal( init ); int resultCode = dlg->exec(); QPalette result = init; - if ( resultCode == QDialog::Accepted ) { - if ( ok ) - *ok = true; + if (resultCode == QDialog::Accepted) result = dlg->pal(); - } else { - if ( ok ) - *ok = false; - } + + if (ok) + *ok = resultCode; + delete dlg; return result; } diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h index a1eb8e7..f70648b 100644 --- a/tools/qtconfig/paletteeditoradvanced.h +++ b/tools/qtconfig/paletteeditoradvanced.h @@ -42,69 +42,59 @@ #ifndef PALETTEEDITORADVANCED_H #define PALETTEEDITORADVANCED_H -#include "paletteeditoradvancedbase.h" +#include "ui_paletteeditoradvanced.h" QT_BEGIN_NAMESPACE -class PaletteEditorAdvanced : public PaletteEditorAdvancedBase +class ColorButton; + +class PaletteEditorAdvanced : public QDialog, public Ui::PaletteEditorAdvanced { Q_OBJECT public: - PaletteEditorAdvanced( QWidget * parent=0, const char * name=0, - bool modal=false, Qt::WindowFlags f=0 ); + PaletteEditorAdvanced(QWidget *parent = 0); ~PaletteEditorAdvanced(); - static QPalette getPalette( bool *ok, const QPalette &pal, Qt::BackgroundMode mode = Qt::PaletteBackground, - QWidget* parent = 0, const char* name = 0 ); + static QPalette getPalette( bool *ok, const QPalette &pal, + QPalette::ColorRole backgroundRole = QPalette::Window, + QWidget *parent = 0 ); + + static QPalette buildEffect(QPalette::ColorGroup colorGroup, const QPalette &basePalette); protected slots: void paletteSelected(int); - void onCentral( int ); - void onEffect( int ); + void onCentral(int); + void onEffect(int); void onChooseCentralColor(); void onChooseEffectColor(); - void onToggleBuildEffects( bool ); - void onToggleBuildInactive( bool ); - void onToggleBuildDisabled( bool ); + void onToggleBuildEffects(bool); + void onToggleBuildInactive(bool); + void onToggleBuildDisabled(bool); protected: - void mapToActiveCentralRole( const QColor& ); - void mapToActiveEffectRole( const QColor& ); - void mapToActivePixmapRole( const QPixmap& ); - void mapToInactiveCentralRole( const QColor& ); - void mapToInactiveEffectRole( const QColor& ); - void mapToInactivePixmapRole( const QPixmap& ); - void mapToDisabledCentralRole( const QColor& ); - void mapToDisabledEffectRole( const QColor& ); - void mapToDisabledPixmapRole( const QPixmap& ); - - - void buildPalette(); - void buildActiveEffect(); - void buildInactive(); - void buildInactiveEffect(); - void buildDisabled(); - void buildDisabledEffect(); + void buildEffect(QPalette::ColorGroup); + void build(QPalette::ColorGroup); private: - void setPreviewPalette( const QPalette& ); void updateColorButtons(); - void setupBackgroundMode( Qt::BackgroundMode ); + void setupBackgroundRole(QPalette::ColorRole); QPalette pal() const; - void setPal( const QPalette& ); + void setPal(const QPalette &); - QColorGroup::ColorRole centralFromItem( int ); - QColorGroup::ColorRole effectFromItem( int ); + static QPalette::ColorGroup groupFromIndex(int); + static QPalette::ColorRole centralFromIndex(int); + static QPalette::ColorRole effectFromIndex(int); QPalette editPalette; - QPalette previewPalette; int selectedPalette; + ColorButton *buttonCentral; + ColorButton *buttonEffect; }; QT_END_NAMESPACE -#endif +#endif // PALETTEEDITORADVANCED_H diff --git a/tools/qtconfig/paletteeditoradvanced.ui b/tools/qtconfig/paletteeditoradvanced.ui new file mode 100644 index 0000000..b1d6b95 --- /dev/null +++ b/tools/qtconfig/paletteeditoradvanced.ui @@ -0,0 +1,416 @@ + + + ********************************************************************* +** +** 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 tools applications 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$ +** +********************************************************************* + PaletteEditorAdvanced + + + + 0 + 0 + 239 + 344 + + + + Tune Palette + + + + + + + + Select &Palette: + + + paletteCombo + + + + + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + + + + + + + + 0 + 0 + + + + Auto + + + + + + Build inactive palette from active + + + true + + + + + + + Build disabled palette from active + + + true + + + + + + + + + + Central color &roles + + + + + + Choose central color role + + + <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> + + + + Window + + + + + WindowText + + + + + Base + + + + + AlternateBase + + + + + ToolTipBase + + + + + ToolTipText + + + + + Text + + + + + Button + + + + + ButtonText + + + + + BrightText + + + + + Highlight + + + + + HighlightedText + + + + + Link + + + + + LinkVisited + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + &Select Color: + + + + + + + + + + + + 3-D shadow &effects + + + + + + + + Generate shadings + + + Check to let 3D-effect colors be calculated from button-color. + + + Build &from button color + + + true + + + + + + + false + + + Choose 3D-effect color role + + + <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 + + + + + Midlight + + + + + Mid + + + + + Dark + + + + + Shadow + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Select Co&lor: + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + PaletteEditorAdvanced + accept() + + + 238 + 384 + + + 157 + 274 + + + + + buttonBox + rejected() + PaletteEditorAdvanced + reject() + + + 306 + 390 + + + 286 + 274 + + + + + checkBuildEffect + toggled(bool) + comboEffect + setDisabled(bool) + + + 82 + 262 + + + 190 + 262 + + + + + diff --git a/tools/qtconfig/paletteeditoradvancedbase.cpp b/tools/qtconfig/paletteeditoradvancedbase.cpp deleted file mode 100644 index 708c834..0000000 --- a/tools/qtconfig/paletteeditoradvancedbase.cpp +++ /dev/null @@ -1,144 +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 tools applications 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 "paletteeditoradvancedbase.h" -#include "colorbutton.h" - -#include - -QT_BEGIN_NAMESPACE - -/* - * Constructs a PaletteEditorAdvancedBase as a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - * - * The dialog will by default be modeless, unless you set 'modal' to - * true to construct a modal dialog. - */ -PaletteEditorAdvancedBase::PaletteEditorAdvancedBase(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) - : QDialog(parent, name, modal, fl) -{ - setupUi(this); - - - // signals and slots connections - connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); - connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int))); - connect(comboCentral, SIGNAL(activated(int)), this, SLOT(onCentral(int))); - connect(buttonCentral, SIGNAL(clicked()), this, SLOT(onChooseCentralColor())); - connect(buttonEffect, SIGNAL(clicked()), this, SLOT(onChooseEffectColor())); - connect(comboEffect, SIGNAL(activated(int)), this, SLOT(onEffect(int))); - connect(checkBuildEffect, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildEffects(bool))); - connect(checkBuildEffect, SIGNAL(toggled(bool)), comboEffect, SLOT(setDisabled(bool))); - connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); - connect(checkBuildInactive, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildInactive(bool))); - connect(checkBuildDisabled, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildDisabled(bool))); - init(); -} - -/* - * Destroys the object and frees any allocated resources - */ -PaletteEditorAdvancedBase::~PaletteEditorAdvancedBase() -{ - destroy(); - // no need to delete child widgets, Qt does it all for us -} - -/* - * Sets the strings of the subwidgets using the current - * language. - */ -void PaletteEditorAdvancedBase::languageChange() -{ - retranslateUi(this); -} - -void PaletteEditorAdvancedBase::init() -{ -} - -void PaletteEditorAdvancedBase::destroy() -{ -} - -void PaletteEditorAdvancedBase::onCentral(int) -{ - qWarning("PaletteEditorAdvancedBase::onCentral(int): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::onChooseCentralColor() -{ - qWarning("PaletteEditorAdvancedBase::onChooseCentralColor(): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::onChooseEffectColor() -{ - qWarning("PaletteEditorAdvancedBase::onChooseEffectColor(): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::onEffect(int) -{ - qWarning("PaletteEditorAdvancedBase::onEffect(int): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::onToggleBuildDisabled(bool) -{ - qWarning("PaletteEditorAdvancedBase::onToggleBuildDisabled(bool): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::onToggleBuildEffects(bool) -{ - qWarning("PaletteEditorAdvancedBase::onToggleBuildEffects(bool): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::onToggleBuildInactive(bool) -{ - qWarning("PaletteEditorAdvancedBase::onToggleBuildInactive(bool): Not implemented yet"); -} - -void PaletteEditorAdvancedBase::paletteSelected(int) -{ - qWarning("PaletteEditorAdvancedBase::paletteSelected(int): Not implemented yet"); -} - -QT_END_NAMESPACE diff --git a/tools/qtconfig/paletteeditoradvancedbase.h b/tools/qtconfig/paletteeditoradvancedbase.h deleted file mode 100644 index ee14a26..0000000 --- a/tools/qtconfig/paletteeditoradvancedbase.h +++ /dev/null @@ -1,78 +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 tools applications 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 PALETTEEDITORADVANCEDBASE_H -#define PALETTEEDITORADVANCEDBASE_H - -#include "ui_paletteeditoradvancedbase.h" -#include - -QT_BEGIN_NAMESPACE - -class ColorButton; - -class PaletteEditorAdvancedBase : public QDialog, public Ui::PaletteEditorAdvancedBase -{ - Q_OBJECT - -public: - PaletteEditorAdvancedBase(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); - ~PaletteEditorAdvancedBase(); - -protected slots: - virtual void languageChange(); - - virtual void init(); - virtual void destroy(); - virtual void onCentral(int); - virtual void onChooseCentralColor(); - virtual void onChooseEffectColor(); - virtual void onEffect(int); - virtual void onToggleBuildDisabled(bool); - virtual void onToggleBuildEffects(bool); - virtual void onToggleBuildInactive(bool); - virtual void paletteSelected(int); - -}; - -QT_END_NAMESPACE - -#endif // PALETTEEDITORADVANCEDBASE_H diff --git a/tools/qtconfig/paletteeditoradvancedbase.ui b/tools/qtconfig/paletteeditoradvancedbase.ui deleted file mode 100644 index 12c5a7d..0000000 --- a/tools/qtconfig/paletteeditoradvancedbase.ui +++ /dev/null @@ -1,617 +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 tools applications 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$ -** -********************************************************************* - - PaletteEditorAdvancedBase - - - PaletteEditorAdvancedBase - - - true - - - - 0 - 0 - 295 - 346 - - - - Tune Palette - - - true - - - <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> - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - TextLabel1 - - - Select &Palette: - - - paletteCombo - - - - - - - paletteCombo - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - - ButtonGroup1 - - - - 5 - 4 - 0 - 0 - - - - Auto - - - - unnamed - - - 11 - - - 6 - - - - - checkBuildInactive - - - Build inactive palette from active - - - true - - - - - - - checkBuildDisabled - - - Build disabled palette from active - - - true - - - - - - - - - - groupCentral - - - Central color &roles - - - - unnamed - - - 11 - - - 6 - - - - - comboCentral - - - Choose central color role - - - <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> - - - - Window - - - - - WindowText - - - - - Button - - - - - Base - - - - - Text - - - - - BrightText - - - - - ButtonText - - - - - Highlight - - - - - HighlightedText - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - labelCentral - - - - 1 - 1 - 0 - 0 - - - - - 0 - 0 - - - - &Select Color: - - - buttonCentral - - - - - - - buttonCentral - - - - 0 - 0 - 0 - 0 - - - - Qt::TabFocus - - - Choose a color - - - Choose a color for the selected central color role. - - - - - - - - - - - - groupEffect - - - 3-D shadow &effects - - - - unnamed - - - 11 - - - 6 - - - - - unnamed - - - 0 - - - 6 - - - - - checkBuildEffect - - - Build &from button color - - - true - - - Generate shadings - - - Check to let 3D-effect colors be calculated from button-color. - - - - - - - comboEffect - - - Choose 3D-effect color role - - - <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 - - - - - Midlight - - - - - Mid - - - - - Dark - - - - - Shadow - - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - labelEffect - - - - 1 - 1 - 0 - 0 - - - - - 0 - 0 - - - - Select Co&lor: - - - buttonEffect - - - - - - - buttonEffect - - - - 0 - 0 - 0 - 0 - - - - Qt::TabFocus - - - Choose a color - - - Choose a color for the selected effect color role. - - - - - - - - - - - - unnamed - - - 0 - - - 6 - - - - - - 20 - 20 - - - - Expanding - - - Horizontal - - - - - - - buttonOk - - - OK - - - true - - - true - - - Close dialog and apply all changes. - - - - - - - buttonCancel - - - Cancel - - - true - - - Close dialog and discard all changes. - - - - - - - - - - - ColorButton - -
      colorbutton.h
      - - 40 - 25 - - 0 - - 5 - 5 - - image0 - - color - pixmap - -
      -
      - - buttonOk - buttonCancel - paletteCombo - checkBuildInactive - checkBuildDisabled - comboCentral - buttonCentral - checkBuildEffect - comboEffect - buttonEffect - - - - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - -
      diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index b0f2563..f4ddebe 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -14,11 +14,11 @@ contains(QT_CONFIG, phonon) { DEFINES += HAVE_PHONON } SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \ - mainwindowbase.cpp paletteeditoradvancedbase.cpp + mainwindowbase.cpp HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \ - mainwindowbase.h paletteeditoradvancedbase.h + mainwindowbase.h -FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidget.ui +FORMS = mainwindowbase.ui paletteeditoradvanced.ui previewwidget.ui RESOURCES = qtconfig.qrc PROJECTNAME = Qt Configuration -- cgit v0.12 From 5999b2ac29c1a144d5edda8e6916bd05bbc4727e Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:33 +0200 Subject: Refactored the MainWindow in qtconfig qtconfig can now be fully build without qt3support module. Removed some legacy and unused code, changed one of labels on widget to reflect the real meaning of configuration parameter. Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 451 ++++------ tools/qtconfig/mainwindow.h | 13 +- tools/qtconfig/mainwindow.ui | 1377 +++++++++++++++++++++++++++++ tools/qtconfig/mainwindowbase.cpp | 250 ------ tools/qtconfig/mainwindowbase.h | 95 -- tools/qtconfig/mainwindowbase.ui | 1384 ------------------------------ tools/qtconfig/paletteeditoradvanced.cpp | 1 - tools/qtconfig/qtconfig.pro | 8 +- 8 files changed, 1559 insertions(+), 2020 deletions(-) create mode 100644 tools/qtconfig/mainwindow.ui delete mode 100644 tools/qtconfig/mainwindowbase.cpp delete mode 100644 tools/qtconfig/mainwindowbase.h delete mode 100644 tools/qtconfig/mainwindowbase.ui diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 3895418..81d7813 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -154,36 +153,20 @@ static const char *phonon_text = "

      It is reccommended to leave all settings on \"Auto\" to let " "Phonon determine your settings automatically."; -static QColorGroup::ColorRole centralFromItem( int item ) -{ - switch( item ) { - case 0: return QColorGroup::Window; - case 1: return QColorGroup::WindowText; - case 2: return QColorGroup::Button; - case 3: return QColorGroup::Base; - case 4: return QColorGroup::Text; - case 5: return QColorGroup::BrightText; - case 6: return QColorGroup::ButtonText; - case 7: return QColorGroup::Highlight; - case 8: return QColorGroup::HighlightedText; - default: return QColorGroup::NColorRoles; - } -} - -static QColorGroup::ColorRole effectFromItem( int item ) +QPalette::ColorGroup MainWindow::groupFromIndex(int item) { switch( item ) { - case 0: return QColorGroup::Light; - case 1: return QColorGroup::Midlight; - case 2: return QColorGroup::Mid; - case 3: return QColorGroup::Dark; - case 4: return QColorGroup::Shadow; - default: return QColorGroup::NColorRoles; + case 0: + default: + return QPalette::Active; + case 1: + return QPalette::Inactive; + case 2: + return QPalette::Disabled; } } - static void setStyleHelper(QWidget *w, QStyle *s) { const QObjectList children = w->children(); @@ -197,9 +180,52 @@ static void setStyleHelper(QWidget *w, QStyle *s) MainWindow::MainWindow() - : MainWindowBase(0, "main window"), - editPalette(palette()), previewPalette(palette()), previewstyle(0) -{ + : QMainWindow(), editPalette(palette()), previewPalette(palette()), previewstyle(0) +{ + setupUi(this); + statusBar(); + + // signals and slots connections + connect(fontpathlineedit, SIGNAL(returnPressed()), SLOT(addFontpath())); + connect(PushButton15, SIGNAL(clicked()), SLOT(addFontpath())); + connect(PushButton1, SIGNAL(clicked()), SLOT(addSubstitute())); + connect(PushButton14, SIGNAL(clicked()), SLOT(browseFontpath())); + connect(stylecombo, SIGNAL(activated(int)), SLOT(buildFont())); + connect(psizecombo, SIGNAL(activated(int)), SLOT(buildFont())); + connect(PushButton12, SIGNAL(clicked()), SLOT(downFontpath())); + connect(PushButton3, SIGNAL(clicked()), SLOT(downSubstitute())); + connect(familycombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); + connect(fileExitAction, SIGNAL(activated()), SLOT(fileExit())); + connect(fileSaveAction, SIGNAL(activated()), SLOT(fileSave())); + connect(helpAboutAction, SIGNAL(activated()), SLOT(helpAbout())); + connect(helpAboutQtAction, SIGNAL(activated()), SLOT(helpAboutQt())); + connect(TabWidget3, SIGNAL(currentChanged(QWidget*)), SLOT(pageChanged(QWidget*))); + connect(paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); + connect(PushButton13, SIGNAL(clicked()), SLOT(removeFontpath())); + connect(PushButton4, SIGNAL(clicked()), SLOT(removeSubstitute())); + connect(toolboxeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(dcispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(cfispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(wslspin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(menueffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(comboeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(audiosinkCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(videomodeCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(tooltipeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(strutwidth, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(strutheight, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(effectcheckbox, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(resolvelinks, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(fontembeddingcheckbox, SIGNAL(clicked()), SLOT(somethingModified())); + connect(rtlExtensions, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(inputStyle, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(inputMethod, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(gstylecombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); + connect(familysubcombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); + connect(btnAdvanced, SIGNAL(clicked()), SLOT(tunePalette())); + connect(PushButton11, SIGNAL(clicked()), SLOT(upFontpath())); + connect(PushButton2, SIGNAL(clicked()), SLOT(upSubstitute())); + modified = true; desktopThemeName = tr("Desktop Settings (Default)"); QStringList gstyles = QStyleFactory::keys(); @@ -207,31 +233,31 @@ MainWindow::MainWindow() gstylecombo->addItem(desktopThemeName); gstylecombo->setItemData(gstylecombo->findText(desktopThemeName), tr("Choose style and palette based on your desktop settings."), Qt::ToolTipRole); - gstylecombo->insertStringList(gstyles); + gstylecombo->addItems(gstyles); QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QString currentstyle = settings.value(QLatin1String("style")).toString(); if (currentstyle.isEmpty()) { - gstylecombo->setCurrentItem(gstylecombo->findText(desktopThemeName)); - currentstyle = QLatin1String(QApplication::style()->name()); + gstylecombo->setCurrentIndex(gstylecombo->findText(desktopThemeName)); + currentstyle = QApplication::style()->objectName(); } else { int index = gstylecombo->findText(currentstyle, Qt::MatchFixedString); if (index != -1) { - gstylecombo->setCurrentItem(index); + gstylecombo->setCurrentIndex(index); } else { // we give up - gstylecombo->insertItem(QLatin1String("Unknown")); - gstylecombo->setCurrentItem(gstylecombo->count() - 1); + gstylecombo->addItem(QLatin1String("Unknown")); + gstylecombo->setCurrentIndex(gstylecombo->count() - 1); } } buttonMainColor->setColor(palette().color(QPalette::Active, - QColorGroup::Button)); - buttonMainColor2->setColor(palette().color(QPalette::Active, - QColorGroup::Window)); + QPalette::Button)); + buttonWindowColor->setColor(palette().color(QPalette::Active, + QPalette::Window)); connect(buttonMainColor, SIGNAL(colorChanged(QColor)), this, SLOT(buildPalette())); - connect(buttonMainColor2, SIGNAL(colorChanged(QColor)), + connect(buttonWindowColor, SIGNAL(colorChanged(QColor)), this, SLOT(buildPalette())); if (X11->desktopEnvironment == DE_KDE) @@ -241,7 +267,7 @@ MainWindow::MainWindow() QFontDatabase db; QStringList families = db.families(); - familycombo->insertStringList(families); + familycombo->addItems(families); QStringList fs = families; QStringList fs2 = QFont::substitutions(); @@ -252,13 +278,12 @@ MainWindow::MainWindow() fsit++; } fs.sort(); - familysubcombo->insertStringList(fs); + familysubcombo->addItems(fs); - choosesubcombo->insertStringList(families); - Q3ValueList sizes = db.standardSizes(); - Q3ValueList::Iterator it = sizes.begin(); - while (it != sizes.end()) - psizecombo->insertItem(QString::number(*it++)); + choosesubcombo->addItems(families); + QList sizes = db.standardSizes(); + foreach(int i, sizes) + psizecombo->addItem(QString::number(i)); dcispin->setValue(QApplication::doubleClickInterval()); cfispin->setValue(QApplication::cursorFlashTime()); @@ -270,20 +295,20 @@ MainWindow::MainWindow() effectbase->setEnabled(effectcheckbox->isChecked()); if (QApplication::isEffectEnabled(Qt::UI_FadeMenu)) - menueffect->setCurrentItem(2); + menueffect->setCurrentIndex(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu)) - menueffect->setCurrentItem(1); + menueffect->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)) - comboeffect->setCurrentItem(1); + comboeffect->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) - tooltipeffect->setCurrentItem(2); + tooltipeffect->setCurrentIndex(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) - tooltipeffect->setCurrentItem(1); + tooltipeffect->setCurrentIndex(1); if ( QApplication::isEffectEnabled( Qt::UI_AnimateToolBox ) ) - toolboxeffect->setCurrentItem( 1 ); + toolboxeffect->setCurrentIndex( 1 ); QSize globalStrut = QApplication::globalStrut(); strutwidth->setValue(globalStrut.width()); @@ -306,10 +331,10 @@ MainWindow::MainWindow() if (i == -1) // no clue about the current font i = 0; - familycombo->setCurrentItem(i); + familycombo->setCurrentIndex(i); QStringList styles = db.styles(familycombo->currentText()); - stylecombo->insertStringList(styles); + stylecombo->addItems(styles); QString stylestring = db.styleString(QApplication::font()); sit = styles.begin(); @@ -328,29 +353,31 @@ MainWindow::MainWindow() i = possible; if (i == -1) // no clue about the current font i = 0; - stylecombo->setCurrentItem(i); + stylecombo->setCurrentIndex(i); i = 0; for (int psize = QApplication::font().pointSize(); i < psizecombo->count(); ++i) { - const int sz = psizecombo->text(i).toInt(); + const int sz = psizecombo->itemText(i).toInt(); if (sz == psize) { - psizecombo->setCurrentItem(i); + psizecombo->setCurrentIndex(i); break; } else if(sz > psize) { psizecombo->insertItem(i, QString::number(psize)); - psizecombo->setCurrentItem(i); + psizecombo->setCurrentIndex(i); break; } } QStringList subs = QFont::substitutes(familysubcombo->currentText()); sublistbox->clear(); - sublistbox->insertStringList(subs); + sublistbox->insertItems(0, subs); rtlExtensions->setChecked(settings.value(QLatin1String("useRtlExtensions"), false).toBool()); #ifdef Q_WS_X11 - inputStyle->setCurrentText(settings.value(QLatin1String("XIMInputStyle"), trUtf8("On The Spot")).toString()); + QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString(); + if (!settingsInputStyle.isEmpty()) + inputStyle->setCurrentIndex(inputStyle->findText(settingsInputStyle)); #else inputStyle->hide(); inputStyleLabel->hide(); @@ -381,7 +408,7 @@ MainWindow::MainWindow() fontembeddingcheckbox->setChecked(settings.value(QLatin1String("embedFonts"), true).toBool()); fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); - fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->insertItems(0, fontpaths); audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); audiosinkCombo->setItemData(audiosinkCombo->findText(tr("Auto (default)")), @@ -397,9 +424,9 @@ MainWindow::MainWindow() gchar *versionString = gst_version_string(); gstversionLabel->setText(QLatin1String(versionString)); g_free(versionString); - GList* factoryList = gst_registry_get_feature_list(gst_registry_get_default (), GST_TYPE_ELEMENT_FACTORY); + GList *factoryList = gst_registry_get_feature_list(gst_registry_get_default (), GST_TYPE_ELEMENT_FACTORY); QString name, klass, description; - for (GList* iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) { + for (GList *iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) { GstPluginFeature *feature = GST_PLUGIN_FEATURE(iter->data); klass = QLatin1String(gst_element_factory_get_klass(GST_ELEMENT_FACTORY(feature))); if (klass == QLatin1String("Sink/Audio")) { @@ -439,8 +466,8 @@ MainWindow::MainWindow() QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); - audiosinkCombo->setCurrentItem(audiosinkCombo->findData(audioSink)); - videomodeCombo->setCurrentItem(videomodeCombo->findData(videoMode)); + audiosinkCombo->setCurrentIndex(audiosinkCombo->findData(audioSink)); + videomodeCombo->setCurrentIndex(videomodeCombo->findData(videoMode)); settings.endGroup(); // Qt @@ -480,15 +507,15 @@ void MainWindow::fileSave() bool overrideDesktopSettings = (gstylecombo->currentText() != desktopThemeName); if (overrideDesktopSettings) { int i; - for (i = 0; i < QColorGroup::NColorRoles; i++) + for (i = 0; i < QPalette::NColorRoles; i++) actcg << editPalette.color(QPalette::Active, - (QColorGroup::ColorRole) i).name(); - for (i = 0; i < QColorGroup::NColorRoles; i++) + (QPalette::ColorRole) i).name(); + for (i = 0; i < QPalette::NColorRoles; i++) inactcg << editPalette.color(QPalette::Inactive, - (QColorGroup::ColorRole) i).name(); - for (i = 0; i < QColorGroup::NColorRoles; i++) + (QPalette::ColorRole) i).name(); + for (i = 0; i < QPalette::NColorRoles; i++) discg << editPalette.color(QPalette::Disabled, - (QColorGroup::ColorRole) i).name(); + (QPalette::ColorRole) i).name(); } settings.setValue(QLatin1String("font"), font.toString()); @@ -535,21 +562,21 @@ void MainWindow::fileSave() if (effectcheckbox->isChecked()) { effects << QLatin1String("general"); - switch (menueffect->currentItem()) { + switch (menueffect->currentIndex()) { case 1: effects << QLatin1String("animatemenu"); break; case 2: effects << QLatin1String("fademenu"); break; } - switch (comboeffect->currentItem()) { + switch (comboeffect->currentIndex()) { case 1: effects << QLatin1String("animatecombo"); break; } - switch (tooltipeffect->currentItem()) { + switch (tooltipeffect->currentIndex()) { case 1: effects << QLatin1String("animatetooltip"); break; case 2: effects << QLatin1String("fadetooltip"); break; } - switch ( toolboxeffect->currentItem() ) { + switch ( toolboxeffect->currentIndex() ) { case 1: effects << QLatin1String("animatetoolbox"); break; } } else @@ -595,149 +622,28 @@ void MainWindow::setModified(bool m) void MainWindow::buildPalette() { - int i; - QColorGroup cg; - QColor btn = buttonMainColor->color(); - QColor back = buttonMainColor2->color(); - QPalette automake( btn, back ); - - for (i = 0; i<9; i++) - cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) ); - - editPalette.setActive( cg ); - buildActiveEffect(); - - cg = editPalette.inactive(); - - QPalette temp( editPalette.active().color( QColorGroup::Button ), - editPalette.active().color( QColorGroup::Window ) ); + QPalette temp(buttonMainColor->color(), buttonWindowColor->color()); + for (int i = 0; icurrentIndex()); - switch (paletteCombo->currentItem()) { - case 0: - default: - cg = pal.active(); - break; - case 1: - cg = pal.inactive(); - break; - case 2: - cg = pal.disabled(); - break; + for (int i = 0; isetPreviewPalette(previewPalette); } @@ -745,16 +651,17 @@ void MainWindow::setPreviewPalette( const QPalette& pal ) void MainWindow::updateColorButtons() { - buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button )); - buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Window )); + buttonMainColor->setColor( editPalette.color( QPalette::Active, QPalette::Button )); + buttonWindowColor->setColor( editPalette.color( QPalette::Active, QPalette::Window )); } void MainWindow::tunePalette() { bool ok; - QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, backgroundRole(), this); - if (!ok) + QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, + backgroundRole(), this); + if (! ok) return; editPalette = pal; @@ -799,8 +706,8 @@ void MainWindow::familySelected(const QString &family) QFontDatabase db; QStringList styles = db.styles(family); stylecombo->clear(); - stylecombo->insertStringList(styles); - familysubcombo->insertItem(family); + stylecombo->addItems(styles); + familysubcombo->addItem(family); buildFont(); } @@ -820,24 +727,23 @@ void MainWindow::substituteSelected(const QString &family) { QStringList subs = QFont::substitutes(family); sublistbox->clear(); - sublistbox->insertStringList(subs); + sublistbox->insertItems(0, subs); } void MainWindow::removeSubstitute() { - if (sublistbox->currentItem() < 0 || - uint(sublistbox->currentItem()) > sublistbox->count()) + if (!sublistbox->currentItem()) return; - int item = sublistbox->currentItem(); + int row = sublistbox->currentRow(); QStringList subs = QFont::substitutes(familysubcombo->currentText()); - subs.removeAt(sublistbox->currentItem()); + subs.removeAt(sublistbox->currentRow()); sublistbox->clear(); - sublistbox->insertStringList(subs); - if (uint(item) > sublistbox->count()) - item = int(sublistbox->count()) - 1; - sublistbox->setCurrentItem(item); + sublistbox->insertItems(0, subs); + if (row > sublistbox->count()) + row = sublistbox->count() - 1; + sublistbox->setCurrentRow(row); QFont::removeSubstitution(familysubcombo->currentText()); QFont::insertSubstitutions(familysubcombo->currentText(), subs); setModified(true); @@ -846,40 +752,38 @@ void MainWindow::removeSubstitute() void MainWindow::addSubstitute() { - if (sublistbox->currentItem() < 0 || - uint(sublistbox->currentItem()) > sublistbox->count()) { + if (!sublistbox->currentItem()) { QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); QStringList subs = QFont::substitutes(familysubcombo->currentText()); sublistbox->clear(); - sublistbox->insertStringList(subs); + sublistbox->insertItems(0, subs); setModified(true); return; } - int item = sublistbox->currentItem(); + int row = sublistbox->currentRow(); QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); QStringList subs = QFont::substitutes(familysubcombo->currentText()); sublistbox->clear(); - sublistbox->insertStringList(subs); - sublistbox->setCurrentItem(item); + sublistbox->insertItems(0, subs); + sublistbox->setCurrentRow(row); setModified(true); } void MainWindow::downSubstitute() { - if (sublistbox->currentItem() < 0 || - uint(sublistbox->currentItem()) >= sublistbox->count()) + if (!sublistbox->currentItem() || sublistbox->currentRow() >= sublistbox->count()) return; - int item = sublistbox->currentItem(); + int row = sublistbox->currentRow(); QStringList subs = QFont::substitutes(familysubcombo->currentText()); - QString fam = subs.at(item); - subs.removeAt(item); - subs.insert(item+1, fam); + QString fam = subs.at(row); + subs.removeAt(row); + subs.insert(row + 1, fam); sublistbox->clear(); - sublistbox->insertStringList(subs); - sublistbox->setCurrentItem(item + 1); + sublistbox->insertItems(0, subs); + sublistbox->setCurrentRow(row + 1); QFont::removeSubstitution(familysubcombo->currentText()); QFont::insertSubstitutions(familysubcombo->currentText(), subs); setModified(true); @@ -888,17 +792,17 @@ void MainWindow::downSubstitute() void MainWindow::upSubstitute() { - if (sublistbox->currentItem() < 1) + if (!sublistbox->currentItem() || sublistbox->currentRow() < 1) return; - int item = sublistbox->currentItem(); + int row = sublistbox->currentRow(); QStringList subs = QFont::substitutes(familysubcombo->currentText()); - QString fam = subs.at(item); - subs.removeAt(item); - subs.insert(item-1, fam); + QString fam = subs.at(row); + subs.removeAt(row); + subs.insert(row-1, fam); sublistbox->clear(); - sublistbox->insertStringList(subs); - sublistbox->setCurrentItem(item - 1); + sublistbox->insertItems(0, subs); + sublistbox->setCurrentRow(row - 1); QFont::removeSubstitution(familysubcombo->currentText()); QFont::insertSubstitutions(familysubcombo->currentText(), subs); setModified(true); @@ -907,17 +811,16 @@ void MainWindow::upSubstitute() void MainWindow::removeFontpath() { - if (fontpathlistbox->currentItem() < 0 || - uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) + if (!fontpathlistbox->currentItem()) return; - int item = fontpathlistbox->currentItem(); - fontpaths.removeAt(fontpathlistbox->currentItem()); + int row = fontpathlistbox->currentRow(); + fontpaths.removeAt(row); fontpathlistbox->clear(); - fontpathlistbox->insertStringList(fontpaths); - if (uint(item) > fontpathlistbox->count()) - item = int(fontpathlistbox->count()) - 1; - fontpathlistbox->setCurrentItem(item); + fontpathlistbox->insertItems(0, fontpaths); + if (row > fontpathlistbox->count()) + row = fontpathlistbox->count() - 1; + fontpathlistbox->setCurrentRow(row); setModified(true); } @@ -927,63 +830,59 @@ void MainWindow::addFontpath() if (fontpathlineedit->text().isEmpty()) return; - if (fontpathlistbox->currentItem() < 0 || - uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) { + if (!fontpathlistbox->currentItem()) { fontpaths.append(fontpathlineedit->text()); fontpathlistbox->clear(); - fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->insertItems(0, fontpaths); setModified(true); return; } - int item = fontpathlistbox->currentItem(); - fontpaths.insert(fontpathlistbox->currentItem()+1, - fontpathlineedit->text()); + int row = fontpathlistbox->currentRow(); + fontpaths.insert(row + 1, fontpathlineedit->text()); fontpathlistbox->clear(); - fontpathlistbox->insertStringList(fontpaths); - fontpathlistbox->setCurrentItem(item); + fontpathlistbox->insertItems(0, fontpaths); + fontpathlistbox->setCurrentRow(row); setModified(true); } void MainWindow::downFontpath() { - if (fontpathlistbox->currentItem() < 0 || - uint(fontpathlistbox->currentItem()) >= fontpathlistbox->count() - 1) + if (!fontpathlistbox->currentItem() || fontpathlistbox->currentRow() >= fontpathlistbox->count() - 1) return; - int item = fontpathlistbox->currentItem(); - QString fam = fontpaths.at(item); - fontpaths.removeAt(item); - fontpaths.insert(item+1, fam); + int row = fontpathlistbox->currentRow(); + QString fam = fontpaths.at(row); + fontpaths.removeAt(row); + fontpaths.insert(row + 1, fam); fontpathlistbox->clear(); - fontpathlistbox->insertStringList(fontpaths); - fontpathlistbox->setCurrentItem(item + 1); + fontpathlistbox->insertItems(0, fontpaths); + fontpathlistbox->setCurrentRow(row + 1); setModified(true); } void MainWindow::upFontpath() { - if (fontpathlistbox->currentItem() < 1) + if (!fontpathlistbox->currentItem() || fontpathlistbox->currentRow() < 1) return; - int item = fontpathlistbox->currentItem(); - QString fam = fontpaths.at(item); - fontpaths.removeAt(item); - fontpaths.insert(item-1, fam); + int row = fontpathlistbox->currentRow(); + QString fam = fontpaths.at(row); + fontpaths.removeAt(row); + fontpaths.insert(row - 1, fam); fontpathlistbox->clear(); - fontpathlistbox->insertStringList(fontpaths); - fontpathlistbox->setCurrentItem(item - 1); + fontpathlistbox->insertItems(0, fontpaths); + fontpathlistbox->setCurrentRow(row - 1); setModified(true); } void MainWindow::browseFontpath() { - QString dirname = QFileDialog::getExistingDirectory(QString(), this, 0, - tr("Select a Directory")); + QString dirname = QFileDialog::getExistingDirectory(this, tr("Select a Directory")); if (dirname.isNull()) return; @@ -1002,7 +901,7 @@ void MainWindow::helpAbout() QMessageBox box(this); box.setText(tr("

      %1

      " "
      Version %2" - "

      Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).") + "

      Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).") .arg(tr("Qt Configuration")).arg(QLatin1String(QT_VERSION_STR))); box.setWindowTitle(tr("Qt Configuration")); box.setIcon(QMessageBox::NoIcon); diff --git a/tools/qtconfig/mainwindow.h b/tools/qtconfig/mainwindow.h index 9bc8068..76e3691 100644 --- a/tools/qtconfig/mainwindow.h +++ b/tools/qtconfig/mainwindow.h @@ -42,11 +42,11 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "mainwindowbase.h" +#include "ui_mainwindow.h" QT_BEGIN_NAMESPACE -class MainWindow : public MainWindowBase +class MainWindow : public QMainWindow, public Ui::MainWindow { Q_OBJECT @@ -83,17 +83,12 @@ public slots: private: - void buildActive(); - void buildActiveEffect(); - void buildInactive(); - void buildInactiveEffect(); - void buildDisabled(); - void buildDisabledEffect(); - void updateColorButtons(); void updateFontSample(); void updateStyleLayout(); + static QPalette::ColorGroup groupFromIndex(int); + void setPreviewPalette(const QPalette &); void setModified(bool); diff --git a/tools/qtconfig/mainwindow.ui b/tools/qtconfig/mainwindow.ui new file mode 100644 index 0000000..117a777 --- /dev/null +++ b/tools/qtconfig/mainwindow.ui @@ -0,0 +1,1377 @@ + + + ********************************************************************* +** +** 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 tools applications 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$ +** +********************************************************************* + MainWindow + + + + 0 + 0 + 815 + 716 + + + + Qt Configuration + + + + + 8 + + + + + + 200 + 0 + + + + true + + + + + + + 0 + + + + Appearance + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + GUI Style + + + + 4 + + + 8 + + + + + + 0 + 0 + + + + Select GUI &Style: + + + gstylecombo + + + + + + + + + + + + + + 0 + 0 + + + + Preview + + + + + + Select &Palette: + + + paletteCombo + + + + + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + + + + + + 0 + 0 + + + + + 410 + 260 + + + + + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + Build Palette + + + + + + + 0 + + + + + &Button Background: + + + buttonMainColor + + + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + 1 + + + 0 + + + Window Back&ground: + + + Qt::AlignVCenter + + + 0 + + + buttonWindowColor + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 70 + 20 + + + + + + + + &Tune Palette... + + + + + + + + + + Please use the KDE Control Center to set the palette. + + + + + + + + + + + Fonts + + + + + + Default Font + + + + 8 + + + 4 + + + + + true + + + false + + + + + + + true + + + false + + + + + + + true + + + true + + + false + + + + + + + &Style: + + + stylecombo + + + + + + + &Point Size: + + + psizecombo + + + + + + + F&amily: + + + familycombo + + + + + + + Sample Text + + + Qt::AlignHCenter + + + + + + + + + + Font Substitution + + + + 4 + + + 8 + + + + + 4 + + + 0 + + + + + S&elect or Enter a Family: + + + familysubcombo + + + + + + + true + + + true + + + false + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + Qt::Horizontal + + + + + + + Current Substitutions: + + + + + + + + + + 4 + + + 0 + + + + + Up + + + + + + + Down + + + + + + + Remove + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + Qt::Horizontal + + + + + + + 4 + + + 0 + + + + + Select s&ubstitute Family: + + + choosesubcombo + + + + + + + true + + + false + + + + + + + Add + + + + + + + + + + + + + Interface + + + + + + Feel Settings + + + + 8 + + + 4 + + + + + ms + + + 10 + + + 10000 + + + + + + + &Double Click Interval: + + + dcispin + + + + + + + No blinking + + + ms + + + 9 + + + 10000 + + + + + + + &Cursor Flash Time: + + + cfispin + + + + + + + lines + + + 1 + + + 20 + + + + + + + Wheel &Scroll Lines: + + + wslspin + + + + + + + Resolve symlinks in URLs + + + + + + + + + + GUI Effects + + + + 4 + + + 8 + + + + + &Enable + + + Alt+E + + + + + + + + 4 + + + + + &Menu Effect: + + + menueffect + + + + + + + C&omboBox Effect: + + + comboeffect + + + + + + + &ToolTip Effect: + + + tooltipeffect + + + + + + + Tool&Box Effect: + + + toolboxeffect + + + + + + + 0 + + + true + + + + Disable + + + + + Animate + + + + + Fade + + + + + + + + + Disable + + + + + Animate + + + + + + + + + Disable + + + + + Animate + + + + + Fade + + + + + + + + + Disable + + + + + Animate + + + + + + + + + + + + + + Global Strut + + + + 8 + + + 4 + + + + + Minimum &Width: + + + strutwidth + + + + + + + Minimum Hei&ght: + + + strutheight + + + + + + + pixels + + + 1000 + + + + + + + pixels + + + 1000 + + + + + + + + + + Enhanced support for languages written right-to-left + + + + + + + XIM Input Style: + + + + + + + 0 + + + + On The Spot + + + + + Over The Spot + + + + + Off The Spot + + + + + Root + + + + + + + + Default Input Method: + + + + + + + -1 + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + Printer + + + + + + Enable Font embedding + + + true + + + + + + + + 0 + 0 + + + + Font Paths + + + + 4 + + + 8 + + + + + 0 + + + 4 + + + + + Up + + + + + + + Remove + + + + + + + Down + + + + + + + + + + + + 0 + + + 4 + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + Add + + + + + + + Browse... + + + + + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + + + + + + + + + + + + + + + + Phonon + + + + + + About Phonon + + + + + + Current Version: + + + + + + + Not available + + + + + + + Website: + + + + + + + <!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> + + + true + + + + + + + + + + About GStreamer + + + + + + Current Version: + + + + + + + Not available + + + + + + + Website: + + + + + + + <!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> + + + true + + + + + + + + + + GStreamer backend settings + + + + + + Preferred audio sink: + + + audiosinkCombo + + + + + + + + + + Preferred render method: + + + videomodeCombo + + + + + + + + + + <!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> + + + Qt::RichText + + + false + + + true + + + 2 + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + 0 + 0 + 815 + 19 + + + + + + 203 + 114 + 161 + 110 + + + + &File + + + + + + + + + 234 + 115 + 161 + 106 + + + + &Help + + + + + + + + + + + &Save + + + Save + + + Ctrl+S + + + + + E&xit + + + Exit + + + Ctrl+Q + + + + + &About + + + About + + + + + + + + About &Qt + + + About Qt + + + + + + ColorButton + +
      colorbutton.h
      +
      + + PreviewFrame + +
      previewframe.h
      +
      +
      + + helpview + familycombo + stylecombo + psizecombo + samplelineedit + familysubcombo + PushButton2 + PushButton3 + PushButton4 + choosesubcombo + PushButton1 + dcispin + cfispin + wslspin + effectcheckbox + menueffect + comboeffect + tooltipeffect + strutwidth + strutheight + sublistbox + + + + + effectcheckbox + toggled(bool) + effectbase + setEnabled(bool) + + + 417 + 257 + + + 578 + 379 + + + + + fontembeddingcheckbox + toggled(bool) + GroupBox10 + setEnabled(bool) + + + 449 + 69 + + + 447 + 94 + + + + +
      diff --git a/tools/qtconfig/mainwindowbase.cpp b/tools/qtconfig/mainwindowbase.cpp deleted file mode 100644 index 2460bca..0000000 --- a/tools/qtconfig/mainwindowbase.cpp +++ /dev/null @@ -1,250 +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 tools applications 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 "mainwindowbase.h" -#include "colorbutton.h" -#include "previewframe.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -/* - * Constructs a MainWindowBase as a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - * - */ -MainWindowBase::MainWindowBase(QWidget* parent, const char* name, Qt::WindowFlags fl) - : Q3MainWindow(parent, name, fl) -{ - setupUi(this); - - (void)statusBar(); - - // signals and slots connections - connect(fontpathlineedit, SIGNAL(returnPressed()), this, SLOT(addFontpath())); - connect(PushButton15, SIGNAL(clicked()), this, SLOT(addFontpath())); - connect(PushButton1, SIGNAL(clicked()), this, SLOT(addSubstitute())); - connect(PushButton14, SIGNAL(clicked()), this, SLOT(browseFontpath())); - connect(stylecombo, SIGNAL(activated(int)), this, SLOT(buildFont())); - connect(psizecombo, SIGNAL(activated(int)), this, SLOT(buildFont())); - connect(PushButton12, SIGNAL(clicked()), this, SLOT(downFontpath())); - connect(PushButton3, SIGNAL(clicked()), this, SLOT(downSubstitute())); - connect(familycombo, SIGNAL(activated(QString)), this, SLOT(familySelected(QString))); - connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit())); - connect(fileSaveAction, SIGNAL(activated()), this, SLOT(fileSave())); - connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout())); - connect(helpAboutQtAction, SIGNAL(activated()), this, SLOT(helpAboutQt())); - connect(TabWidget3, SIGNAL(currentChanged(QWidget*)), this, SLOT(pageChanged(QWidget*))); - connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int))); - connect(PushButton13, SIGNAL(clicked()), this, SLOT(removeFontpath())); - connect(PushButton4, SIGNAL(clicked()), this, SLOT(removeSubstitute())); - connect(effectcheckbox, SIGNAL(toggled(bool)), effectbase, SLOT(setEnabled(bool))); - connect(fontembeddingcheckbox, SIGNAL(toggled(bool)), GroupBox10, SLOT(setEnabled(bool))); - connect(toolboxeffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(dcispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); - connect(cfispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); - connect(wslspin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); - connect(menueffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(comboeffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(audiosinkCombo, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(videomodeCombo, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(tooltipeffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(strutwidth, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); - connect(strutheight, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); - connect(effectcheckbox, SIGNAL(toggled(bool)), this, SLOT(somethingModified())); - connect(resolvelinks, SIGNAL(toggled(bool)), this, SLOT(somethingModified())); - connect(fontembeddingcheckbox, SIGNAL(clicked()), this, SLOT(somethingModified())); - connect(rtlExtensions, SIGNAL(toggled(bool)), this, SLOT(somethingModified())); - connect(inputStyle, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(inputMethod, SIGNAL(activated(int)), this, SLOT(somethingModified())); - connect(gstylecombo, SIGNAL(activated(QString)), this, SLOT(styleSelected(QString))); - connect(familysubcombo, SIGNAL(activated(QString)), this, SLOT(substituteSelected(QString))); - connect(btnAdvanced, SIGNAL(clicked()), this, SLOT(tunePalette())); - connect(PushButton11, SIGNAL(clicked()), this, SLOT(upFontpath())); - connect(PushButton2, SIGNAL(clicked()), this, SLOT(upSubstitute())); - init(); -} - -/* - * Destroys the object and frees any allocated resources - */ -MainWindowBase::~MainWindowBase() -{ - destroy(); - // no need to delete child widgets, Qt does it all for us -} - -/* - * Sets the strings of the subwidgets using the current - * language. - */ -void MainWindowBase::languageChange() -{ - retranslateUi(this); -} - -void MainWindowBase::init() -{ -} - -void MainWindowBase::destroy() -{ -} - -void MainWindowBase::addFontpath() -{ - qWarning("MainWindowBase::addFontpath(): Not implemented yet"); -} - -void MainWindowBase::addSubstitute() -{ - qWarning("MainWindowBase::addSubstitute(): Not implemented yet"); -} - -void MainWindowBase::browseFontpath() -{ - qWarning("MainWindowBase::browseFontpath(): Not implemented yet"); -} - -void MainWindowBase::buildFont() -{ - qWarning("MainWindowBase::buildFont(): Not implemented yet"); -} - -void MainWindowBase::buildPalette() -{ - qWarning("MainWindowBase::buildPalette(): Not implemented yet"); -} - -void MainWindowBase::downFontpath() -{ - qWarning("MainWindowBase::downFontpath(): Not implemented yet"); -} - -void MainWindowBase::downSubstitute() -{ - qWarning("MainWindowBase::downSubstitute(): Not implemented yet"); -} - -void MainWindowBase::familySelected( const QString &) -{ - qWarning("MainWindowBase::familySelected( const QString &): Not implemented yet"); -} - -void MainWindowBase::fileExit() -{ - qWarning("MainWindowBase::fileExit(): Not implemented yet"); -} - -void MainWindowBase::fileSave() -{ - qWarning("MainWindowBase::fileSave(): Not implemented yet"); -} - -void MainWindowBase::helpAbout() -{ - qWarning("MainWindowBase::helpAbout(): Not implemented yet"); -} - -void MainWindowBase::helpAboutQt() -{ - qWarning("MainWindowBase::helpAboutQt(): Not implemented yet"); -} - -void MainWindowBase::new_slot() -{ - qWarning("MainWindowBase::new_slot(): Not implemented yet"); -} - -void MainWindowBase::pageChanged( QWidget *) -{ - qWarning("MainWindowBase::pageChanged( QWidget *): Not implemented yet"); -} - -void MainWindowBase::paletteSelected(int) -{ - qWarning("MainWindowBase::paletteSelected(int): Not implemented yet"); -} - -void MainWindowBase::removeFontpath() -{ - qWarning("MainWindowBase::removeFontpath(): Not implemented yet"); -} - -void MainWindowBase::removeSubstitute() -{ - qWarning("MainWindowBase::removeSubstitute(): Not implemented yet"); -} - -void MainWindowBase::somethingModified() -{ - qWarning("MainWindowBase::somethingModified(): Not implemented yet"); -} - -void MainWindowBase::styleSelected( const QString &) -{ - qWarning("MainWindowBase::styleSelected( const QString &): Not implemented yet"); -} - -void MainWindowBase::substituteSelected( const QString &) -{ - qWarning("MainWindowBase::substituteSelected( const QString &): Not implemented yet"); -} - -void MainWindowBase::tunePalette() -{ - qWarning("MainWindowBase::tunePalette(): Not implemented yet"); -} - -void MainWindowBase::upFontpath() -{ - qWarning("MainWindowBase::upFontpath(): Not implemented yet"); -} - -void MainWindowBase::upSubstitute() -{ - qWarning("MainWindowBase::upSubstitute(): Not implemented yet"); -} - -QT_END_NAMESPACE diff --git a/tools/qtconfig/mainwindowbase.h b/tools/qtconfig/mainwindowbase.h deleted file mode 100644 index 1e1dabf..0000000 --- a/tools/qtconfig/mainwindowbase.h +++ /dev/null @@ -1,95 +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 tools applications 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 MAINWINDOWBASE_H -#define MAINWINDOWBASE_H - -#include "ui_mainwindowbase.h" -#include - -QT_BEGIN_NAMESPACE - -class ColorButton; -class PreviewFrame; - -class MainWindowBase : public Q3MainWindow, public Ui::MainWindowBase -{ - Q_OBJECT - -public: - MainWindowBase(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::Window); - ~MainWindowBase(); - -public slots: - virtual void addFontpath(); - virtual void addSubstitute(); - virtual void browseFontpath(); - virtual void buildFont(); - virtual void buildPalette(); - virtual void downFontpath(); - virtual void downSubstitute(); - virtual void familySelected( const QString & ); - virtual void fileExit(); - virtual void fileSave(); - virtual void helpAbout(); - virtual void helpAboutQt(); - virtual void new_slot(); - virtual void pageChanged( QWidget * ); - virtual void paletteSelected( int ); - virtual void removeFontpath(); - virtual void removeSubstitute(); - virtual void somethingModified(); - virtual void styleSelected( const QString & ); - virtual void substituteSelected( const QString & ); - virtual void tunePalette(); - virtual void upFontpath(); - virtual void upSubstitute(); - -protected slots: - virtual void languageChange(); - - virtual void init(); - virtual void destroy(); -}; - -QT_END_NAMESPACE - -#endif // MAINWINDOWBASE_H diff --git a/tools/qtconfig/mainwindowbase.ui b/tools/qtconfig/mainwindowbase.ui deleted file mode 100644 index b09abd0..0000000 --- a/tools/qtconfig/mainwindowbase.ui +++ /dev/null @@ -1,1384 +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 tools applications 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$ -** -********************************************************************* - MainWindowBase - - - - 0 - 0 - 815 - 716 - - - - Qt Configuration - - - - - 0 - 26 - 815 - 690 - - - - - 8 - - - - - - 200 - 0 - - - - true - - - - - - - 0 - - - - Appearance - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - GUI Style - - - - 4 - - - 8 - - - - - - 0 - 0 - - - - Select GUI &Style: - - - gstylecombo - - - - - - - - - - - - - - 0 - 0 - - - - Preview - - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - 0 - 0 - - - - - 410 - 260 - - - - - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - Build Palette - - - - - - - 0 - - - - - &3-D Effects: - - - buttonMainColor - - - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 1 - - - 0 - - - Window Back&ground: - - - Qt::AlignVCenter - - - 0 - - - buttonMainColor2 - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 70 - 20 - - - - - - - - &Tune Palette... - - - - - - - - - - Please use the KDE Control Center to set the palette. - - - - - - - - - - - Fonts - - - - - - Default Font - - - - 8 - - - 4 - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - true - - - false - - - - - - - &Style: - - - stylecombo - - - - - - - &Point Size: - - - psizecombo - - - - - - - F&amily: - - - familycombo - - - - - - - Sample Text - - - Qt::AlignHCenter - - - - - - - - - - Font Substitution - - - - 4 - - - 8 - - - - - 4 - - - 0 - - - - - S&elect or Enter a Family: - - - familysubcombo - - - - - - - true - - - true - - - false - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - Current Substitutions: - - - - - - - - - - 4 - - - 0 - - - - - Up - - - - - - - Down - - - - - - - Remove - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - 4 - - - 0 - - - - - Select s&ubstitute Family: - - - choosesubcombo - - - - - - - true - - - false - - - - - - - Add - - - - - - - - - - - - - Interface - - - - - - Feel Settings - - - - 8 - - - 4 - - - - - ms - - - 10 - - - 10000 - - - - - - - &Double Click Interval: - - - dcispin - - - - - - - No blinking - - - ms - - - 9 - - - 10000 - - - - - - - &Cursor Flash Time: - - - cfispin - - - - - - - lines - - - 1 - - - 20 - - - - - - - Wheel &Scroll Lines: - - - wslspin - - - - - - - Resolve symlinks in URLs - - - - - - - - - - GUI Effects - - - - 4 - - - 8 - - - - - &Enable - - - Alt+E - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 0 - - - 4 - - - - - &Menu Effect: - - - menueffect - - - - - - - C&omboBox Effect: - - - comboeffect - - - - - - - &ToolTip Effect: - - - tooltipeffect - - - - - - - Tool&Box Effect: - - - toolboxeffect - - - - - - - 0 - - - true - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - - - - - - Global Strut - - - - 8 - - - 4 - - - - - Minimum &Width: - - - strutwidth - - - - - - - Minimum Hei&ght: - - - strutheight - - - - - - - pixels - - - 1000 - - - - - - - pixels - - - 1000 - - - - - - - - - - Enhanced support for languages written right-to-left - - - - - - - XIM Input Style: - - - - - - - 0 - - - - On The Spot - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - - - - Default Input Method: - - - - - - - -1 - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - Printer - - - - - - Enable Font embedding - - - true - - - - - - - - 0 - 0 - - - - Font Paths - - - - 4 - - - 8 - - - - - 0 - - - 4 - - - - - Up - - - - - - - Remove - - - - - - - Down - - - - - - - - - - - - 0 - - - 4 - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - Add - - - - - - - Browse... - - - - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - - - - - - - - - - - - - - - - Phonon - - - - - - About Phonon - - - - - - Current Version: - - - - - - - Not available - - - - - - - Website: - - - - - - - <!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> - - - true - - - - - - - - - - About GStreamer - - - - - - Current Version: - - - - - - - Not available - - - - - - - Website: - - - - - - - <!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> - - - true - - - - - - - - - - GStreamer backend settings - - - - - - Preferred audio sink: - - - audiosinkCombo - - - - - - - - - - Preferred render method: - - - videomodeCombo - - - - - - - - - - <!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> - - - Qt::RichText - - - false - - - true - - - 2 - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - 0 - 0 - 815 - 26 - - - - - - 0 - 0 - 123 - 92 - - - - &File - - - - - - - - - - - - 0 - 0 - 123 - 90 - - - - &Help - - - - - - - - - - - - - - &Save - - - Save - - - Ctrl+S - - - - - E&xit - - - Exit - - - - - - - - &About - - - About - - - - - - - - About &Qt - - - About Qt - - - - - - Q3Frame - QFrame -
      Qt3Support/Q3Frame
      - 1 -
      - - Q3MainWindow - QWidget -
      q3mainwindow.h
      - 1 -
      - - Q3ListBox - Q3Frame -
      q3listbox.h
      -
      - - ColorButton - -
      colorbutton.h
      -
      - - PreviewFrame - -
      previewframe.h
      -
      -
      - - helpview - familycombo - stylecombo - psizecombo - samplelineedit - familysubcombo - PushButton2 - PushButton3 - PushButton4 - choosesubcombo - PushButton1 - dcispin - cfispin - wslspin - effectcheckbox - menueffect - comboeffect - tooltipeffect - strutwidth - strutheight - sublistbox - - - -
      diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index fa108e7..e757d00 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -182,7 +182,6 @@ QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item) } } - QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item) { switch( item ) { diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index f4ddebe..4cfc944 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -13,12 +13,10 @@ contains(QT_CONFIG, phonon) { QT += phonon DEFINES += HAVE_PHONON } -SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \ - mainwindowbase.cpp -HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \ - mainwindowbase.h +SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp +HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h -FORMS = mainwindowbase.ui paletteeditoradvanced.ui previewwidget.ui +FORMS = mainwindow.ui paletteeditoradvanced.ui previewwidget.ui RESOURCES = qtconfig.qrc PROJECTNAME = Qt Configuration -- cgit v0.12 From 5c87763ffa0ec38443c14f8870294e340edd4db1 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:34 +0200 Subject: Fixed some code style issues in qtconfig Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 81d7813..12024e7 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -178,7 +178,6 @@ static void setStyleHelper(QWidget *w, QStyle *s) w->setStyle(s); } - MainWindow::MainWindow() : QMainWindow(), editPalette(palette()), previewPalette(palette()), previewstyle(0) { @@ -477,7 +476,6 @@ MainWindow::MainWindow() updateStyleLayout(); } - MainWindow::~MainWindow() { } @@ -603,13 +601,11 @@ void MainWindow::fileSave() statusBar()->showMessage(QLatin1String("Saved changes.")); } - void MainWindow::fileExit() { qApp->closeAllWindows(); } - void MainWindow::setModified(bool m) { if (modified == m) @@ -619,7 +615,6 @@ void MainWindow::setModified(bool m) fileSaveAction->setEnabled(m); } - void MainWindow::buildPalette() { QPalette temp(buttonMainColor->color(), buttonWindowColor->color()); @@ -648,14 +643,12 @@ void MainWindow::setPreviewPalette( const QPalette& pal ) previewFrame->setPreviewPalette(previewPalette); } - void MainWindow::updateColorButtons() { buttonMainColor->setColor( editPalette.color( QPalette::Active, QPalette::Button )); buttonWindowColor->setColor( editPalette.color( QPalette::Active, QPalette::Window )); } - void MainWindow::tunePalette() { bool ok; @@ -669,7 +662,6 @@ void MainWindow::tunePalette() setModified(true); } - void MainWindow::paletteSelected(int) { setPreviewPalette(editPalette); @@ -700,7 +692,6 @@ void MainWindow::styleSelected(const QString &stylename) updateStyleLayout(); } - void MainWindow::familySelected(const QString &family) { QFontDatabase db; @@ -711,7 +702,6 @@ void MainWindow::familySelected(const QString &family) buildFont(); } - void MainWindow::buildFont() { QFontDatabase db; @@ -722,7 +712,6 @@ void MainWindow::buildFont() setModified(true); } - void MainWindow::substituteSelected(const QString &family) { QStringList subs = QFont::substitutes(family); @@ -730,7 +719,6 @@ void MainWindow::substituteSelected(const QString &family) sublistbox->insertItems(0, subs); } - void MainWindow::removeSubstitute() { if (!sublistbox->currentItem()) @@ -749,7 +737,6 @@ void MainWindow::removeSubstitute() setModified(true); } - void MainWindow::addSubstitute() { if (!sublistbox->currentItem()) { @@ -770,7 +757,6 @@ void MainWindow::addSubstitute() setModified(true); } - void MainWindow::downSubstitute() { if (!sublistbox->currentItem() || sublistbox->currentRow() >= sublistbox->count()) @@ -789,7 +775,6 @@ void MainWindow::downSubstitute() setModified(true); } - void MainWindow::upSubstitute() { if (!sublistbox->currentItem() || sublistbox->currentRow() < 1) @@ -808,7 +793,6 @@ void MainWindow::upSubstitute() setModified(true); } - void MainWindow::removeFontpath() { if (!fontpathlistbox->currentItem()) @@ -824,7 +808,6 @@ void MainWindow::removeFontpath() setModified(true); } - void MainWindow::addFontpath() { if (fontpathlineedit->text().isEmpty()) @@ -847,11 +830,12 @@ void MainWindow::addFontpath() setModified(true); } - void MainWindow::downFontpath() { - if (!fontpathlistbox->currentItem() || fontpathlistbox->currentRow() >= fontpathlistbox->count() - 1) + if (!fontpathlistbox->currentItem() + || fontpathlistbox->currentRow() >= (fontpathlistbox->count() - 1)) { return; + } int row = fontpathlistbox->currentRow(); QString fam = fontpaths.at(row); @@ -863,7 +847,6 @@ void MainWindow::downFontpath() setModified(true); } - void MainWindow::upFontpath() { if (!fontpathlistbox->currentItem() || fontpathlistbox->currentRow() < 1) @@ -879,7 +862,6 @@ void MainWindow::upFontpath() setModified(true); } - void MainWindow::browseFontpath() { QString dirname = QFileDialog::getExistingDirectory(this, tr("Select a Directory")); @@ -889,13 +871,11 @@ void MainWindow::browseFontpath() fontpathlineedit->setText(dirname); } - void MainWindow::somethingModified() { setModified(true); } - void MainWindow::helpAbout() { QMessageBox box(this); @@ -908,13 +888,11 @@ void MainWindow::helpAbout() box.exec(); } - void MainWindow::helpAboutQt() { QMessageBox::aboutQt(this, tr("Qt Configuration")); } - void MainWindow::pageChanged(QWidget *page) { if (page == tab) @@ -929,7 +907,6 @@ void MainWindow::pageChanged(QWidget *page) helpview->setText(tr(phonon_text)); } - void MainWindow::closeEvent(QCloseEvent *e) { if (modified) { -- cgit v0.12 From 27fa758a28943698749a0608039efd88574da5e5 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:34 +0200 Subject: Modified previewwidget's ui file in qtconfig The modification is needed to prevent ui compilation time warnings. Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/previewwidget.ui | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/qtconfig/previewwidget.ui b/tools/qtconfig/previewwidget.ui index 12de30d..9d86a1f 100644 --- a/tools/qtconfig/previewwidget.ui +++ b/tools/qtconfig/previewwidget.ui @@ -1,6 +1,6 @@ - ********************************************************************* + ********************************************************************* ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -67,7 +67,7 @@ 11 - + 6 @@ -75,7 +75,7 @@ 0 - + 6 @@ -87,7 +87,7 @@ GroupBox - + 6 @@ -126,7 +126,7 @@ GroupBox2 - + 6 @@ -163,7 +163,7 @@ - + 6 @@ -187,7 +187,7 @@ - + 6 -- cgit v0.12 From 31ea34d217e28f83cf868c76a998d61a846385e6 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:35 +0200 Subject: Finally removed the qtconfig dependency from qt3support Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/qtconfig.pro | 1 - tools/tools.pro | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index 4cfc944..a066d4e 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -5,7 +5,6 @@ build_all:!build_pass { CONFIG += release } LANGUAGE = C++ -QT += qt3support contains(QT_CONFIG, gstreamer):LIBS += $$QT_LIBS_GSTREAMER -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 contains(QT_CONFIG, gstreamer):QMAKE_CXXFLAGS += $$QT_CFLAGS_GSTREAMER diff --git a/tools/tools.pro b/tools/tools.pro index 8f23fe4..c64fe25 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -20,7 +20,7 @@ TEMPLATE = subdirs SUBDIRS += designer } } - unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig + unix:!mac:!embedded:SUBDIRS += qtconfig win32:!wince*:SUBDIRS += activeqt } contains(QT_CONFIG, declarative):SUBDIRS += qml -- cgit v0.12 From 55f7ab61482cbfdf93ab25e409649ecea9bcdb0e Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:36 +0200 Subject: Resolved some code style issues and fixed the broken copyright year Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 51 ++++++++++++++++---------------- tools/qtconfig/paletteeditoradvanced.cpp | 14 ++++----- tools/qtconfig/paletteeditoradvanced.h | 6 ++-- tools/qtconfig/previewframe.cpp | 4 +-- tools/qtconfig/previewwidget.cpp | 4 +-- 5 files changed, 40 insertions(+), 39 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 12024e7..fd083c1 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -156,7 +156,7 @@ static const char *phonon_text = QPalette::ColorGroup MainWindow::groupFromIndex(int item) { - switch( item ) { + switch (item) { case 0: default: return QPalette::Active; @@ -272,7 +272,7 @@ MainWindow::MainWindow() QStringList fs2 = QFont::substitutions(); QStringList::Iterator fsit = fs2.begin(); while (fsit != fs2.end()) { - if (! fs.contains(*fsit)) + if (!fs.contains(*fsit)) fs += *fsit; fsit++; } @@ -306,8 +306,8 @@ MainWindow::MainWindow() else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) tooltipeffect->setCurrentIndex(1); - if ( QApplication::isEffectEnabled( Qt::UI_AnimateToolBox ) ) - toolboxeffect->setCurrentIndex( 1 ); + if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox)) + toolboxeffect->setCurrentIndex(1); QSize globalStrut = QApplication::globalStrut(); strutwidth->setValue(globalStrut.width()); @@ -526,7 +526,7 @@ void MainWindow::fileSave() settings.setValue(QLatin1String("style"), overrideDesktopSettings ? gstylecombo->currentText() : QString()); settings.setValue(QLatin1String("doubleClickInterval"), dcispin->value()); - settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value() ); + settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value()); settings.setValue(QLatin1String("wheelScrollLines"), wslspin->value()); settings.setValue(QLatin1String("resolveSymlinks"), resolvelinks->isChecked()); @@ -539,13 +539,13 @@ void MainWindow::fileSave() #ifdef Q_WS_X11 QString style = inputStyle->currentText(); QString str = QLatin1String("On The Spot"); - if ( style == trUtf8( "Over The Spot" ) ) + if (style == trUtf8("Over The Spot")) str = QLatin1String("Over The Spot"); - else if ( style == trUtf8( "Off The Spot" ) ) + else if (style == trUtf8("Off The Spot")) str = QLatin1String("Off The Spot"); - else if ( style == trUtf8( "Root" ) ) + else if (style == trUtf8("Root")) str = QLatin1String("Root"); - settings.setValue( QLatin1String("XIMInputStyle"), str ); + settings.setValue(QLatin1String("XIMInputStyle"), str); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) settings.setValue(QLatin1String("DefaultInputMethod"), inputMethod->currentText()); @@ -574,7 +574,7 @@ void MainWindow::fileSave() case 2: effects << QLatin1String("fadetooltip"); break; } - switch ( toolboxeffect->currentIndex() ) { + switch (toolboxeffect->currentIndex()) { case 1: effects << QLatin1String("animatetoolbox"); break; } } else @@ -618,8 +618,8 @@ void MainWindow::setModified(bool m) void MainWindow::buildPalette() { QPalette temp(buttonMainColor->color(), buttonWindowColor->color()); - for (int i = 0; icurrentIndex()); - for (int i = 0; isetColor( editPalette.color( QPalette::Active, QPalette::Button )); - buttonWindowColor->setColor( editPalette.color( QPalette::Active, QPalette::Window )); + buttonMainColor->setColor(editPalette.color(QPalette::Active, QPalette::Button)); + buttonWindowColor->setColor(editPalette.color(QPalette::Active, QPalette::Window)); } void MainWindow::tunePalette() @@ -654,7 +654,7 @@ void MainWindow::tunePalette() bool ok; QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, backgroundRole(), this); - if (! ok) + if (!ok) return; editPalette = pal; @@ -881,7 +881,7 @@ void MainWindow::helpAbout() QMessageBox box(this); box.setText(tr("

      %1

      " "
      Version %2" - "

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

      Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).") .arg(tr("Qt Configuration")).arg(QLatin1String(QT_VERSION_STR))); box.setWindowTitle(tr("Qt Configuration")); box.setIcon(QMessageBox::NoIcon); @@ -910,19 +910,20 @@ void MainWindow::pageChanged(QWidget *page) void MainWindow::closeEvent(QCloseEvent *e) { if (modified) { - switch(QMessageBox::warning(this, tr("Save Changes"), - tr("Save changes to settings?"), - tr("&Yes"), tr("&No"), tr("&Cancel"), 0, 2)) { - case 0: // save + switch (QMessageBox::warning(this, tr("Save Changes"), + tr("Save changes to settings?"), + (QMessageBox::Yes | QMessageBox::No + | QMessageBox::Cancel))) { + case QMessageBox::Yes: // save qApp->processEvents(); fileSave(); // fall through intended - case 1: // don't save + case QMessageBox::No: // don't save e->accept(); break; - case 2: // cancel + case QMessageBox::Cancel: // cancel e->ignore(); break; diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index e757d00..b285c8c 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -83,7 +83,7 @@ PaletteEditorAdvanced::~PaletteEditorAdvanced() { } -void PaletteEditorAdvanced::onToggleBuildInactive( bool v ) +void PaletteEditorAdvanced::onToggleBuildInactive(bool v) { if (selectedPalette == 1) { groupCentral->setDisabled(v); @@ -171,7 +171,7 @@ void PaletteEditorAdvanced::onToggleBuildEffects(bool on) QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item) { - switch( item ) { + switch (item) { case 0: default: return QPalette::Active; @@ -184,7 +184,7 @@ QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item) QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item) { - switch( item ) { + switch (item) { case 0: return QPalette::Window; case 1: @@ -220,7 +220,7 @@ QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item) QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item) { - switch( item ) { + switch (item) { case 0: return QPalette::Light; case 1: @@ -327,7 +327,7 @@ void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role) { int initRole = 0; - switch(role) { + switch (role) { case QPalette::Window: initRole = 0; break; @@ -385,8 +385,8 @@ QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init, PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent); dlg->setupBackgroundRole(backgroundRole); - if ( init != QPalette() ) - dlg->setPal( init ); + if (init != QPalette()) + dlg->setPal(init); int resultCode = dlg->exec(); QPalette result = init; diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h index f70648b..9dc4657 100644 --- a/tools/qtconfig/paletteeditoradvanced.h +++ b/tools/qtconfig/paletteeditoradvanced.h @@ -55,9 +55,9 @@ public: PaletteEditorAdvanced(QWidget *parent = 0); ~PaletteEditorAdvanced(); - static QPalette getPalette( bool *ok, const QPalette &pal, - QPalette::ColorRole backgroundRole = QPalette::Window, - QWidget *parent = 0 ); + static QPalette getPalette(bool *ok, const QPalette &pal, + QPalette::ColorRole backgroundRole = QPalette::Window, + QWidget *parent = 0); static QPalette buildEffect(QPalette::ColorGroup colorGroup, const QPalette &basePalette); diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp index 95d64cf..d08b770 100644 --- a/tools/qtconfig/previewframe.cpp +++ b/tools/qtconfig/previewframe.cpp @@ -82,7 +82,7 @@ void PreviewFrame::setPreviewVisible(bool visible) workspace->viewport()->update(); } -Workspace::Workspace(PreviewFrame* parent) +Workspace::Workspace(PreviewFrame *parent) : QMdiArea(parent) { previewFrame = parent; @@ -92,7 +92,7 @@ Workspace::Workspace(PreviewFrame* parent) frame->show(); } -void Workspace::paintEvent( QPaintEvent* ) +void Workspace::paintEvent(QPaintEvent *) { QPainter p(viewport()); p.fillRect(rect(), palette().color(backgroundRole()).dark()); diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp index abbf669..4a4a580 100644 --- a/tools/qtconfig/previewwidget.cpp +++ b/tools/qtconfig/previewwidget.cpp @@ -50,7 +50,7 @@ PreviewWidget::PreviewWidget(QWidget *parent) setupUi(this); // install event filter on child widgets - QList l = findChildren(); + QList l = findChildren(); foreach(QWidget *w, l) { w->installEventFilter(this); w->setFocusPolicy(Qt::NoFocus); @@ -66,7 +66,7 @@ void PreviewWidget::closeEvent(QCloseEvent *e) bool PreviewWidget::eventFilter(QObject *, QEvent *e) { - switch ( e->type() ) { + switch (e->type()) { case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: -- cgit v0.12 From 0bcad9bd0d8c98807babe6ae3de2ef54dfbf7c22 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:37 +0200 Subject: Replaced the unnecessary include with declaration Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/previewframe.cpp | 1 + tools/qtconfig/previewframe.h | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp index d08b770..f37ac78 100644 --- a/tools/qtconfig/previewframe.cpp +++ b/tools/qtconfig/previewframe.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "previewframe.h" +#include "previewwidget.h" #include #include diff --git a/tools/qtconfig/previewframe.h b/tools/qtconfig/previewframe.h index b21e529..41c5030 100644 --- a/tools/qtconfig/previewframe.h +++ b/tools/qtconfig/previewframe.h @@ -42,8 +42,6 @@ #ifndef PREVIEWFRAME_H #define PREVIEWFRAME_H -#include "previewwidget.h" - #include QT_BEGIN_NAMESPACE @@ -63,6 +61,7 @@ private: PreviewFrame *previewFrame; }; +class PreviewWidget; class PreviewFrame : public QFrame { Q_OBJECT -- cgit v0.12 From 5aeda02c1b34ee0534390872f2ae400baab7baed Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:38 +0200 Subject: Removed the inheritance from ui file in qtconfig's PaletteEditorAdvanced Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/paletteeditoradvanced.cpp | 73 ++++++++++++++++---------------- tools/qtconfig/paletteeditoradvanced.h | 10 ++++- 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index b285c8c..196cdea 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -38,41 +38,41 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - +#include "ui_paletteeditoradvanced.h" #include "paletteeditoradvanced.h" #include "colorbutton.h" QT_BEGIN_NAMESPACE PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent) - : QDialog(parent), selectedPalette(0) + : QDialog(parent), ui(new Ui::PaletteEditorAdvanced), selectedPalette(0) { - setupUi(this); + ui->setupUi(this); // create a ColorButton's - buttonCentral = new ColorButton(groupCentral); + buttonCentral = new ColorButton(ui->groupCentral); buttonCentral->setToolTip(tr("Choose a color")); buttonCentral->setWhatsThis(tr("Choose a color for the selected central color role.")); - layoutCentral->addWidget(buttonCentral); - labelCentral->setBuddy(buttonCentral); + ui->layoutCentral->addWidget(buttonCentral); + ui->labelCentral->setBuddy(buttonCentral); - buttonEffect = new ColorButton(groupEffect); + buttonEffect = new ColorButton(ui->groupEffect); buttonEffect->setToolTip(tr("Choose a color")); buttonEffect->setWhatsThis(tr("Choose a color for the selected effect color role.")); buttonEffect->setEnabled(false); - layoutEffect->addWidget(buttonEffect); - labelEffect->setBuddy(buttonEffect); + ui->layoutEffect->addWidget(buttonEffect); + ui->labelEffect->setBuddy(buttonEffect); // signals and slots connections - connect(paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(comboCentral, SIGNAL(activated(int)), SLOT(onCentral(int))); + connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); + connect(ui->comboCentral, SIGNAL(activated(int)), SLOT(onCentral(int))); connect(buttonCentral, SIGNAL(clicked()), SLOT(onChooseCentralColor())); connect(buttonEffect, SIGNAL(clicked()), SLOT(onChooseEffectColor())); - connect(comboEffect, SIGNAL(activated(int)), SLOT(onEffect(int))); - connect(checkBuildEffect, SIGNAL(toggled(bool)), SLOT(onToggleBuildEffects(bool))); - connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); - connect(checkBuildInactive, SIGNAL(toggled(bool)), SLOT(onToggleBuildInactive(bool))); - connect(checkBuildDisabled, SIGNAL(toggled(bool)), SLOT(onToggleBuildDisabled(bool))); + connect(ui->comboEffect, SIGNAL(activated(int)), SLOT(onEffect(int))); + connect(ui->checkBuildEffect, SIGNAL(toggled(bool)), SLOT(onToggleBuildEffects(bool))); + connect(ui->checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); + connect(ui->checkBuildInactive, SIGNAL(toggled(bool)), SLOT(onToggleBuildInactive(bool))); + connect(ui->checkBuildDisabled, SIGNAL(toggled(bool)), SLOT(onToggleBuildDisabled(bool))); onToggleBuildEffects(true); @@ -81,13 +81,14 @@ PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent) PaletteEditorAdvanced::~PaletteEditorAdvanced() { + delete ui; } void PaletteEditorAdvanced::onToggleBuildInactive(bool v) { if (selectedPalette == 1) { - groupCentral->setDisabled(v); - groupEffect->setDisabled(v); + ui->groupCentral->setDisabled(v); + ui->groupEffect->setDisabled(v); } if (v) { @@ -99,8 +100,8 @@ void PaletteEditorAdvanced::onToggleBuildInactive(bool v) void PaletteEditorAdvanced::onToggleBuildDisabled(bool v) { if (selectedPalette == 2) { - groupCentral->setDisabled(v); - groupEffect->setDisabled(v); + ui->groupCentral->setDisabled(v); + ui->groupEffect->setDisabled(v); } if (v) { @@ -114,16 +115,16 @@ void PaletteEditorAdvanced::paletteSelected(int p) selectedPalette = p; if(p == 1) { // inactive - groupCentral->setDisabled(checkBuildInactive->isChecked()); - groupEffect->setDisabled(checkBuildInactive->isChecked()); + ui->groupCentral->setDisabled(ui->checkBuildInactive->isChecked()); + ui->groupEffect->setDisabled(ui->checkBuildInactive->isChecked()); } else if (p == 2) { // disabled - groupCentral->setDisabled(checkBuildDisabled->isChecked()); - groupEffect->setDisabled(checkBuildDisabled->isChecked()); + ui->groupCentral->setDisabled(ui->checkBuildDisabled->isChecked()); + ui->groupEffect->setDisabled(ui->checkBuildDisabled->isChecked()); } else { - groupCentral->setEnabled(true); - groupEffect->setEnabled(true); + ui->groupCentral->setEnabled(true); + ui->groupEffect->setEnabled(true); } updateColorButtons(); } @@ -131,14 +132,14 @@ void PaletteEditorAdvanced::paletteSelected(int p) void PaletteEditorAdvanced::onChooseCentralColor() { QPalette::ColorGroup group = groupFromIndex(selectedPalette); - editPalette.setColor(group, centralFromIndex(comboCentral->currentIndex()), + editPalette.setColor(group, centralFromIndex(ui->comboCentral->currentIndex()), buttonCentral->color()); buildEffect(group); if (group == QPalette::Active) { - if(checkBuildInactive->isChecked()) + if(ui->checkBuildInactive->isChecked()) build(QPalette::Inactive); - if(checkBuildDisabled->isChecked()) + if(ui->checkBuildDisabled->isChecked()) build(QPalette::Disabled); } @@ -148,13 +149,13 @@ void PaletteEditorAdvanced::onChooseCentralColor() void PaletteEditorAdvanced::onChooseEffectColor() { QPalette::ColorGroup group = groupFromIndex(selectedPalette); - editPalette.setColor(group, effectFromIndex(comboEffect->currentIndex()), + editPalette.setColor(group, effectFromIndex(ui->comboEffect->currentIndex()), buttonEffect->color()); if (group == QPalette::Active) { - if(checkBuildInactive->isChecked()) + if(ui->checkBuildInactive->isChecked()) build(QPalette::Inactive); - if(checkBuildDisabled->isChecked()) + if(ui->checkBuildDisabled->isChecked()) build(QPalette::Disabled); } @@ -296,7 +297,7 @@ void PaletteEditorAdvanced::build(QPalette::ColorGroup colorGroup) editPalette.setColor(colorGroup, QPalette::HighlightedText, Qt::darkGray); } - if (checkBuildEffect->isChecked()) + if (ui->checkBuildEffect->isChecked()) buildEffect(colorGroup); else updateColorButtons(); @@ -307,9 +308,9 @@ void PaletteEditorAdvanced::updateColorButtons() { QPalette::ColorGroup colorGroup = groupFromIndex(selectedPalette); buttonCentral->setColor(editPalette.color(colorGroup, - centralFromIndex(comboCentral->currentIndex()))); + centralFromIndex(ui->comboCentral->currentIndex()))); buttonEffect->setColor(editPalette.color(colorGroup, - effectFromIndex(comboEffect->currentIndex()))); + effectFromIndex(ui->comboEffect->currentIndex()))); } void PaletteEditorAdvanced::setPal(const QPalette &pal) @@ -376,7 +377,7 @@ void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role) } if (initRole != -1) - comboCentral->setCurrentIndex(initRole); + ui->comboCentral->setCurrentIndex(initRole); } QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init, diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h index 9dc4657..9f7a3f7 100644 --- a/tools/qtconfig/paletteeditoradvanced.h +++ b/tools/qtconfig/paletteeditoradvanced.h @@ -42,13 +42,17 @@ #ifndef PALETTEEDITORADVANCED_H #define PALETTEEDITORADVANCED_H -#include "ui_paletteeditoradvanced.h" +#include + +namespace Ui { + class PaletteEditorAdvanced; +} QT_BEGIN_NAMESPACE class ColorButton; -class PaletteEditorAdvanced : public QDialog, public Ui::PaletteEditorAdvanced +class PaletteEditorAdvanced : public QDialog { Q_OBJECT public: @@ -90,6 +94,8 @@ private: static QPalette::ColorRole effectFromIndex(int); QPalette editPalette; + Ui::PaletteEditorAdvanced *ui; + int selectedPalette; ColorButton *buttonCentral; ColorButton *buttonEffect; -- cgit v0.12 From 9e2ad8173868fad7b31c1d249a5a816b40a65cfe Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:39 +0200 Subject: Fixed some problems in qtconfig's PreviewWidget One problem was introduced by the convertion of widget from Qt3: there is no such field as "text" in QTextEdit. Also, widget now is not direct ancestor of UI file. Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/previewwidget.cpp | 16 ++++++++++------ tools/qtconfig/previewwidget.h | 13 ++++++++++--- tools/qtconfig/previewwidget.ui | 32 ++++++++------------------------ 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp index 4a4a580..0573846 100644 --- a/tools/qtconfig/previewwidget.cpp +++ b/tools/qtconfig/previewwidget.cpp @@ -40,14 +40,15 @@ ****************************************************************************/ #include "previewwidget.h" +#include "ui_previewwidget.h" #include QT_BEGIN_NAMESPACE PreviewWidget::PreviewWidget(QWidget *parent) - : QWidget(parent) + : QWidget(parent), ui(new Ui::PreviewWidget) { - setupUi(this); + ui->setupUi(this); // install event filter on child widgets QList l = findChildren(); @@ -57,13 +58,11 @@ PreviewWidget::PreviewWidget(QWidget *parent) } } - -void PreviewWidget::closeEvent(QCloseEvent *e) +PreviewWidget::~PreviewWidget() { - e->ignore(); + delete ui; } - bool PreviewWidget::eventFilter(QObject *, QEvent *e) { switch (e->type()) { @@ -82,4 +81,9 @@ bool PreviewWidget::eventFilter(QObject *, QEvent *e) return false; } +void PreviewWidget::closeEvent(QCloseEvent *e) +{ + e->ignore(); +} + QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index 1452932..ee3513d 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -42,19 +42,26 @@ #ifndef PREVIEWWIDGET_H #define PREVIEWWIDGET_H -#include "ui_previewwidget.h" +#include + +namespace Ui { + class PreviewWidget; +} QT_BEGIN_NAMESPACE -class PreviewWidget : public QWidget, public Ui::PreviewWidget +class PreviewWidget : public QWidget { Q_OBJECT public: PreviewWidget(QWidget *parent = 0); + ~PreviewWidget(); - void closeEvent(QCloseEvent *); bool eventFilter(QObject *, QEvent *); +private: + void closeEvent(QCloseEvent *); + Ui::PreviewWidget* ui; }; QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidget.ui b/tools/qtconfig/previewwidget.ui index 9d86a1f..2e0789f 100644 --- a/tools/qtconfig/previewwidget.ui +++ b/tools/qtconfig/previewwidget.ui @@ -46,8 +46,8 @@ 0 0 - 414 - 318 + 398 + 282 @@ -59,21 +59,9 @@ Preview Window - - - 6 - - - 11 - + - - 6 - - - 0 - @@ -225,19 +213,15 @@ 32767 - 50 + 55 true - - <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> @@ -256,7 +240,7 @@ 20 - 20 + 0 -- cgit v0.12 From 68334589014e9b392a8ab274b6ef718e52512f82 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:39 +0200 Subject: Fixed a bug and resolved some translation issues in qtconfig Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index fd083c1..e7d7a13 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -231,7 +231,7 @@ MainWindow::MainWindow() gstyles.sort(); gstylecombo->addItem(desktopThemeName); gstylecombo->setItemData(gstylecombo->findText(desktopThemeName), - tr("Choose style and palette based on your desktop settings."), Qt::ToolTipRole); + tr("Choose style and palette based on your desktop settings."), Qt::ToolTipRole); gstylecombo->addItems(gstyles); QSettings settings(QLatin1String("Trolltech")); @@ -246,7 +246,7 @@ MainWindow::MainWindow() if (index != -1) { gstylecombo->setCurrentIndex(index); } else { // we give up - gstylecombo->addItem(QLatin1String("Unknown")); + gstylecombo->addItem(tr("Unknown")); gstylecombo->setCurrentIndex(gstylecombo->count() - 1); } } @@ -436,7 +436,7 @@ MainWindow::MainWindow() continue; //This is used implicitly from the auto setting GstElement *sink = gst_element_factory_make (qPrintable(name), NULL); if (sink) { - description = QLatin1String(gst_element_factory_get_description (GST_ELEMENT_FACTORY(feature))); + description = QLatin1String(gst_element_factory_get_description(GST_ELEMENT_FACTORY(feature))); audiosinkCombo->addItem(name, name); audiosinkCombo->setItemData(audiosinkCombo->findText(name), description, Qt::ToolTipRole); gst_object_unref (sink); @@ -539,11 +539,11 @@ void MainWindow::fileSave() #ifdef Q_WS_X11 QString style = inputStyle->currentText(); QString str = QLatin1String("On The Spot"); - if (style == trUtf8("Over The Spot")) + if (style == tr("Over The Spot")) str = QLatin1String("Over The Spot"); - else if (style == trUtf8("Off The Spot")) + else if (style == tr("Off The Spot")) str = QLatin1String("Off The Spot"); - else if (style == trUtf8("Root")) + else if (style == tr("Root")) str = QLatin1String("Root"); settings.setValue(QLatin1String("XIMInputStyle"), str); #endif @@ -598,7 +598,7 @@ void MainWindow::fileSave() #endif // Q_WS_X11 setModified(false); - statusBar()->showMessage(QLatin1String("Saved changes.")); + statusBar()->showMessage(tr("Saved changes.")); } void MainWindow::fileExit() @@ -622,7 +622,7 @@ void MainWindow::buildPalette() temp = PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup(i), temp); editPalette = temp; - + setPreviewPalette(editPalette); updateColorButtons(); setModified(true); -- cgit v0.12 From ece4b6c39c32ec32e10cb841157c54d5724c76df Mon Sep 17 00:00:00 2001 From: Boris Date: Wed, 6 Oct 2010 15:51:40 +0200 Subject: Removed inheritance from UI file in qtconfig's MainWindow Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 504 ++++++++++++++++++++++-------------------- tools/qtconfig/mainwindow.h | 10 +- 2 files changed, 269 insertions(+), 245 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index e7d7a13..7301bab 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -40,6 +40,8 @@ ****************************************************************************/ #include "mainwindow.h" +#include "ui_mainwindow.h" + #include "colorbutton.h" #include "previewframe.h" #include "paletteeditoradvanced.h" @@ -179,94 +181,92 @@ static void setStyleHelper(QWidget *w, QStyle *s) } MainWindow::MainWindow() - : QMainWindow(), editPalette(palette()), previewPalette(palette()), previewstyle(0) + : QMainWindow(), ui(new Ui::MainWindow), editPalette(palette()), previewPalette(palette()), + previewstyle(0) { - setupUi(this); + ui->setupUi(this); statusBar(); // signals and slots connections - connect(fontpathlineedit, SIGNAL(returnPressed()), SLOT(addFontpath())); - connect(PushButton15, SIGNAL(clicked()), SLOT(addFontpath())); - connect(PushButton1, SIGNAL(clicked()), SLOT(addSubstitute())); - connect(PushButton14, SIGNAL(clicked()), SLOT(browseFontpath())); - connect(stylecombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(psizecombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(PushButton12, SIGNAL(clicked()), SLOT(downFontpath())); - connect(PushButton3, SIGNAL(clicked()), SLOT(downSubstitute())); - connect(familycombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); - connect(fileExitAction, SIGNAL(activated()), SLOT(fileExit())); - connect(fileSaveAction, SIGNAL(activated()), SLOT(fileSave())); - connect(helpAboutAction, SIGNAL(activated()), SLOT(helpAbout())); - connect(helpAboutQtAction, SIGNAL(activated()), SLOT(helpAboutQt())); - connect(TabWidget3, SIGNAL(currentChanged(QWidget*)), SLOT(pageChanged(QWidget*))); - connect(paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(PushButton13, SIGNAL(clicked()), SLOT(removeFontpath())); - connect(PushButton4, SIGNAL(clicked()), SLOT(removeSubstitute())); - connect(toolboxeffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(dcispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(cfispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(wslspin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(menueffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(comboeffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(audiosinkCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(videomodeCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(tooltipeffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(strutwidth, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(strutheight, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(effectcheckbox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(resolvelinks, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(fontembeddingcheckbox, SIGNAL(clicked()), SLOT(somethingModified())); - connect(rtlExtensions, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(inputStyle, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(inputMethod, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(gstylecombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); - connect(familysubcombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); - connect(btnAdvanced, SIGNAL(clicked()), SLOT(tunePalette())); - connect(PushButton11, SIGNAL(clicked()), SLOT(upFontpath())); - connect(PushButton2, SIGNAL(clicked()), SLOT(upSubstitute())); + connect(ui->fontpathlineedit, SIGNAL(returnPressed()), SLOT(addFontpath())); + connect(ui->PushButton15, SIGNAL(clicked()), SLOT(addFontpath())); + connect(ui->PushButton1, SIGNAL(clicked()), SLOT(addSubstitute())); + connect(ui->PushButton14, SIGNAL(clicked()), SLOT(browseFontpath())); + connect(ui->stylecombo, SIGNAL(activated(int)), SLOT(buildFont())); + connect(ui->psizecombo, SIGNAL(activated(int)), SLOT(buildFont())); + connect(ui->PushButton12, SIGNAL(clicked()), SLOT(downFontpath())); + connect(ui->PushButton3, SIGNAL(clicked()), SLOT(downSubstitute())); + connect(ui->familycombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); + connect(ui->fileExitAction, SIGNAL(activated()), SLOT(fileExit())); + connect(ui->fileSaveAction, SIGNAL(activated()), SLOT(fileSave())); + connect(ui->helpAboutAction, SIGNAL(activated()), SLOT(helpAbout())); + connect(ui->helpAboutQtAction, SIGNAL(activated()), SLOT(helpAboutQt())); + connect(ui->TabWidget3, SIGNAL(currentChanged(QWidget*)), SLOT(pageChanged(QWidget*))); + connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); + connect(ui->PushButton13, SIGNAL(clicked()), SLOT(removeFontpath())); + connect(ui->PushButton4, SIGNAL(clicked()), SLOT(removeSubstitute())); + connect(ui->toolboxeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->dcispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->cfispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->wslspin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->menueffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->comboeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->audiosinkCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->videomodeCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->tooltipeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->strutwidth, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->strutheight, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->effectcheckbox, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->resolvelinks, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->fontembeddingcheckbox, SIGNAL(clicked()), SLOT(somethingModified())); + connect(ui->rtlExtensions, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->inputStyle, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->inputMethod, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->gstylecombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); + connect(ui->familysubcombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); + connect(ui->btnAdvanced, SIGNAL(clicked()), SLOT(tunePalette())); + connect(ui->PushButton11, SIGNAL(clicked()), SLOT(upFontpath())); + connect(ui->PushButton2, SIGNAL(clicked()), SLOT(upSubstitute())); modified = true; desktopThemeName = tr("Desktop Settings (Default)"); QStringList gstyles = QStyleFactory::keys(); gstyles.sort(); - gstylecombo->addItem(desktopThemeName); - gstylecombo->setItemData(gstylecombo->findText(desktopThemeName), - tr("Choose style and palette based on your desktop settings."), Qt::ToolTipRole); - gstylecombo->addItems(gstyles); + ui->gstylecombo->addItem(desktopThemeName); + ui->gstylecombo->setItemData(ui->gstylecombo->findText(desktopThemeName), + tr("Choose style and palette based on your desktop settings."), + Qt::ToolTipRole); + ui->gstylecombo->addItems(gstyles); QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QString currentstyle = settings.value(QLatin1String("style")).toString(); if (currentstyle.isEmpty()) { - gstylecombo->setCurrentIndex(gstylecombo->findText(desktopThemeName)); + ui->gstylecombo->setCurrentIndex(ui->gstylecombo->findText(desktopThemeName)); currentstyle = QApplication::style()->objectName(); } else { - int index = gstylecombo->findText(currentstyle, Qt::MatchFixedString); + int index = ui->gstylecombo->findText(currentstyle, Qt::MatchFixedString); if (index != -1) { - gstylecombo->setCurrentIndex(index); + ui->gstylecombo->setCurrentIndex(index); } else { // we give up - gstylecombo->addItem(tr("Unknown")); - gstylecombo->setCurrentIndex(gstylecombo->count() - 1); + ui->gstylecombo->addItem(tr("Unknown")); + ui->gstylecombo->setCurrentIndex(ui->gstylecombo->count() - 1); } } - buttonMainColor->setColor(palette().color(QPalette::Active, - QPalette::Button)); - buttonWindowColor->setColor(palette().color(QPalette::Active, - QPalette::Window)); - connect(buttonMainColor, SIGNAL(colorChanged(QColor)), - this, SLOT(buildPalette())); - connect(buttonWindowColor, SIGNAL(colorChanged(QColor)), - this, SLOT(buildPalette())); + ui->buttonMainColor->setColor(palette().color(QPalette::Active, QPalette::Button)); + ui->buttonWindowColor->setColor(palette().color(QPalette::Active, QPalette::Window)); + connect(ui->buttonMainColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette())); + connect(ui->buttonWindowColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette())); if (X11->desktopEnvironment == DE_KDE) - colorConfig->hide(); + ui->colorConfig->hide(); else - labelKDENote->hide(); + ui->labelKDENote->hide(); QFontDatabase db; QStringList families = db.families(); - familycombo->addItems(families); + ui->familycombo->addItems(families); QStringList fs = families; QStringList fs2 = QFont::substitutions(); @@ -277,41 +277,41 @@ MainWindow::MainWindow() fsit++; } fs.sort(); - familysubcombo->addItems(fs); + ui->familysubcombo->addItems(fs); - choosesubcombo->addItems(families); + ui->choosesubcombo->addItems(families); QList sizes = db.standardSizes(); foreach(int i, sizes) - psizecombo->addItem(QString::number(i)); + ui->psizecombo->addItem(QString::number(i)); - dcispin->setValue(QApplication::doubleClickInterval()); - cfispin->setValue(QApplication::cursorFlashTime()); - wslspin->setValue(QApplication::wheelScrollLines()); + ui->dcispin->setValue(QApplication::doubleClickInterval()); + ui->cfispin->setValue(QApplication::cursorFlashTime()); + ui->wslspin->setValue(QApplication::wheelScrollLines()); // ############# // resolvelinks->setChecked(qt_resolve_symlinks); - effectcheckbox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); - effectbase->setEnabled(effectcheckbox->isChecked()); + ui->effectcheckbox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); + ui->effectbase->setEnabled(ui->effectcheckbox->isChecked()); if (QApplication::isEffectEnabled(Qt::UI_FadeMenu)) - menueffect->setCurrentIndex(2); + ui->menueffect->setCurrentIndex(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu)) - menueffect->setCurrentIndex(1); + ui->menueffect->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)) - comboeffect->setCurrentIndex(1); + ui->comboeffect->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) - tooltipeffect->setCurrentIndex(2); + ui->tooltipeffect->setCurrentIndex(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) - tooltipeffect->setCurrentIndex(1); + ui->tooltipeffect->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox)) - toolboxeffect->setCurrentIndex(1); + ui->toolboxeffect->setCurrentIndex(1); QSize globalStrut = QApplication::globalStrut(); - strutwidth->setValue(globalStrut.width()); - strutheight->setValue(globalStrut.height()); + ui->strutwidth->setValue(globalStrut.width()); + ui->strutheight->setValue(globalStrut.height()); // find the default family QStringList::Iterator sit = families.begin(); @@ -330,10 +330,10 @@ MainWindow::MainWindow() if (i == -1) // no clue about the current font i = 0; - familycombo->setCurrentIndex(i); + ui->familycombo->setCurrentIndex(i); - QStringList styles = db.styles(familycombo->currentText()); - stylecombo->addItems(styles); + QStringList styles = db.styles(ui->familycombo->currentText()); + ui->stylecombo->addItems(styles); QString stylestring = db.styleString(QApplication::font()); sit = styles.begin(); @@ -352,34 +352,35 @@ MainWindow::MainWindow() i = possible; if (i == -1) // no clue about the current font i = 0; - stylecombo->setCurrentIndex(i); + ui->stylecombo->setCurrentIndex(i); i = 0; - for (int psize = QApplication::font().pointSize(); i < psizecombo->count(); ++i) { - const int sz = psizecombo->itemText(i).toInt(); + for (int psize = QApplication::font().pointSize(); i < ui->psizecombo->count(); ++i) { + const int sz = ui->psizecombo->itemText(i).toInt(); if (sz == psize) { - psizecombo->setCurrentIndex(i); + ui->psizecombo->setCurrentIndex(i); break; } else if(sz > psize) { - psizecombo->insertItem(i, QString::number(psize)); - psizecombo->setCurrentIndex(i); + ui->psizecombo->insertItem(i, QString::number(psize)); + ui->psizecombo->setCurrentIndex(i); break; } } - QStringList subs = QFont::substitutes(familysubcombo->currentText()); - sublistbox->clear(); - sublistbox->insertItems(0, subs); + QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); - rtlExtensions->setChecked(settings.value(QLatin1String("useRtlExtensions"), false).toBool()); + ui->rtlExtensions->setChecked(settings.value(QLatin1String("useRtlExtensions"), false) + .toBool()); #ifdef Q_WS_X11 QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString(); if (!settingsInputStyle.isEmpty()) - inputStyle->setCurrentIndex(inputStyle->findText(settingsInputStyle)); + ui->inputStyle->setCurrentIndex(ui->inputStyle->findText(settingsInputStyle)); #else - inputStyle->hide(); - inputStyleLabel->hide(); + ui->inputStyle->hide(); + ui->inputStyleLabel->hide(); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) @@ -398,32 +399,35 @@ MainWindow::MainWindow() } if (inputMethodIndex == -1 && !inputMethods.isEmpty()) inputMethodIndex = 0; - inputMethod->addItems(inputMethods); - inputMethod->setCurrentIndex(inputMethodIndex); + ui->inputMethod->addItems(inputMethods); + ui->inputMethod->setCurrentIndex(inputMethodIndex); #else - inputMethod->hide(); - inputMethodLabel->hide(); + ui->inputMethod->hide(); + ui->inputMethodLabel->hide(); #endif - fontembeddingcheckbox->setChecked(settings.value(QLatin1String("embedFonts"), true).toBool()); + ui->fontembeddingcheckbox->setChecked(settings.value(QLatin1String("embedFonts"), true) + .toBool()); fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); - fontpathlistbox->insertItems(0, fontpaths); - - audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); - audiosinkCombo->setItemData(audiosinkCombo->findText(tr("Auto (default)")), - tr("Choose audio output automatically."), Qt::ToolTipRole); - audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink")); - audiosinkCombo->setItemData(audiosinkCombo->findText(tr("aRts")), - tr("Experimental aRts support for GStreamer."), Qt::ToolTipRole); + ui->fontpathlistbox->insertItems(0, fontpaths); + + ui->audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); + ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("Auto (default)")), + tr("Choose audio output automatically."), Qt::ToolTipRole); + ui->audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink")); + ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("aRts")), + tr("Experimental aRts support for GStreamer."), + Qt::ToolTipRole); #ifdef HAVE_PHONON phononVersionLabel->setText(QLatin1String(Phonon::phononVersion())); #endif #ifndef QT_NO_GSTREAMER if (gst_init_check(0, 0, 0)) { gchar *versionString = gst_version_string(); - gstversionLabel->setText(QLatin1String(versionString)); + ui->gstversionLabel->setText(QLatin1String(versionString)); g_free(versionString); - GList *factoryList = gst_registry_get_feature_list(gst_registry_get_default (), GST_TYPE_ELEMENT_FACTORY); + GList *factoryList = gst_registry_get_feature_list(gst_registry_get_default(), + GST_TYPE_ELEMENT_FACTORY); QString name, klass, description; for (GList *iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) { GstPluginFeature *feature = GST_PLUGIN_FEATURE(iter->data); @@ -431,14 +435,15 @@ MainWindow::MainWindow() if (klass == QLatin1String("Sink/Audio")) { name = QLatin1String(GST_PLUGIN_FEATURE_NAME(feature)); if (name == QLatin1String("sfsink")) - continue; //useless to output audio to file when you cannot set the file path + continue; // useless to output audio to file when you cannot set the file path else if (name == QLatin1String("autoaudiosink")) continue; //This is used implicitly from the auto setting GstElement *sink = gst_element_factory_make (qPrintable(name), NULL); if (sink) { description = QLatin1String(gst_element_factory_get_description(GST_ELEMENT_FACTORY(feature))); - audiosinkCombo->addItem(name, name); - audiosinkCombo->setItemData(audiosinkCombo->findText(name), description, Qt::ToolTipRole); + ui->audiosinkCombo->addItem(name, name); + ui->audiosinkCombo->setItemData(audiosinkCombo->findText(name), description, + Qt::ToolTipRole); gst_object_unref (sink); } } @@ -446,31 +451,40 @@ MainWindow::MainWindow() g_list_free(factoryList); } #else - tab4->setEnabled(false); - phononLabel->setText(tr("Phonon GStreamer backend not available.")); + ui->tab4->setEnabled(false); + ui->phononLabel->setText(tr("Phonon GStreamer backend not available.")); #endif - videomodeCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); - videomodeCombo->setItemData(videomodeCombo->findText(tr("Auto (default)")), tr("Choose render method automatically"), Qt::ToolTipRole); + ui->videomodeCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); + ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Auto (default)")), + tr("Choose render method automatically"), Qt::ToolTipRole); #ifdef Q_WS_X11 - videomodeCombo->addItem(tr("X11"), QLatin1String("X11")); - videomodeCombo->setItemData(videomodeCombo->findText(tr("X11")), tr("Use X11 Overlays"), Qt::ToolTipRole); + ui->videomodeCombo->addItem(tr("X11"), QLatin1String("X11")); + ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("X11")), + tr("Use X11 Overlays"), Qt::ToolTipRole); #endif #ifndef QT_NO_OPENGL +<<<<<<< HEAD videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); videomodeCombo->setItemData(videomodeCombo->findText(tr("OpenGL")), tr("Use OpenGL if available"), Qt::ToolTipRole); +======= + ui->videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); + ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("OpenGL")), + tr("Use OpenGL if avaiable"), Qt::ToolTipRole); +>>>>>>> Removed inheritance from UI file in qtconfig's MainWindow #endif - videomodeCombo->addItem(tr("Software"), QLatin1String("Software")); - videomodeCombo->setItemData(videomodeCombo->findText(tr("Software")), tr("Use simple software rendering"), Qt::ToolTipRole); + ui->videomodeCombo->addItem(tr("Software"), QLatin1String("Software")); + ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Software")), + tr("Use simple software rendering"), Qt::ToolTipRole); QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); - audiosinkCombo->setCurrentIndex(audiosinkCombo->findData(audioSink)); - videomodeCombo->setCurrentIndex(videomodeCombo->findData(videoMode)); + ui->audiosinkCombo->setCurrentIndex(ui->audiosinkCombo->findData(audioSink)); + ui->videomodeCombo->setCurrentIndex(ui->videomodeCombo->findData(videoMode)); settings.endGroup(); // Qt - helpview->setText(tr(appearance_text)); + ui->helpview->setText(tr(appearance_text)); setModified(false); updateStyleLayout(); @@ -478,6 +492,7 @@ MainWindow::MainWindow() MainWindow::~MainWindow() { + delete ui; } #ifdef Q_WS_X11 @@ -497,23 +512,23 @@ void MainWindow::fileSave() QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QFontDatabase db; - QFont font = db.font(familycombo->currentText(), - stylecombo->currentText(), - psizecombo->currentText().toInt()); + QFont font = db.font(ui->familycombo->currentText(), + ui->stylecombo->currentText(), + ui->psizecombo->currentText().toInt()); QStringList actcg, inactcg, discg; - bool overrideDesktopSettings = (gstylecombo->currentText() != desktopThemeName); + bool overrideDesktopSettings = (ui->gstylecombo->currentText() != desktopThemeName); if (overrideDesktopSettings) { int i; for (i = 0; i < QPalette::NColorRoles; i++) actcg << editPalette.color(QPalette::Active, - (QPalette::ColorRole) i).name(); + QPalette::ColorRole(i)).name(); for (i = 0; i < QPalette::NColorRoles; i++) inactcg << editPalette.color(QPalette::Inactive, - (QPalette::ColorRole) i).name(); + QPalette::ColorRole(i)).name(); for (i = 0; i < QPalette::NColorRoles; i++) discg << editPalette.color(QPalette::Disabled, - (QPalette::ColorRole) i).name(); + QPalette::ColorRole(i)).name(); } settings.setValue(QLatin1String("font"), font.toString()); @@ -522,22 +537,24 @@ void MainWindow::fileSave() settings.setValue(QLatin1String("Palette/disabled"), discg); settings.setValue(QLatin1String("fontPath"), fontpaths); - settings.setValue(QLatin1String("embedFonts"), fontembeddingcheckbox->isChecked()); - settings.setValue(QLatin1String("style"), overrideDesktopSettings ? gstylecombo->currentText() : QString()); + settings.setValue(QLatin1String("embedFonts"), ui->fontembeddingcheckbox->isChecked()); + settings.setValue(QLatin1String("style"), + overrideDesktopSettings ? ui->gstylecombo->currentText() : QString()); - settings.setValue(QLatin1String("doubleClickInterval"), dcispin->value()); - settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value()); - settings.setValue(QLatin1String("wheelScrollLines"), wslspin->value()); - settings.setValue(QLatin1String("resolveSymlinks"), resolvelinks->isChecked()); + settings.setValue(QLatin1String("doubleClickInterval"), ui->dcispin->value()); + settings.setValue(QLatin1String("cursorFlashTime"), + ui->cfispin->value() == 9 ? 0 : ui->cfispin->value()); + settings.setValue(QLatin1String("wheelScrollLines"), ui->wslspin->value()); + settings.setValue(QLatin1String("resolveSymlinks"), ui->resolvelinks->isChecked()); - QSize strut(strutwidth->value(), strutheight->value()); + QSize strut(ui->strutwidth->value(), ui->strutheight->value()); settings.setValue(QLatin1String("globalStrut/width"), strut.width()); settings.setValue(QLatin1String("globalStrut/height"), strut.height()); - settings.setValue(QLatin1String("useRtlExtensions"), rtlExtensions->isChecked()); + settings.setValue(QLatin1String("useRtlExtensions"), ui->rtlExtensions->isChecked()); #ifdef Q_WS_X11 - QString style = inputStyle->currentText(); + QString style = ui->inputStyle->currentText(); QString str = QLatin1String("On The Spot"); if (style == tr("Over The Spot")) str = QLatin1String("Over The Spot"); @@ -548,33 +565,35 @@ void MainWindow::fileSave() settings.setValue(QLatin1String("XIMInputStyle"), str); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) - settings.setValue(QLatin1String("DefaultInputMethod"), inputMethod->currentText()); + settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethod->currentText()); #endif QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); - settings.setValue(QLatin1String("audiosink"), audiosinkCombo->itemData(audiosinkCombo->currentIndex())); - settings.setValue(QLatin1String("videomode"), videomodeCombo->itemData(videomodeCombo->currentIndex())); + settings.setValue(QLatin1String("audiosink"), + ui->audiosinkCombo->itemData(ui->audiosinkCombo->currentIndex())); + settings.setValue(QLatin1String("videomode"), + ui->videomodeCombo->itemData(ui->videomodeCombo->currentIndex())); QStringList effects; - if (effectcheckbox->isChecked()) { + if (ui->effectcheckbox->isChecked()) { effects << QLatin1String("general"); - switch (menueffect->currentIndex()) { + switch (ui->menueffect->currentIndex()) { case 1: effects << QLatin1String("animatemenu"); break; case 2: effects << QLatin1String("fademenu"); break; } - switch (comboeffect->currentIndex()) { + switch (ui->comboeffect->currentIndex()) { case 1: effects << QLatin1String("animatecombo"); break; } - switch (tooltipeffect->currentIndex()) { + switch (ui->tooltipeffect->currentIndex()) { case 1: effects << QLatin1String("animatetooltip"); break; case 2: effects << QLatin1String("fadetooltip"); break; } - switch (toolboxeffect->currentIndex()) { + switch (ui->toolboxeffect->currentIndex()) { case 1: effects << QLatin1String("animatetoolbox"); break; } } else @@ -612,12 +631,12 @@ void MainWindow::setModified(bool m) return; modified = m; - fileSaveAction->setEnabled(m); + ui->fileSaveAction->setEnabled(m); } void MainWindow::buildPalette() { - QPalette temp(buttonMainColor->color(), buttonWindowColor->color()); + QPalette temp(ui->buttonMainColor->color(), ui->buttonWindowColor->color()); for (int i = 0; i < QPalette::NColorGroups; i++) temp = PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup(i), temp); @@ -630,7 +649,7 @@ void MainWindow::buildPalette() void MainWindow::setPreviewPalette(const QPalette &pal) { - QPalette::ColorGroup colorGroup = groupFromIndex(paletteCombo->currentIndex()); + QPalette::ColorGroup colorGroup = groupFromIndex(ui->paletteCombo->currentIndex()); for (int i = 0; i < QPalette::NColorGroups; i++) { for (int j = 0; j < QPalette::NColorRoles; j++) { @@ -640,13 +659,13 @@ void MainWindow::setPreviewPalette(const QPalette &pal) } } - previewFrame->setPreviewPalette(previewPalette); + ui->previewFrame->setPreviewPalette(previewPalette); } void MainWindow::updateColorButtons() { - buttonMainColor->setColor(editPalette.color(QPalette::Active, QPalette::Button)); - buttonWindowColor->setColor(editPalette.color(QPalette::Active, QPalette::Window)); + ui->buttonMainColor->setColor(editPalette.color(QPalette::Active, QPalette::Button)); + ui->buttonWindowColor->setColor(editPalette.color(QPalette::Active, QPalette::Window)); } void MainWindow::tunePalette() @@ -669,10 +688,10 @@ void MainWindow::paletteSelected(int) void MainWindow::updateStyleLayout() { - QString currentStyle = gstylecombo->currentText(); + QString currentStyle = ui->gstylecombo->currentText(); bool autoStyle = (currentStyle == desktopThemeName); - previewFrame->setPreviewVisible(!autoStyle); - groupAutoPalette->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); + ui->previewFrame->setPreviewVisible(!autoStyle); + ui->groupAutoPalette->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); } void MainWindow::styleSelected(const QString &stylename) @@ -684,7 +703,7 @@ void MainWindow::styleSelected(const QString &stylename) style = QStyleFactory::create(stylename); if (!style) return; - setStyleHelper(previewFrame, style); + setStyleHelper(ui->previewFrame, style); delete previewstyle; previewstyle = style; setModified(true); @@ -696,169 +715,170 @@ void MainWindow::familySelected(const QString &family) { QFontDatabase db; QStringList styles = db.styles(family); - stylecombo->clear(); - stylecombo->addItems(styles); - familysubcombo->addItem(family); + ui->stylecombo->clear(); + ui->stylecombo->addItems(styles); + ui->familysubcombo->addItem(family); buildFont(); } void MainWindow::buildFont() { QFontDatabase db; - QFont font = db.font(familycombo->currentText(), - stylecombo->currentText(), - psizecombo->currentText().toInt()); - samplelineedit->setFont(font); + QFont font = db.font(ui->familycombo->currentText(), + ui->stylecombo->currentText(), + ui->psizecombo->currentText().toInt()); + ui->samplelineedit->setFont(font); setModified(true); } void MainWindow::substituteSelected(const QString &family) { QStringList subs = QFont::substitutes(family); - sublistbox->clear(); - sublistbox->insertItems(0, subs); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); } void MainWindow::removeSubstitute() { - if (!sublistbox->currentItem()) + if (!ui->sublistbox->currentItem()) return; - int row = sublistbox->currentRow(); - QStringList subs = QFont::substitutes(familysubcombo->currentText()); - subs.removeAt(sublistbox->currentRow()); - sublistbox->clear(); - sublistbox->insertItems(0, subs); - if (row > sublistbox->count()) - row = sublistbox->count() - 1; - sublistbox->setCurrentRow(row); - QFont::removeSubstitution(familysubcombo->currentText()); - QFont::insertSubstitutions(familysubcombo->currentText(), subs); + int row = ui->sublistbox->currentRow(); + QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); + subs.removeAt(ui->sublistbox->currentRow()); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); + if (row > ui->sublistbox->count()) + row = ui->sublistbox->count() - 1; + ui->sublistbox->setCurrentRow(row); + QFont::removeSubstitution(ui->familysubcombo->currentText()); + QFont::insertSubstitutions(ui->familysubcombo->currentText(), subs); setModified(true); } void MainWindow::addSubstitute() { - if (!sublistbox->currentItem()) { - QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); - QStringList subs = QFont::substitutes(familysubcombo->currentText()); - sublistbox->clear(); - sublistbox->insertItems(0, subs); + if (!ui->sublistbox->currentItem()) { + QFont::insertSubstitution(ui->familysubcombo->currentText(), + ui->choosesubcombo->currentText()); + QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); setModified(true); return; } - int row = sublistbox->currentRow(); - QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); - QStringList subs = QFont::substitutes(familysubcombo->currentText()); - sublistbox->clear(); - sublistbox->insertItems(0, subs); - sublistbox->setCurrentRow(row); + int row = ui->sublistbox->currentRow(); + QFont::insertSubstitution(ui->familysubcombo->currentText(), ui->choosesubcombo->currentText()); + QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); + ui->sublistbox->setCurrentRow(row); setModified(true); } void MainWindow::downSubstitute() { - if (!sublistbox->currentItem() || sublistbox->currentRow() >= sublistbox->count()) + if (!ui->sublistbox->currentItem() || ui->sublistbox->currentRow() >= ui->sublistbox->count()) return; - int row = sublistbox->currentRow(); - QStringList subs = QFont::substitutes(familysubcombo->currentText()); + int row = ui->sublistbox->currentRow(); + QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); QString fam = subs.at(row); subs.removeAt(row); subs.insert(row + 1, fam); - sublistbox->clear(); - sublistbox->insertItems(0, subs); - sublistbox->setCurrentRow(row + 1); - QFont::removeSubstitution(familysubcombo->currentText()); - QFont::insertSubstitutions(familysubcombo->currentText(), subs); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); + ui->sublistbox->setCurrentRow(row + 1); + QFont::removeSubstitution(ui->familysubcombo->currentText()); + QFont::insertSubstitutions(ui->familysubcombo->currentText(), subs); setModified(true); } void MainWindow::upSubstitute() { - if (!sublistbox->currentItem() || sublistbox->currentRow() < 1) + if (!ui->sublistbox->currentItem() || ui->sublistbox->currentRow() < 1) return; - int row = sublistbox->currentRow(); - QStringList subs = QFont::substitutes(familysubcombo->currentText()); + int row = ui->sublistbox->currentRow(); + QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); QString fam = subs.at(row); subs.removeAt(row); subs.insert(row-1, fam); - sublistbox->clear(); - sublistbox->insertItems(0, subs); - sublistbox->setCurrentRow(row - 1); - QFont::removeSubstitution(familysubcombo->currentText()); - QFont::insertSubstitutions(familysubcombo->currentText(), subs); + ui->sublistbox->clear(); + ui->sublistbox->insertItems(0, subs); + ui->sublistbox->setCurrentRow(row - 1); + QFont::removeSubstitution(ui->familysubcombo->currentText()); + QFont::insertSubstitutions(ui->familysubcombo->currentText(), subs); setModified(true); } void MainWindow::removeFontpath() { - if (!fontpathlistbox->currentItem()) + if (!ui->fontpathlistbox->currentItem()) return; - int row = fontpathlistbox->currentRow(); + int row = ui->fontpathlistbox->currentRow(); fontpaths.removeAt(row); - fontpathlistbox->clear(); - fontpathlistbox->insertItems(0, fontpaths); - if (row > fontpathlistbox->count()) - row = fontpathlistbox->count() - 1; - fontpathlistbox->setCurrentRow(row); + ui->fontpathlistbox->clear(); + ui->fontpathlistbox->insertItems(0, fontpaths); + if (row > ui->fontpathlistbox->count()) + row = ui->fontpathlistbox->count() - 1; + ui->fontpathlistbox->setCurrentRow(row); setModified(true); } void MainWindow::addFontpath() { - if (fontpathlineedit->text().isEmpty()) + if (ui->fontpathlineedit->text().isEmpty()) return; - if (!fontpathlistbox->currentItem()) { - fontpaths.append(fontpathlineedit->text()); - fontpathlistbox->clear(); - fontpathlistbox->insertItems(0, fontpaths); + if (!ui->fontpathlistbox->currentItem()) { + fontpaths.append(ui->fontpathlineedit->text()); + ui->fontpathlistbox->clear(); + ui->fontpathlistbox->insertItems(0, fontpaths); setModified(true); return; } - int row = fontpathlistbox->currentRow(); - fontpaths.insert(row + 1, fontpathlineedit->text()); - fontpathlistbox->clear(); - fontpathlistbox->insertItems(0, fontpaths); - fontpathlistbox->setCurrentRow(row); + int row = ui->fontpathlistbox->currentRow(); + fontpaths.insert(row + 1, ui->fontpathlineedit->text()); + ui->fontpathlistbox->clear(); + ui->fontpathlistbox->insertItems(0, fontpaths); + ui->fontpathlistbox->setCurrentRow(row); setModified(true); } void MainWindow::downFontpath() { - if (!fontpathlistbox->currentItem() - || fontpathlistbox->currentRow() >= (fontpathlistbox->count() - 1)) { + if (!ui->fontpathlistbox->currentItem() + || ui->fontpathlistbox->currentRow() >= (ui->fontpathlistbox->count() - 1)) { return; } - int row = fontpathlistbox->currentRow(); + int row = ui->fontpathlistbox->currentRow(); QString fam = fontpaths.at(row); fontpaths.removeAt(row); fontpaths.insert(row + 1, fam); - fontpathlistbox->clear(); - fontpathlistbox->insertItems(0, fontpaths); - fontpathlistbox->setCurrentRow(row + 1); + ui->fontpathlistbox->clear(); + ui->fontpathlistbox->insertItems(0, fontpaths); + ui->fontpathlistbox->setCurrentRow(row + 1); setModified(true); } void MainWindow::upFontpath() { - if (!fontpathlistbox->currentItem() || fontpathlistbox->currentRow() < 1) + if (!ui->fontpathlistbox->currentItem() || ui->fontpathlistbox->currentRow() < 1) return; - int row = fontpathlistbox->currentRow(); + int row = ui->fontpathlistbox->currentRow(); QString fam = fontpaths.at(row); fontpaths.removeAt(row); fontpaths.insert(row - 1, fam); - fontpathlistbox->clear(); - fontpathlistbox->insertItems(0, fontpaths); - fontpathlistbox->setCurrentRow(row - 1); + ui->fontpathlistbox->clear(); + ui->fontpathlistbox->insertItems(0, fontpaths); + ui->fontpathlistbox->setCurrentRow(row - 1); setModified(true); } @@ -868,7 +888,7 @@ void MainWindow::browseFontpath() if (dirname.isNull()) return; - fontpathlineedit->setText(dirname); + ui->fontpathlineedit->setText(dirname); } void MainWindow::somethingModified() @@ -895,16 +915,16 @@ void MainWindow::helpAboutQt() void MainWindow::pageChanged(QWidget *page) { - if (page == tab) - helpview->setText(tr(interface_text)); - else if (page == tab1) - helpview->setText(tr(appearance_text)); - else if (page == tab2) - helpview->setText(tr(font_text)); - else if (page == tab3) - helpview->setText(tr(printer_text)); - else if (page == tab4) - helpview->setText(tr(phonon_text)); + if (page == ui->tab) + ui->helpview->setText(tr(interface_text)); + else if (page == ui->tab1) + ui->helpview->setText(tr(appearance_text)); + else if (page == ui->tab2) + ui->helpview->setText(tr(font_text)); + else if (page == ui->tab3) + ui->helpview->setText(tr(printer_text)); + else if (page == ui->tab4) + ui->helpview->setText(tr(phonon_text)); } void MainWindow::closeEvent(QCloseEvent *e) diff --git a/tools/qtconfig/mainwindow.h b/tools/qtconfig/mainwindow.h index 76e3691..7cc6522 100644 --- a/tools/qtconfig/mainwindow.h +++ b/tools/qtconfig/mainwindow.h @@ -42,11 +42,15 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "ui_mainwindow.h" +namespace Ui { + class MainWindow; +} + +#include QT_BEGIN_NAMESPACE -class MainWindow : public QMainWindow, public Ui::MainWindow +class MainWindow : public QMainWindow { Q_OBJECT @@ -56,7 +60,6 @@ public: void closeEvent(QCloseEvent *); - public slots: virtual void buildPalette(); virtual void buildFont(); @@ -93,6 +96,7 @@ private: void setModified(bool); + Ui::MainWindow *ui; QString desktopThemeName; QPalette editPalette, previewPalette; QStyle *previewstyle; -- cgit v0.12 From 668afe43593ae95217c93be5ac4a8d3f5e833e89 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:41 +0200 Subject: Renamed controls in qtconfig's MainWindow All the controls are ensured to be named according to a Qt Coding Style. The code is much more readable now. Also, the html code inserts and tab stops in UI was fixed. Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 410 +++++++++++++++++++++--------------------- tools/qtconfig/mainwindow.ui | 293 +++++++++++++++--------------- 2 files changed, 357 insertions(+), 346 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 7301bab..266d9e4 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -188,70 +188,70 @@ MainWindow::MainWindow() statusBar(); // signals and slots connections - connect(ui->fontpathlineedit, SIGNAL(returnPressed()), SLOT(addFontpath())); - connect(ui->PushButton15, SIGNAL(clicked()), SLOT(addFontpath())); - connect(ui->PushButton1, SIGNAL(clicked()), SLOT(addSubstitute())); - connect(ui->PushButton14, SIGNAL(clicked()), SLOT(browseFontpath())); - connect(ui->stylecombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(ui->psizecombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(ui->PushButton12, SIGNAL(clicked()), SLOT(downFontpath())); - connect(ui->PushButton3, SIGNAL(clicked()), SLOT(downSubstitute())); - connect(ui->familycombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); + connect(ui->fontPathLineEdit, SIGNAL(returnPressed()), SLOT(addFontpath())); + connect(ui->addFontPathButton, SIGNAL(clicked()), SLOT(addFontpath())); + connect(ui->addSubstitutionButton, SIGNAL(clicked()), SLOT(addSubstitute())); + connect(ui->browseFontPathButton, SIGNAL(clicked()), SLOT(browseFontpath())); + connect(ui->fontStyleCombo, SIGNAL(activated(int)), SLOT(buildFont())); + connect(ui->pointSizeCombo, SIGNAL(activated(int)), SLOT(buildFont())); + connect(ui->downFontpathButton, SIGNAL(clicked()), SLOT(downFontpath())); + connect(ui->downSubstitutionButton, SIGNAL(clicked()), SLOT(downSubstitute())); + connect(ui->fontFamilyCombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); connect(ui->fileExitAction, SIGNAL(activated()), SLOT(fileExit())); connect(ui->fileSaveAction, SIGNAL(activated()), SLOT(fileSave())); connect(ui->helpAboutAction, SIGNAL(activated()), SLOT(helpAbout())); connect(ui->helpAboutQtAction, SIGNAL(activated()), SLOT(helpAboutQt())); - connect(ui->TabWidget3, SIGNAL(currentChanged(QWidget*)), SLOT(pageChanged(QWidget*))); + connect(ui->mainTabWidget, SIGNAL(currentChanged(QWidget*)), SLOT(pageChanged(QWidget*))); connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(ui->PushButton13, SIGNAL(clicked()), SLOT(removeFontpath())); - connect(ui->PushButton4, SIGNAL(clicked()), SLOT(removeSubstitute())); - connect(ui->toolboxeffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->dcispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->cfispin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->wslspin, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->menueffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->comboeffect, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->removeFontpathButton, SIGNAL(clicked()), SLOT(removeFontpath())); + connect(ui->removeSubstitutionButton, SIGNAL(clicked()), SLOT(removeSubstitute())); + connect(ui->toolBoxEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->doubleClickIntervalSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->cursorFlashTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->wheelScrollLinesSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->menuEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->comboEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); connect(ui->audiosinkCombo, SIGNAL(activated(int)), SLOT(somethingModified())); connect(ui->videomodeCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->tooltipeffect, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->strutwidth, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->strutheight, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->effectcheckbox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->resolvelinks, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->fontembeddingcheckbox, SIGNAL(clicked()), SLOT(somethingModified())); - connect(ui->rtlExtensions, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->inputStyle, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->inputMethod, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->gstylecombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); - connect(ui->familysubcombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); - connect(ui->btnAdvanced, SIGNAL(clicked()), SLOT(tunePalette())); - connect(ui->PushButton11, SIGNAL(clicked()), SLOT(upFontpath())); - connect(ui->PushButton2, SIGNAL(clicked()), SLOT(upSubstitute())); + connect(ui->toolTipEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->strutWidthSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->strutHeightSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); + connect(ui->effectsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->resolveLinksCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->fontEmbeddingCheckBox, SIGNAL(clicked()), SLOT(somethingModified())); + connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); + connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); + connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette())); + connect(ui->upFontpathButton, SIGNAL(clicked()), SLOT(upFontpath())); + connect(ui->upSubstitutionButton, SIGNAL(clicked()), SLOT(upSubstitute())); modified = true; desktopThemeName = tr("Desktop Settings (Default)"); QStringList gstyles = QStyleFactory::keys(); gstyles.sort(); - ui->gstylecombo->addItem(desktopThemeName); - ui->gstylecombo->setItemData(ui->gstylecombo->findText(desktopThemeName), - tr("Choose style and palette based on your desktop settings."), - Qt::ToolTipRole); - ui->gstylecombo->addItems(gstyles); + ui->guiStyleCombo->addItem(desktopThemeName); + ui->guiStyleCombo->setItemData(ui->guiStyleCombo->findText(desktopThemeName), + tr("Choose style and palette based on your desktop settings."), + Qt::ToolTipRole); + ui->guiStyleCombo->addItems(gstyles); QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QString currentstyle = settings.value(QLatin1String("style")).toString(); if (currentstyle.isEmpty()) { - ui->gstylecombo->setCurrentIndex(ui->gstylecombo->findText(desktopThemeName)); + ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->findText(desktopThemeName)); currentstyle = QApplication::style()->objectName(); } else { - int index = ui->gstylecombo->findText(currentstyle, Qt::MatchFixedString); + int index = ui->guiStyleCombo->findText(currentstyle, Qt::MatchFixedString); if (index != -1) { - ui->gstylecombo->setCurrentIndex(index); + ui->guiStyleCombo->setCurrentIndex(index); } else { // we give up - ui->gstylecombo->addItem(tr("Unknown")); - ui->gstylecombo->setCurrentIndex(ui->gstylecombo->count() - 1); + ui->guiStyleCombo->addItem(tr("Unknown")); + ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->count() - 1); } } ui->buttonMainColor->setColor(palette().color(QPalette::Active, QPalette::Button)); @@ -262,11 +262,11 @@ MainWindow::MainWindow() if (X11->desktopEnvironment == DE_KDE) ui->colorConfig->hide(); else - ui->labelKDENote->hide(); + ui->kdeNoteLabel->hide(); QFontDatabase db; QStringList families = db.families(); - ui->familycombo->addItems(families); + ui->fontFamilyCombo->addItems(families); QStringList fs = families; QStringList fs2 = QFont::substitutions(); @@ -277,41 +277,41 @@ MainWindow::MainWindow() fsit++; } fs.sort(); - ui->familysubcombo->addItems(fs); + ui->familySubstitutionCombo->addItems(fs); - ui->choosesubcombo->addItems(families); + ui->chooseSubstitutionCombo->addItems(families); QList sizes = db.standardSizes(); foreach(int i, sizes) - ui->psizecombo->addItem(QString::number(i)); + ui->pointSizeCombo->addItem(QString::number(i)); - ui->dcispin->setValue(QApplication::doubleClickInterval()); - ui->cfispin->setValue(QApplication::cursorFlashTime()); - ui->wslspin->setValue(QApplication::wheelScrollLines()); + ui->doubleClickIntervalSpinBox->setValue(QApplication::doubleClickInterval()); + ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime()); + ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines()); // ############# -// resolvelinks->setChecked(qt_resolve_symlinks); +// resolveLinksCheckBox->setChecked(qt_resolve_symlinks); - ui->effectcheckbox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); - ui->effectbase->setEnabled(ui->effectcheckbox->isChecked()); + ui->effectsCheckBox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); + ui->effectsFrame->setEnabled(ui->effectsCheckBox->isChecked()); if (QApplication::isEffectEnabled(Qt::UI_FadeMenu)) - ui->menueffect->setCurrentIndex(2); + ui->menuEffectCombo->setCurrentIndex(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu)) - ui->menueffect->setCurrentIndex(1); + ui->menuEffectCombo->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)) - ui->comboeffect->setCurrentIndex(1); + ui->comboEffectCombo->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) - ui->tooltipeffect->setCurrentIndex(2); + ui->toolTipEffectCombo->setCurrentIndex(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) - ui->tooltipeffect->setCurrentIndex(1); + ui->toolTipEffectCombo->setCurrentIndex(1); if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox)) - ui->toolboxeffect->setCurrentIndex(1); + ui->toolBoxEffectCombo->setCurrentIndex(1); QSize globalStrut = QApplication::globalStrut(); - ui->strutwidth->setValue(globalStrut.width()); - ui->strutheight->setValue(globalStrut.height()); + ui->strutWidthSpinBox->setValue(globalStrut.width()); + ui->strutHeightSpinBox->setValue(globalStrut.height()); // find the default family QStringList::Iterator sit = families.begin(); @@ -330,10 +330,10 @@ MainWindow::MainWindow() if (i == -1) // no clue about the current font i = 0; - ui->familycombo->setCurrentIndex(i); + ui->fontFamilyCombo->setCurrentIndex(i); - QStringList styles = db.styles(ui->familycombo->currentText()); - ui->stylecombo->addItems(styles); + QStringList styles = db.styles(ui->fontFamilyCombo->currentText()); + ui->fontStyleCombo->addItems(styles); QString stylestring = db.styleString(QApplication::font()); sit = styles.begin(); @@ -352,64 +352,64 @@ MainWindow::MainWindow() i = possible; if (i == -1) // no clue about the current font i = 0; - ui->stylecombo->setCurrentIndex(i); + ui->fontStyleCombo->setCurrentIndex(i); i = 0; - for (int psize = QApplication::font().pointSize(); i < ui->psizecombo->count(); ++i) { - const int sz = ui->psizecombo->itemText(i).toInt(); + for (int psize = QApplication::font().pointSize(); i < ui->pointSizeCombo->count(); ++i) { + const int sz = ui->pointSizeCombo->itemText(i).toInt(); if (sz == psize) { - ui->psizecombo->setCurrentIndex(i); + ui->pointSizeCombo->setCurrentIndex(i); break; } else if(sz > psize) { - ui->psizecombo->insertItem(i, QString::number(psize)); - ui->psizecombo->setCurrentIndex(i); + ui->pointSizeCombo->insertItem(i, QString::number(psize)); + ui->pointSizeCombo->setCurrentIndex(i); break; } } - QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); + QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); - ui->rtlExtensions->setChecked(settings.value(QLatin1String("useRtlExtensions"), false) - .toBool()); + ui->rtlExtensionsCheckBox->setChecked(settings.value(QLatin1String("useRtlExtensions"), false) + .toBool()); #ifdef Q_WS_X11 QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString(); if (!settingsInputStyle.isEmpty()) - ui->inputStyle->setCurrentIndex(ui->inputStyle->findText(settingsInputStyle)); + ui->inputStyleCombo->setCurrentIndex(ui->inputStyleCombo->findText(settingsInputStyle)); #else - ui->inputStyle->hide(); - ui->inputStyleLabel->hide(); + ui->inputStyleCombo->hide(); + ui->inputStyleComboLabel->hide(); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) - QStringList inputMethods = QInputContextFactory::keys(); - int inputMethodIndex = -1; + QStringList inputMethodCombo = QInputContextFactory::keys(); + int inputMethodComboIndex = -1; QString defaultInputMethod = settings.value(QLatin1String("DefaultInputMethod"), QLatin1String("xim")).toString(); - for (int i = inputMethods.size()-1; i >= 0; --i) { - const QString &im = inputMethods.at(i); + for (int i = inputMethodCombo.size()-1; i >= 0; --i) { + const QString &im = inputMethodCombo.at(i); if (im.contains(QLatin1String("imsw"))) { - inputMethods.removeAt(i); - if (inputMethodIndex > i) - --inputMethodIndex; + inputMethodCombo.removeAt(i); + if (inputMethodComboIndex > i) + --inputMethodComboIndex; } else if (im == defaultInputMethod) { - inputMethodIndex = i; + inputMethodComboIndex = i; } } - if (inputMethodIndex == -1 && !inputMethods.isEmpty()) - inputMethodIndex = 0; - ui->inputMethod->addItems(inputMethods); - ui->inputMethod->setCurrentIndex(inputMethodIndex); + if (inputMethodComboIndex == -1 && !inputMethodCombo.isEmpty()) + inputMethodComboIndex = 0; + ui->inputMethodCombo->addItems(inputMethodCombo); + ui->inputMethodCombo->setCurrentIndex(inputMethodComboIndex); #else - ui->inputMethod->hide(); - ui->inputMethodLabel->hide(); + ui->inputMethodCombo->hide(); + ui->inputMethodComboLabel->hide(); #endif - ui->fontembeddingcheckbox->setChecked(settings.value(QLatin1String("embedFonts"), true) + ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true) .toBool()); fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); - ui->fontpathlistbox->insertItems(0, fontpaths); + ui->fontpathListBox->insertItems(0, fontpaths); ui->audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("Auto (default)")), @@ -424,7 +424,7 @@ MainWindow::MainWindow() #ifndef QT_NO_GSTREAMER if (gst_init_check(0, 0, 0)) { gchar *versionString = gst_version_string(); - ui->gstversionLabel->setText(QLatin1String(versionString)); + ui->gstVersionLabel->setText(QLatin1String(versionString)); g_free(versionString); GList *factoryList = gst_registry_get_feature_list(gst_registry_get_default(), GST_TYPE_ELEMENT_FACTORY); @@ -451,7 +451,7 @@ MainWindow::MainWindow() g_list_free(factoryList); } #else - ui->tab4->setEnabled(false); + ui->phononTab->setEnabled(false); ui->phononLabel->setText(tr("Phonon GStreamer backend not available.")); #endif @@ -484,7 +484,7 @@ MainWindow::MainWindow() settings.endGroup(); // Qt - ui->helpview->setText(tr(appearance_text)); + ui->helpView->setText(tr(appearance_text)); setModified(false); updateStyleLayout(); @@ -512,12 +512,12 @@ void MainWindow::fileSave() QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QFontDatabase db; - QFont font = db.font(ui->familycombo->currentText(), - ui->stylecombo->currentText(), - ui->psizecombo->currentText().toInt()); + QFont font = db.font(ui->fontFamilyCombo->currentText(), + ui->fontStyleCombo->currentText(), + ui->pointSizeCombo->currentText().toInt()); QStringList actcg, inactcg, discg; - bool overrideDesktopSettings = (ui->gstylecombo->currentText() != desktopThemeName); + bool overrideDesktopSettings = (ui->guiStyleCombo->currentText() != desktopThemeName); if (overrideDesktopSettings) { int i; for (i = 0; i < QPalette::NColorRoles; i++) @@ -537,24 +537,24 @@ void MainWindow::fileSave() settings.setValue(QLatin1String("Palette/disabled"), discg); settings.setValue(QLatin1String("fontPath"), fontpaths); - settings.setValue(QLatin1String("embedFonts"), ui->fontembeddingcheckbox->isChecked()); + settings.setValue(QLatin1String("embedFonts"), ui->fontEmbeddingCheckBox->isChecked()); settings.setValue(QLatin1String("style"), - overrideDesktopSettings ? ui->gstylecombo->currentText() : QString()); + overrideDesktopSettings ? ui->guiStyleCombo->currentText() : QString()); - settings.setValue(QLatin1String("doubleClickInterval"), ui->dcispin->value()); + settings.setValue(QLatin1String("doubleClickInterval"), ui->doubleClickIntervalSpinBox->value()); settings.setValue(QLatin1String("cursorFlashTime"), - ui->cfispin->value() == 9 ? 0 : ui->cfispin->value()); - settings.setValue(QLatin1String("wheelScrollLines"), ui->wslspin->value()); - settings.setValue(QLatin1String("resolveSymlinks"), ui->resolvelinks->isChecked()); + ui->cursorFlashTimeSpinBox->value() == 9 ? 0 : ui->cursorFlashTimeSpinBox->value()); + settings.setValue(QLatin1String("wheelScrollLines"), ui->wheelScrollLinesSpinBox->value()); + settings.setValue(QLatin1String("resolveSymlinks"), ui->resolveLinksCheckBox->isChecked()); - QSize strut(ui->strutwidth->value(), ui->strutheight->value()); + QSize strut(ui->strutWidthSpinBox->value(), ui->strutHeightSpinBox->value()); settings.setValue(QLatin1String("globalStrut/width"), strut.width()); settings.setValue(QLatin1String("globalStrut/height"), strut.height()); - settings.setValue(QLatin1String("useRtlExtensions"), ui->rtlExtensions->isChecked()); + settings.setValue(QLatin1String("useRtlExtensions"), ui->rtlExtensionsCheckBox->isChecked()); #ifdef Q_WS_X11 - QString style = ui->inputStyle->currentText(); + QString style = ui->inputStyleCombo->currentText(); QString str = QLatin1String("On The Spot"); if (style == tr("Over The Spot")) str = QLatin1String("Over The Spot"); @@ -565,7 +565,7 @@ void MainWindow::fileSave() settings.setValue(QLatin1String("XIMInputStyle"), str); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) - settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethod->currentText()); + settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText()); #endif QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); @@ -576,24 +576,24 @@ void MainWindow::fileSave() ui->videomodeCombo->itemData(ui->videomodeCombo->currentIndex())); QStringList effects; - if (ui->effectcheckbox->isChecked()) { + if (ui->effectsCheckBox->isChecked()) { effects << QLatin1String("general"); - switch (ui->menueffect->currentIndex()) { + switch (ui->menuEffectCombo->currentIndex()) { case 1: effects << QLatin1String("animatemenu"); break; case 2: effects << QLatin1String("fademenu"); break; } - switch (ui->comboeffect->currentIndex()) { + switch (ui->comboEffectCombo->currentIndex()) { case 1: effects << QLatin1String("animatecombo"); break; } - switch (ui->tooltipeffect->currentIndex()) { + switch (ui->toolTipEffectCombo->currentIndex()) { case 1: effects << QLatin1String("animatetooltip"); break; case 2: effects << QLatin1String("fadetooltip"); break; } - switch (ui->toolboxeffect->currentIndex()) { + switch (ui->toolBoxEffectCombo->currentIndex()) { case 1: effects << QLatin1String("animatetoolbox"); break; } } else @@ -688,10 +688,10 @@ void MainWindow::paletteSelected(int) void MainWindow::updateStyleLayout() { - QString currentStyle = ui->gstylecombo->currentText(); + QString currentStyle = ui->guiStyleCombo->currentText(); bool autoStyle = (currentStyle == desktopThemeName); ui->previewFrame->setPreviewVisible(!autoStyle); - ui->groupAutoPalette->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); + ui->buildPaletteGroup->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); } void MainWindow::styleSelected(const QString &stylename) @@ -715,170 +715,170 @@ void MainWindow::familySelected(const QString &family) { QFontDatabase db; QStringList styles = db.styles(family); - ui->stylecombo->clear(); - ui->stylecombo->addItems(styles); - ui->familysubcombo->addItem(family); + ui->fontStyleCombo->clear(); + ui->fontStyleCombo->addItems(styles); + ui->familySubstitutionCombo->addItem(family); buildFont(); } void MainWindow::buildFont() { QFontDatabase db; - QFont font = db.font(ui->familycombo->currentText(), - ui->stylecombo->currentText(), - ui->psizecombo->currentText().toInt()); - ui->samplelineedit->setFont(font); + QFont font = db.font(ui->fontFamilyCombo->currentText(), + ui->fontStyleCombo->currentText(), + ui->pointSizeCombo->currentText().toInt()); + ui->sampleLineEdit->setFont(font); setModified(true); } void MainWindow::substituteSelected(const QString &family) { QStringList subs = QFont::substitutes(family); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); } void MainWindow::removeSubstitute() { - if (!ui->sublistbox->currentItem()) + if (!ui->substitutionsListBox->currentItem()) return; - int row = ui->sublistbox->currentRow(); - QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); - subs.removeAt(ui->sublistbox->currentRow()); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); - if (row > ui->sublistbox->count()) - row = ui->sublistbox->count() - 1; - ui->sublistbox->setCurrentRow(row); - QFont::removeSubstitution(ui->familysubcombo->currentText()); - QFont::insertSubstitutions(ui->familysubcombo->currentText(), subs); + int row = ui->substitutionsListBox->currentRow(); + QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); + subs.removeAt(ui->substitutionsListBox->currentRow()); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); + if (row > ui->substitutionsListBox->count()) + row = ui->substitutionsListBox->count() - 1; + ui->substitutionsListBox->setCurrentRow(row); + QFont::removeSubstitution(ui->familySubstitutionCombo->currentText()); + QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); setModified(true); } void MainWindow::addSubstitute() { - if (!ui->sublistbox->currentItem()) { - QFont::insertSubstitution(ui->familysubcombo->currentText(), - ui->choosesubcombo->currentText()); - QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); + if (!ui->substitutionsListBox->currentItem()) { + QFont::insertSubstitution(ui->familySubstitutionCombo->currentText(), + ui->chooseSubstitutionCombo->currentText()); + QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); setModified(true); return; } - int row = ui->sublistbox->currentRow(); - QFont::insertSubstitution(ui->familysubcombo->currentText(), ui->choosesubcombo->currentText()); - QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); - ui->sublistbox->setCurrentRow(row); + int row = ui->substitutionsListBox->currentRow(); + QFont::insertSubstitution(ui->familySubstitutionCombo->currentText(), ui->chooseSubstitutionCombo->currentText()); + QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); + ui->substitutionsListBox->setCurrentRow(row); setModified(true); } void MainWindow::downSubstitute() { - if (!ui->sublistbox->currentItem() || ui->sublistbox->currentRow() >= ui->sublistbox->count()) + if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() >= ui->substitutionsListBox->count()) return; - int row = ui->sublistbox->currentRow(); - QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); + int row = ui->substitutionsListBox->currentRow(); + QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); QString fam = subs.at(row); subs.removeAt(row); subs.insert(row + 1, fam); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); - ui->sublistbox->setCurrentRow(row + 1); - QFont::removeSubstitution(ui->familysubcombo->currentText()); - QFont::insertSubstitutions(ui->familysubcombo->currentText(), subs); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); + ui->substitutionsListBox->setCurrentRow(row + 1); + QFont::removeSubstitution(ui->familySubstitutionCombo->currentText()); + QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); setModified(true); } void MainWindow::upSubstitute() { - if (!ui->sublistbox->currentItem() || ui->sublistbox->currentRow() < 1) + if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() < 1) return; - int row = ui->sublistbox->currentRow(); - QStringList subs = QFont::substitutes(ui->familysubcombo->currentText()); + int row = ui->substitutionsListBox->currentRow(); + QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); QString fam = subs.at(row); subs.removeAt(row); subs.insert(row-1, fam); - ui->sublistbox->clear(); - ui->sublistbox->insertItems(0, subs); - ui->sublistbox->setCurrentRow(row - 1); - QFont::removeSubstitution(ui->familysubcombo->currentText()); - QFont::insertSubstitutions(ui->familysubcombo->currentText(), subs); + ui->substitutionsListBox->clear(); + ui->substitutionsListBox->insertItems(0, subs); + ui->substitutionsListBox->setCurrentRow(row - 1); + QFont::removeSubstitution(ui->familySubstitutionCombo->currentText()); + QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); setModified(true); } void MainWindow::removeFontpath() { - if (!ui->fontpathlistbox->currentItem()) + if (!ui->fontpathListBox->currentItem()) return; - int row = ui->fontpathlistbox->currentRow(); + int row = ui->fontpathListBox->currentRow(); fontpaths.removeAt(row); - ui->fontpathlistbox->clear(); - ui->fontpathlistbox->insertItems(0, fontpaths); - if (row > ui->fontpathlistbox->count()) - row = ui->fontpathlistbox->count() - 1; - ui->fontpathlistbox->setCurrentRow(row); + ui->fontpathListBox->clear(); + ui->fontpathListBox->insertItems(0, fontpaths); + if (row > ui->fontpathListBox->count()) + row = ui->fontpathListBox->count() - 1; + ui->fontpathListBox->setCurrentRow(row); setModified(true); } void MainWindow::addFontpath() { - if (ui->fontpathlineedit->text().isEmpty()) + if (ui->fontPathLineEdit->text().isEmpty()) return; - if (!ui->fontpathlistbox->currentItem()) { - fontpaths.append(ui->fontpathlineedit->text()); - ui->fontpathlistbox->clear(); - ui->fontpathlistbox->insertItems(0, fontpaths); + if (!ui->fontpathListBox->currentItem()) { + fontpaths.append(ui->fontPathLineEdit->text()); + ui->fontpathListBox->clear(); + ui->fontpathListBox->insertItems(0, fontpaths); setModified(true); return; } - int row = ui->fontpathlistbox->currentRow(); - fontpaths.insert(row + 1, ui->fontpathlineedit->text()); - ui->fontpathlistbox->clear(); - ui->fontpathlistbox->insertItems(0, fontpaths); - ui->fontpathlistbox->setCurrentRow(row); + int row = ui->fontpathListBox->currentRow(); + fontpaths.insert(row + 1, ui->fontPathLineEdit->text()); + ui->fontpathListBox->clear(); + ui->fontpathListBox->insertItems(0, fontpaths); + ui->fontpathListBox->setCurrentRow(row); setModified(true); } void MainWindow::downFontpath() { - if (!ui->fontpathlistbox->currentItem() - || ui->fontpathlistbox->currentRow() >= (ui->fontpathlistbox->count() - 1)) { + if (!ui->fontpathListBox->currentItem() + || ui->fontpathListBox->currentRow() >= (ui->fontpathListBox->count() - 1)) { return; } - int row = ui->fontpathlistbox->currentRow(); + int row = ui->fontpathListBox->currentRow(); QString fam = fontpaths.at(row); fontpaths.removeAt(row); fontpaths.insert(row + 1, fam); - ui->fontpathlistbox->clear(); - ui->fontpathlistbox->insertItems(0, fontpaths); - ui->fontpathlistbox->setCurrentRow(row + 1); + ui->fontpathListBox->clear(); + ui->fontpathListBox->insertItems(0, fontpaths); + ui->fontpathListBox->setCurrentRow(row + 1); setModified(true); } void MainWindow::upFontpath() { - if (!ui->fontpathlistbox->currentItem() || ui->fontpathlistbox->currentRow() < 1) + if (!ui->fontpathListBox->currentItem() || ui->fontpathListBox->currentRow() < 1) return; - int row = ui->fontpathlistbox->currentRow(); + int row = ui->fontpathListBox->currentRow(); QString fam = fontpaths.at(row); fontpaths.removeAt(row); fontpaths.insert(row - 1, fam); - ui->fontpathlistbox->clear(); - ui->fontpathlistbox->insertItems(0, fontpaths); - ui->fontpathlistbox->setCurrentRow(row - 1); + ui->fontpathListBox->clear(); + ui->fontpathListBox->insertItems(0, fontpaths); + ui->fontpathListBox->setCurrentRow(row - 1); setModified(true); } @@ -888,7 +888,7 @@ void MainWindow::browseFontpath() if (dirname.isNull()) return; - ui->fontpathlineedit->setText(dirname); + ui->fontPathLineEdit->setText(dirname); } void MainWindow::somethingModified() @@ -915,16 +915,16 @@ void MainWindow::helpAboutQt() void MainWindow::pageChanged(QWidget *page) { - if (page == ui->tab) - ui->helpview->setText(tr(interface_text)); - else if (page == ui->tab1) - ui->helpview->setText(tr(appearance_text)); - else if (page == ui->tab2) - ui->helpview->setText(tr(font_text)); - else if (page == ui->tab3) - ui->helpview->setText(tr(printer_text)); - else if (page == ui->tab4) - ui->helpview->setText(tr(phonon_text)); + if (page == ui->interfaceTab) + ui->helpView->setText(tr(interface_text)); + else if (page == ui->appearanceTab) + ui->helpView->setText(tr(appearance_text)); + else if (page == ui->fontsTab) + ui->helpView->setText(tr(font_text)); + else if (page == ui->printerTab) + ui->helpView->setText(tr(printer_text)); + else if (page == ui->phononTab) + ui->helpView->setText(tr(phonon_text)); } void MainWindow::closeEvent(QCloseEvent *e) diff --git a/tools/qtconfig/mainwindow.ui b/tools/qtconfig/mainwindow.ui index 117a777..2ca9101 100644 --- a/tools/qtconfig/mainwindow.ui +++ b/tools/qtconfig/mainwindow.ui @@ -59,7 +59,7 @@ 8 - + 200 @@ -72,17 +72,17 @@ - + 0 - + Appearance - + 0 @@ -106,7 +106,7 @@ 8 - + 0 @@ -117,18 +117,18 @@ Select GUI &Style: - gstylecombo + guiStyleCombo - + - + 0 @@ -140,7 +140,7 @@ - + Select &Palette: @@ -188,7 +188,7 @@ - + 0 @@ -278,7 +278,7 @@ - + &Tune Palette... @@ -288,7 +288,7 @@ - + Please use the KDE Control Center to set the palette. @@ -299,13 +299,13 @@ - + Fonts - + Default Font @@ -317,7 +317,7 @@ 4 - + true @@ -327,7 +327,7 @@ - + true @@ -337,7 +337,7 @@ - + true @@ -350,37 +350,37 @@ - + &Style: - stylecombo + fontStyleCombo - + &Point Size: - psizecombo + pointSizeCombo - + F&amily: - familycombo + fontFamilyCombo - + Sample Text @@ -393,7 +393,7 @@ - + Font Substitution @@ -413,17 +413,17 @@ 0 - + S&elect or Enter a Family: - familysubcombo + familySubstitutionCombo - + true @@ -451,14 +451,14 @@ - + Current Substitutions: - + @@ -469,21 +469,21 @@ 0 - + Up - + Down - + Remove @@ -513,17 +513,17 @@ 0 - + Select s&ubstitute Family: - choosesubcombo + chooseSubstitutionCombo - + true @@ -533,7 +533,7 @@ - + Add @@ -546,13 +546,13 @@ - + Interface - + Feel Settings @@ -564,7 +564,7 @@ 4 - + ms @@ -577,17 +577,17 @@ - + &Double Click Interval: - dcispin + doubleClickIntervalSpinBox - + No blinking @@ -603,17 +603,17 @@ - + &Cursor Flash Time: - cfispin + cursorFlashTimeSpinBox - + lines @@ -626,17 +626,17 @@ - + Wheel &Scroll Lines: - wslspin + wheelScrollLinesSpinBox - + Resolve symlinks in URLs @@ -646,7 +646,7 @@ - + GUI Effects @@ -658,7 +658,7 @@ 8 - + &Enable @@ -668,53 +668,53 @@ - + 4 - + &Menu Effect: - menueffect + menuEffectCombo - + C&omboBox Effect: - comboeffect + comboEffectCombo - + &ToolTip Effect: - tooltipeffect + toolTipEffectCombo - + Tool&Box Effect: - toolboxeffect + toolBoxEffectCombo - + 0 @@ -739,7 +739,7 @@ - + Disable @@ -753,7 +753,7 @@ - + Disable @@ -772,7 +772,7 @@ - + Disable @@ -792,7 +792,7 @@ - + Global Strut @@ -804,27 +804,27 @@ 4 - + Minimum &Width: - strutwidth + strutWidthSpinBox - + Minimum Hei&ght: - strutheight + strutHeightSpinBox - + pixels @@ -834,7 +834,7 @@ - + pixels @@ -847,7 +847,7 @@ - + Enhanced support for languages written right-to-left @@ -861,7 +861,7 @@ - + 0 @@ -895,7 +895,7 @@ - + -1 @@ -919,13 +919,13 @@ - + Printer - + Enable Font embedding @@ -935,7 +935,7 @@ - + 0 @@ -961,28 +961,28 @@ 4 - + Up - + Remove - + Down - + @@ -1011,28 +1011,28 @@ - + Add - + Browse... - + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - + @@ -1041,19 +1041,19 @@ - + Phonon - + About Phonon - + Current Version: @@ -1067,20 +1067,16 @@ - + Website: - + - <!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> + <a href="http://phonon.kde.org">http://phonon.kde.org/</a> true @@ -1091,40 +1087,36 @@ p, li { white-space: pre-wrap; } - + About GStreamer - + Current Version: - + Not available - + Website: - + - <!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> + <a href="http://gstreamer.freedesktop.org/">http://gstreamer.freedesktop.org/</a> true @@ -1135,13 +1127,13 @@ p, li { white-space: pre-wrap; } - + GStreamer backend settings - + Preferred audio sink: @@ -1154,7 +1146,7 @@ p, li { white-space: pre-wrap; } - + Preferred render method: @@ -1167,7 +1159,7 @@ p, li { white-space: pre-wrap; } - + <!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"> @@ -1218,7 +1210,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -1227,7 +1219,7 @@ p, li { white-space: pre-wrap; } 19 - + 203 @@ -1243,11 +1235,11 @@ p, li { white-space: pre-wrap; } - + - 234 - 115 + 543 + 98 161 106 @@ -1258,9 +1250,9 @@ p, li { white-space: pre-wrap; } - + - + @@ -1317,34 +1309,53 @@ p, li { white-space: pre-wrap; } - helpview - familycombo - stylecombo - psizecombo - samplelineedit - familysubcombo - PushButton2 - PushButton3 - PushButton4 - choosesubcombo - PushButton1 - dcispin - cfispin - wslspin - effectcheckbox - menueffect - comboeffect - tooltipeffect - strutwidth - strutheight - sublistbox + helpView + mainTabWidget + guiStyleCombo + tunePaletteButton + paletteCombo + fontFamilyCombo + fontStyleCombo + pointSizeCombo + sampleLineEdit + familySubstitutionCombo + substitutionsListBox + upSubstitutionButton + downSubstitutionButton + removeSubstitutionButton + chooseSubstitutionCombo + addSubstitutionButton + doubleClickIntervalSpinBox + cursorFlashTimeSpinBox + wheelScrollLinesSpinBox + resolveLinksCheckBox + effectsCheckBox + menuEffectCombo + comboEffectCombo + toolTipEffectCombo + toolBoxEffectCombo + strutWidthSpinBox + strutHeightSpinBox + rtlExtensionsCheckBox + inputStyleCombo + inputMethodCombo + fontEmbeddingCheckBox + fontpathListBox + upFontpathButton + downFontpathButton + removeFontpathButton + fontPathLineEdit + browseFontPathButton + addFontPathButton + audiosinkCombo + videomodeCombo - effectcheckbox + effectsCheckBox toggled(bool) - effectbase + effectsFrame setEnabled(bool) @@ -1358,9 +1369,9 @@ p, li { white-space: pre-wrap; } - fontembeddingcheckbox + fontEmbeddingCheckBox toggled(bool) - GroupBox10 + fontPathsGroup setEnabled(bool) -- cgit v0.12 From 114be749e8bb82291cd3cc02dd85d56a3759853f Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:42 +0200 Subject: Resolved a little code style issue in qtconfig Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 266d9e4..9ff2087 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -181,7 +181,9 @@ static void setStyleHelper(QWidget *w, QStyle *s) } MainWindow::MainWindow() - : QMainWindow(), ui(new Ui::MainWindow), editPalette(palette()), previewPalette(palette()), + : ui(new Ui::MainWindow), + editPalette(palette()), + previewPalette(palette()), previewstyle(0) { ui->setupUi(this); -- cgit v0.12 From 255c512d7f536573963f371cdd73be0c4bd169b9 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Wed, 6 Oct 2010 15:51:43 +0200 Subject: Fixed the build error in qtconfig qtconfig failed to build with Phonon gstreamer backend turned on Merge-request: 2286 Reviewed-by: Benjamin Poulain --- tools/qtconfig/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 9ff2087..2536275 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -444,7 +444,7 @@ MainWindow::MainWindow() if (sink) { description = QLatin1String(gst_element_factory_get_description(GST_ELEMENT_FACTORY(feature))); ui->audiosinkCombo->addItem(name, name); - ui->audiosinkCombo->setItemData(audiosinkCombo->findText(name), description, + ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(name), description, Qt::ToolTipRole); gst_object_unref (sink); } -- cgit v0.12 From a9a35d40f14751d0d9a0c82696c4b5cd0090bbea Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 6 Oct 2010 15:46:33 +0200 Subject: Doc: fix description of the expected behavior for QGraphicsItem::cursor It was fixed for setCursor in 600ff0193c9bfac4d2b40960766002e8b81aca22. Reviewed-by: Alexis --- src/gui/graphicsview/qgraphicsitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index fc44a44..60cd020 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2125,7 +2125,7 @@ void QGraphicsItem::setToolTip(const QString &toolTip) \snippet doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp 2 - If no cursor has been set, the parent's cursor is used. + If no cursor has been set, the cursor of the item beneath is used. \sa setCursor(), hasCursor(), unsetCursor(), QWidget::cursor, QApplication::overrideCursor() -- cgit v0.12 From 311170a69e61fdd0fa4c302ec9ceb33df2c49a5d Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 6 Oct 2010 16:46:43 +0200 Subject: Fix a pending issue with the merge request 2286 A merge conflict was forgoten in the last update. This patch fixes that. --- tools/qtconfig/mainwindow.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 2536275..5bd3592 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -466,14 +466,9 @@ MainWindow::MainWindow() tr("Use X11 Overlays"), Qt::ToolTipRole); #endif #ifndef QT_NO_OPENGL -<<<<<<< HEAD - videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); - videomodeCombo->setItemData(videomodeCombo->findText(tr("OpenGL")), tr("Use OpenGL if available"), Qt::ToolTipRole); -======= ui->videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("OpenGL")), - tr("Use OpenGL if avaiable"), Qt::ToolTipRole); ->>>>>>> Removed inheritance from UI file in qtconfig's MainWindow + tr("Use OpenGL if available"), Qt::ToolTipRole); #endif ui->videomodeCombo->addItem(tr("Software"), QLatin1String("Software")); ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Software")), -- cgit v0.12 From d0dc82056231d40978e3369f2f4910298560bf98 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 6 Oct 2010 17:01:14 +0200 Subject: Code cleaning with the merge request 2286 The merge request 2286 changes a lot of the QtConfig tool. I took this opportunity to clean some old style mistake. --- tools/qtconfig/colorbutton.cpp | 9 +++++---- tools/qtconfig/mainwindow.cpp | 2 +- tools/qtconfig/paletteeditoradvanced.cpp | 9 +++------ tools/qtconfig/previewwidget.h | 2 +- tools/qtconfig/qtconfig.pro | 10 +++++----- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/tools/qtconfig/colorbutton.cpp b/tools/qtconfig/colorbutton.cpp index 30617e4..443effa 100644 --- a/tools/qtconfig/colorbutton.cpp +++ b/tools/qtconfig/colorbutton.cpp @@ -52,19 +52,20 @@ QT_BEGIN_NAMESPACE ColorButton::ColorButton(QWidget *parent) - : QAbstractButton(parent), mousepressed(false) + : QAbstractButton(parent) + , mousepressed(false) + , col(Qt::black) { setAcceptDrops(true); - col = Qt::black; connect(this, SIGNAL(clicked()), SLOT(changeColor())); } ColorButton::ColorButton(const QColor &c, QWidget *parent) : QAbstractButton(parent) + , col(c) { setAcceptDrops(true); - col = c; connect(this, SIGNAL(clicked()), SLOT(changeColor())); } @@ -182,7 +183,7 @@ void ColorButton::mouseReleaseEvent(QMouseEvent *e) void ColorButton::mouseMoveEvent(QMouseEvent *e) { - if (! mousepressed) + if (!mousepressed) return; if ((presspos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 5bd3592..1a30405 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -290,7 +290,7 @@ MainWindow::MainWindow() ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime()); ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines()); // ############# -// resolveLinksCheckBox->setChecked(qt_resolve_symlinks); + // resolveLinksCheckBox->setChecked(qt_resolve_symlinks); ui->effectsCheckBox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); ui->effectsFrame->setEnabled(ui->effectsCheckBox->isChecked()); diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index 196cdea..a700b8d 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -117,12 +117,10 @@ void PaletteEditorAdvanced::paletteSelected(int p) if(p == 1) { // inactive ui->groupCentral->setDisabled(ui->checkBuildInactive->isChecked()); ui->groupEffect->setDisabled(ui->checkBuildInactive->isChecked()); - } - else if (p == 2) { // disabled + } else if (p == 2) { // disabled ui->groupCentral->setDisabled(ui->checkBuildDisabled->isChecked()); ui->groupEffect->setDisabled(ui->checkBuildDisabled->isChecked()); - } - else { + } else { ui->groupCentral->setEnabled(true); ui->groupEffect->setEnabled(true); } @@ -263,8 +261,7 @@ QPalette PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup, result.setColor(colorGroup, effectRole, calculatedPalette.color(colorGroup, effectRole)); } - } - else { + } else { QColor btn = basePalette.color(colorGroup, QPalette::Button); result.setColor(colorGroup, QPalette::Light, btn.lighter()); diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index ee3513d..f3e5f71 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -61,7 +61,7 @@ public: bool eventFilter(QObject *, QEvent *); private: void closeEvent(QCloseEvent *); - Ui::PreviewWidget* ui; + Ui::PreviewWidget *ui; }; QT_END_NAMESPACE diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index a066d4e..cb06e5a 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -1,5 +1,5 @@ TEMPLATE = app -CONFIG += qt warn_on x11 +CONFIG += qt warn_on x11 build_all:!build_pass { CONFIG -= build_all CONFIG += release @@ -19,10 +19,10 @@ FORMS = mainwindow.ui paletteeditoradvanced.ui previewwidget.ui RESOURCES = qtconfig.qrc PROJECTNAME = Qt Configuration -TARGET = qtconfig -DESTDIR = ../../bin +TARGET = qtconfig +DESTDIR = ../../bin target.path=$$[QT_INSTALL_BINS] INSTALLS += target -INCLUDEPATH += . -DBFILE = qtconfig.db +INCLUDEPATH += . +DBFILE = qtconfig.db -- cgit v0.12 From 9d574d9c6bed5b4528415402a9f2f68ab5de8009 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 7 Oct 2010 08:30:18 +1000 Subject: Update import statement. --- tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml index 0c99e7f..0c2ac0c 100644 --- a/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml +++ b/tests/auto/declarative/qdeclarativepathview/data/pathUpdate.qml @@ -1,4 +1,4 @@ -import Qt 4.7 +import QtQuick 1.0 Rectangle { width: 400 -- cgit v0.12 From d97692f1eb18cb85830493be2e8d22fc00a85edf Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 7 Oct 2010 09:39:28 +1000 Subject: Rename toolbar button. Task-number: QT-3637 --- demos/declarative/flickr/flickr.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 1533c04..740ee35 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -109,7 +109,7 @@ Item { states: State { name: "DetailedView" PropertyChanges { target: views; x: -parent.width } - PropertyChanges { target: toolBar; button1Label: "More..." } + PropertyChanges { target: toolBar; button1Label: "View..." } PropertyChanges { target: toolBar onButton1Clicked: if (imageDetails.state=='') imageDetails.state='Back'; else imageDetails.state='' -- cgit v0.12 From 0ed462973acc683882ac30ae6959340564f305a3 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 7 Oct 2010 10:37:50 +1000 Subject: Fix setting PathView offset when all visible items are removed. If we remove all items then we don't have a valid firstIndex with which to anchor item positions, so just use offset. Task-number: QTBUG-14199 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 2 ++ .../qdeclarativepathview/tst_qdeclarativepathview.cpp | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 3ae8788..31943b2 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -1331,6 +1331,8 @@ void QDeclarativePathView::refill() if (idx >= d->modelCount) idx = 0; } + if (!d->items.count()) + d->firstIndex = -1; if (d->modelCount) { // add items to beginning and end diff --git a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp index 3a2a577..a2a5363 100644 --- a/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp +++ b/tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp @@ -351,6 +351,10 @@ void tst_QDeclarativePathView::dataModel() model.addItem("yellow", "7"); model.addItem("thistle", "8"); model.addItem("cyan", "9"); + model.addItem("peachpuff", "10"); + model.addItem("powderblue", "11"); + model.addItem("gold", "12"); + model.addItem("sandybrown", "13"); ctxt->setContextProperty("testData", &model); @@ -371,7 +375,7 @@ void tst_QDeclarativePathView::dataModel() model.insertItem(4, "orange", "10"); QTest::qWait(100); - QTRY_COMPARE(findItems(pathview, "wrapper").count(), 10); + QTRY_COMPARE(findItems(pathview, "wrapper").count(), 14); QVERIFY(pathview->currentIndex() == 0); @@ -420,6 +424,11 @@ void tst_QDeclarativePathView::dataModel() QVERIFY(item->property("onPath").toBool()); } + // QTBUG-14199 + pathview->setOffset(7); + pathview->setOffset(0); + QCOMPARE(findItems(pathview, "wrapper").count(), 5); + delete canvas; } -- cgit v0.12 From 591695490b9ed7f1cd31e03e067a5962d6aadcee Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 7 Oct 2010 10:50:54 +1000 Subject: Doc fix. --- src/declarative/graphicsitems/qdeclarativerepeater.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp index 00f2848..cb64212 100644 --- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp +++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp @@ -134,13 +134,13 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate() create items as they are required. Also, note that Repeater is \l {Item}-based, and can only repeat \l {Item}-derived objects. - For example, it cannot be used to repeat QObjects: + For example, it cannot be used to repeat QtObjects: \badcode Item { - //XXX does not work! Can't repeat QObject as it doesn't derive from Item. + //XXX does not work! Can't repeat QtObject as it doesn't derive from Item. Repeater { model: 10 - QObject {} + QtObject {} } } \endcode -- cgit v0.12 From eae8c143428128a4bea4c06cff93b38189da267d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 7 Oct 2010 08:49:30 +0200 Subject: Fix failure on Windows after commit ccd3f66 By default the builds are placed in either a release\ or debug\ directory, so we need to start the correct one on Windows. Reviewed-by: trustme --- tests/auto/qthreadstorage/tst_qthreadstorage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp index 097d729..ed86165 100644 --- a/tests/auto/qthreadstorage/tst_qthreadstorage.cpp +++ b/tests/auto/qthreadstorage/tst_qthreadstorage.cpp @@ -297,7 +297,15 @@ void tst_QThreadStorage::ensureCleanupOrder() void tst_QThreadStorage::QTBUG13877_crashOnExit() { QProcess process; +#ifdef Q_OS_WIN +# ifdef QT_NO_DEBUG + process.start("release/crashOnExit"); +# else + process.start("debug/crashOnExit"); +# endif +#else process.start("./crashOnExit"); +#endif QVERIFY(process.waitForFinished()); QVERIFY(process.exitStatus() != QProcess::CrashExit); } -- cgit v0.12 From 45134e5dda238e42b89a407464911ac05f214cac Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Fri, 24 Sep 2010 16:47:41 +0200 Subject: Make sure the QS60PaintEngine can draw other classes of pixmap data The QS60PaintEngine should not assume that the pixmap is always of type 'Raster'. It should check the classId and if it is not 'Raster' it should forward the call to QRasterPaintEngine which already handles this scenario by converting the pixmap to a QImage and drawing that instead. Reviewed-by: Jani Hautakangas --- src/gui/painting/qpaintengine_s60.cpp | 63 +++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp index 068ca0c..d7fc0af 100644 --- a/src/gui/painting/qpaintengine_s60.cpp +++ b/src/gui/painting/qpaintengine_s60.cpp @@ -59,44 +59,63 @@ bool QS60PaintEngine::begin(QPaintDevice *device) { Q_D(QS60PaintEngine); - pixmapData->beginDataAccess(); - bool ret = QRasterPaintEngine::begin(device); - // Make sure QPaintEngine::paintDevice() returns the proper device. - // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData - // which is incorrect in Symbian. - d->pdev = device; - return ret; + if (pixmapData->classId() == QPixmapData::RasterClass) { + pixmapData->beginDataAccess(); + bool ret = QRasterPaintEngine::begin(device); + // Make sure QPaintEngine::paintDevice() returns the proper device. + // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData + // which is incorrect in Symbian. + d->pdev = device; + return ret; + } + + return QRasterPaintEngine::begin(device); } bool QS60PaintEngine::end() { - bool ret = QRasterPaintEngine::end(); - pixmapData->endDataAccess(); - return ret; + if (pixmapData->classId() == QPixmapData::RasterClass) { + bool ret = QRasterPaintEngine::end(); + pixmapData->endDataAccess(); + return ret; + } + return QRasterPaintEngine::end(); } void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm) { - QS60PixmapData *srcData = static_cast(pm.pixmapData()); - srcData->beginDataAccess(); - QRasterPaintEngine::drawPixmap(p, pm); - srcData->endDataAccess(); + if (pm.pixmapData()->classId() == QPixmapData::RasterClass) { + QS60PixmapData *srcData = static_cast(pm.pixmapData()); + srcData->beginDataAccess(); + QRasterPaintEngine::drawPixmap(p, pm); + srcData->endDataAccess(); + } else { + QRasterPaintEngine::drawPixmap(p, pm); + } } void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) { - QS60PixmapData *srcData = static_cast(pm.pixmapData()); - srcData->beginDataAccess(); - QRasterPaintEngine::drawPixmap(r, pm, sr); - srcData->endDataAccess(); + if (pm.pixmapData()->classId() == QPixmapData::RasterClass) { + QS60PixmapData *srcData = static_cast(pm.pixmapData()); + srcData->beginDataAccess(); + QRasterPaintEngine::drawPixmap(r, pm, sr); + srcData->endDataAccess(); + } else { + QRasterPaintEngine::drawPixmap(r, pm, sr); + } } void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) { - QS60PixmapData *srcData = static_cast(pm.pixmapData()); - srcData->beginDataAccess(); - QRasterPaintEngine::drawTiledPixmap(r, pm, sr); - srcData->endDataAccess(); + if (pm.pixmapData()->classId() == QPixmapData::RasterClass) { + QS60PixmapData *srcData = static_cast(pm.pixmapData()); + srcData->beginDataAccess(); + QRasterPaintEngine::drawTiledPixmap(r, pm, sr); + srcData->endDataAccess(); + } else { + QRasterPaintEngine::drawTiledPixmap(r, pm, sr); + } } void QS60PaintEngine::prepare(QImage *image) -- cgit v0.12 From 83567e2dd93ad46cff2b3b611e298148e7d60f62 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 27 Sep 2010 10:54:38 +0200 Subject: Minor OpenVG optimization when setting the EGL surface attribute. Calling eglGetError() is expensive so we should avoid doing it unless we know there actually is an error. The function returns EGL_FALSE upon error so we can test for that instead of using eglGetError(). Reviewed-by: Jani Hautakangas --- src/openvg/qwindowsurface_vgegl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index e3f52f4e..37e5f40 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -709,10 +709,9 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) #if !defined(QVG_NO_PRESERVED_SWAP) // Try to force the surface back buffer to preserve its contents. if (needToSwap) { - eglGetError(); // Clear error state first. - eglSurfaceAttrib(QEgl::display(), windowSurface, + bool succeeded = eglSurfaceAttrib(QEgl::display(), windowSurface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - if (eglGetError() != EGL_SUCCESS) { + if (!succeeded && eglGetError() != EGL_SUCCESS) { qWarning("QVG: could not enable preserved swap"); } } -- cgit v0.12 From 803bdd187ec1673541b7ef8dc69652c10d0e6f88 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 7 Oct 2010 17:42:08 +1000 Subject: Connect property alias change signals on use Task-number: QTBUG-14089 --- src/declarative/qml/qdeclarativeboundsignal.cpp | 4 +- src/declarative/qml/qdeclarativecompiler.cpp | 6 ++- src/declarative/qml/qdeclarativenotifier.cpp | 16 +++++++ src/declarative/qml/qdeclarativenotifier_p.h | 17 +------ src/declarative/qml/qdeclarativeproperty.cpp | 56 +++++++++++++++++++++- src/declarative/qml/qdeclarativeproperty_p.h | 3 ++ src/declarative/qml/qdeclarativepropertycache.cpp | 19 +++++++- src/declarative/qml/qdeclarativepropertycache_p.h | 9 ++-- .../qml/qdeclarativeproxymetaobject.cpp | 4 +- src/declarative/qml/qdeclarativevme.cpp | 2 +- src/declarative/qml/qdeclarativevmemetaobject.cpp | 48 ++++++++++++++----- src/declarative/qml/qdeclarativevmemetaobject_p.h | 2 + src/declarative/qml/qdeclarativewatcher.cpp | 3 +- .../tst_qdeclarativelanguage.cpp | 1 - 14 files changed, 147 insertions(+), 43 deletions(-) diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 8769122..6af3e05 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -103,7 +103,7 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QObject *scope, const QMetaMeth if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount(); QDeclarative_setParent_noEvent(this, parent); - QMetaObject::connect(scope, m_signal.methodIndex(), this, evaluateIdx); + QDeclarativePropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx); } QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, const QString &val, @@ -117,7 +117,7 @@ QDeclarativeBoundSignal::QDeclarativeBoundSignal(QDeclarativeContext *ctxt, cons if (evaluateIdx == -1) evaluateIdx = metaObject()->methodCount(); QDeclarative_setParent_noEvent(this, parent); - QMetaObject::connect(scope, m_signal.methodIndex(), this, evaluateIdx); + QDeclarativePropertyPrivate::connect(scope, m_signal.methodIndex(), this, evaluateIdx); m_expression = new QDeclarativeExpression(ctxt, scope, val); } diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 90d38b3..dc28e22 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -945,7 +945,8 @@ void QDeclarativeCompiler::genObject(QDeclarativeParser::Object *obj) propertyCache = enginePrivate->cache(obj->metaObject()->superClass())->copy(); propertyCache->append(engine, obj->metaObject(), QDeclarativePropertyCache::Data::NoFlags, - QDeclarativePropertyCache::Data::IsVMEFunction); + QDeclarativePropertyCache::Data::IsVMEFunction, + QDeclarativePropertyCache::Data::IsVMESignal); if (obj == unitRoot) { propertyCache->addref(); @@ -1098,7 +1099,8 @@ void QDeclarativeCompiler::genObjectBody(QDeclarativeParser::Object *obj) QDeclarativePropertyCache *propertyCache = enginePrivate->cache(prop->value->metaObject()->superClass())->copy(); propertyCache->append(engine, prop->value->metaObject(), QDeclarativePropertyCache::Data::NoFlags, - QDeclarativePropertyCache::Data::IsVMEFunction); + QDeclarativePropertyCache::Data::IsVMEFunction, + QDeclarativePropertyCache::Data::IsVMESignal); output->propertyCaches << propertyCache; output->bytecode << meta; diff --git a/src/declarative/qml/qdeclarativenotifier.cpp b/src/declarative/qml/qdeclarativenotifier.cpp index 8c946f8..2e3f756 100644 --- a/src/declarative/qml/qdeclarativenotifier.cpp +++ b/src/declarative/qml/qdeclarativenotifier.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "private/qdeclarativenotifier_p.h" +#include "private/qdeclarativeproperty_p.h" QT_BEGIN_NAMESPACE @@ -66,6 +67,21 @@ void QDeclarativeNotifier::emitNotify(QDeclarativeNotifierEndpoint *endpoint) if (oldDisconnected) *oldDisconnected = endpoint; } +void QDeclarativeNotifierEndpoint::connect(QObject *source, int sourceSignal) +{ + Signal *s = toSignal(); + + if (s->source == source && s->sourceSignal == sourceSignal) + return; + + disconnect(); + + QDeclarativePropertyPrivate::connect(source, sourceSignal, target, targetMethod); + + s->source = source; + s->sourceSignal = sourceSignal; +} + void QDeclarativeNotifierEndpoint::copyAndClear(QDeclarativeNotifierEndpoint &other) { other.disconnect(); diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/declarative/qml/qdeclarativenotifier_p.h index 0781caf..ad04ba8 100644 --- a/src/declarative/qml/qdeclarativenotifier_p.h +++ b/src/declarative/qml/qdeclarativenotifier_p.h @@ -75,7 +75,7 @@ public: inline bool isConnected(QObject *source, int sourceSignal); inline bool isConnected(QDeclarativeNotifier *); - inline void connect(QObject *source, int sourceSignal); + void connect(QObject *source, int sourceSignal); inline void connect(QDeclarativeNotifier *); inline void disconnect(); @@ -175,21 +175,6 @@ bool QDeclarativeNotifierEndpoint::isConnected(QDeclarativeNotifier *notifier) return NotifierType == type && asNotifier()->notifier == notifier; } -void QDeclarativeNotifierEndpoint::connect(QObject *source, int sourceSignal) -{ - Signal *s = toSignal(); - - if (s->source == source && s->sourceSignal == sourceSignal) - return; - - disconnect(); - - QMetaObject::connect(source, sourceSignal, target, targetMethod); - - s->source = source; - s->sourceSignal = sourceSignal; -} - void QDeclarativeNotifierEndpoint::connect(QDeclarativeNotifier *notifier) { Notifier *n = toNotifier(); diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index bc20bff..b5fb619 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -53,6 +53,7 @@ #include "private/qdeclarativestringconverters_p.h" #include "private/qdeclarativelist_p.h" #include "private/qdeclarativecompiler_p.h" +#include "private/qdeclarativevmemetaobject_p.h" #include #include @@ -1212,7 +1213,7 @@ bool QDeclarativeProperty::connectNotifySignal(QObject *dest, int method) const QMetaProperty prop = d->object->metaObject()->property(d->core.coreIndex); if (prop.hasNotifySignal()) { - return QMetaObject::connect(d->object, prop.notifySignalIndex(), dest, method, Qt::DirectConnection); + return QDeclarativePropertyPrivate::connect(d->object, prop.notifySignalIndex(), dest, method, Qt::DirectConnection); } else { return false; } @@ -1383,4 +1384,57 @@ QMetaMethod QDeclarativePropertyPrivate::findSignalByName(const QMetaObject *mo, return QMetaMethod(); } +static inline int QMetaObject_methods(const QMetaObject *metaObject) +{ + struct Private + { + int revision; + int className; + int classInfoCount, classInfoData; + int methodCount, methodData; + }; + + return reinterpret_cast(metaObject->d.data)->methodCount; +} + +static inline void flush_vme_signal(const QObject *object, int index) +{ + QDeclarativeData *data = static_cast(QObjectPrivate::get(const_cast(object))->declarativeData); + if (data && data->propertyCache) { + QDeclarativePropertyCache::Data *property = data->propertyCache->method(index); + + if (property && property->flags & QDeclarativePropertyCache::Data::IsVMESignal) { + const QMetaObject *metaObject = object->metaObject(); + int methodOffset = metaObject->methodOffset(); + + while (methodOffset > index) { + methodOffset -= QMetaObject_methods(metaObject); + metaObject = metaObject->d.superdata; + } + + QDeclarativeVMEMetaObject *vme = + static_cast(const_cast(metaObject)); + + vme->connectAliasSignal(index); + } + } +} + +/*! +Connect \a sender \a signal_index to \a receiver \a method_index with the specified +\a type and \a types. This behaves identically to QMetaObject::connect() except that +it connects any lazy "proxy" signal connections set up by QML. + +It is possible that this logic should be moved to QMetaObject::connect(). +*/ +bool QDeclarativePropertyPrivate::connect(const QObject *sender, int signal_index, + const QObject *receiver, int method_index, + int type, int *types) +{ + flush_vme_signal(sender, signal_index); + flush_vme_signal(receiver, method_index); + + return QMetaObject::connect(sender, signal_index, receiver, method_index, type, types); +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeproperty_p.h b/src/declarative/qml/qdeclarativeproperty_p.h index 8522561..a8438c8 100644 --- a/src/declarative/qml/qdeclarativeproperty_p.h +++ b/src/declarative/qml/qdeclarativeproperty_p.h @@ -133,6 +133,9 @@ public: static int valueTypeCoreIndex(const QDeclarativeProperty &that); static int bindingIndex(const QDeclarativeProperty &that); static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &); + static bool connect(const QObject *sender, int signal_index, + const QObject *receiver, int method_index, + int type = 0, int *types = 0); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyPrivate::WriteFlags) diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index 08503c2..9e1ceb8 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/declarative/qml/qdeclarativepropertycache.cpp @@ -94,6 +94,8 @@ void QDeclarativePropertyCache::Data::load(const QMetaMethod &m) { coreIndex = m.methodIndex(); flags |= Data::IsFunction; + if (m.methodType() == QMetaMethod::Signal) + flags |= Data::IsSignal; propType = QVariant::Invalid; const char *returnType = m.typeName(); @@ -215,7 +217,7 @@ QDeclarativePropertyCache *QDeclarativePropertyCache::copy() const } void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaObject *metaObject, - Data::Flag propertyFlags, Data::Flag methodFlags) + Data::Flag propertyFlags, Data::Flag methodFlags, Data::Flag signalFlags) { QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine); @@ -251,6 +253,8 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb int methodCount = metaObject->methodCount(); int methodOffset = qMax(2, metaObject->methodOffset()); // 2 to block the destroyed signal + + methodIndexCache.resize(methodCount); for (int ii = methodOffset; ii < methodCount; ++ii) { QMetaMethod m = metaObject->method(ii); if (m.access() == QMetaMethod::Private) @@ -272,6 +276,10 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb data->load(m); if (m.methodType() == QMetaMethod::Slot || m.methodType() == QMetaMethod::Method) data->flags |= methodFlags; + else if (m.methodType() == QMetaMethod::Signal) + data->flags |= signalFlags; + + methodIndexCache[ii] = data; stringCache.insert(methodName, data); identifierCache.insert(data->identifier.identifier, data); @@ -350,6 +358,15 @@ QDeclarativePropertyCache::property(int index) const } QDeclarativePropertyCache::Data * +QDeclarativePropertyCache::method(int index) const +{ + if (index < 0 || index >= methodIndexCache.count()) + return 0; + + return methodIndexCache.at(index); +} + +QDeclarativePropertyCache::Data * QDeclarativePropertyCache::property(const QString &str) const { return stringCache.value(str); diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h index 72cfeba..79b126d 100644 --- a/src/declarative/qml/qdeclarativepropertycache_p.h +++ b/src/declarative/qml/qdeclarativepropertycache_p.h @@ -94,8 +94,9 @@ public: // Apply only to IsFunctions IsVMEFunction = 0x00000400, - HasArguments = 0x00000800 - + HasArguments = 0x00000800, + IsSignal = 0x00001000, + IsVMESignal = 0x00002000, }; Q_DECLARE_FLAGS(Flags, Flag) @@ -125,7 +126,7 @@ public: QDeclarativePropertyCache *copy() const; void append(QDeclarativeEngine *, const QMetaObject *, Data::Flag propertyFlags = Data::NoFlags, - Data::Flag methodFlags = Data::NoFlags); + Data::Flag methodFlags = Data::NoFlags, Data::Flag signalFlags = Data::NoFlags); static QDeclarativePropertyCache *create(QDeclarativeEngine *, const QMetaObject *); static Data create(const QMetaObject *, const QString &); @@ -133,6 +134,7 @@ public: inline Data *property(const QScriptDeclarativeClass::Identifier &id) const; Data *property(const QString &) const; Data *property(int) const; + Data *method(int) const; QStringList propertyNames() const; inline QDeclarativeEngine *qmlEngine() const; @@ -152,6 +154,7 @@ private: QDeclarativeEngine *engine; IndexCache indexCache; + IndexCache methodIndexCache; StringCache stringCache; IdentifierCache identifierCache; }; diff --git a/src/declarative/qml/qdeclarativeproxymetaobject.cpp b/src/declarative/qml/qdeclarativeproxymetaobject.cpp index c2dce0a..ceb6977 100644 --- a/src/declarative/qml/qdeclarativeproxymetaobject.cpp +++ b/src/declarative/qml/qdeclarativeproxymetaobject.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "private/qdeclarativeproxymetaobject_p.h" +#include "private/qdeclarativeproperty_p.h" QT_BEGIN_NAMESPACE @@ -95,8 +96,7 @@ int QDeclarativeProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a) QMetaMethod method = metaObject->method(jj + methodOffset); if (method.methodType() == QMetaMethod::Signal) - QMetaObject::connect(proxy, methodOffset + jj, - object, localOffset + jj); + QDeclarativePropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj); } } diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index 4e41c22..360186c 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -608,7 +608,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack &stack, if (!QMetaObject::checkConnectArgs(prop.method().signature(), method.signature())) VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot connect mismatched signal/slot %1 %vs. %2").arg(QString::fromLatin1(method.signature())).arg(QString::fromLatin1(prop.method().signature()))); - QMetaObject::connect(target, prop.index(), assign, method.methodIndex()); + QDeclarativePropertyPrivate::connect(target, prop.index(), assign, method.methodIndex()); } else { VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Cannot assign an object to signal property %1").arg(QString::fromUtf8(pr))); diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index 3e32006..37f08fc 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -584,19 +584,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) if (!target) return -1; - if (c == QMetaObject::ReadProperty && !aConnected.testBit(id)) { - int sigIdx = methodOffset + id + metaData->propertyCount; - QMetaObject::connect(context, d->contextIdx + ctxtPriv->notifyIndex, object, sigIdx); - - if (d->propertyIdx != -1) { - QMetaProperty prop = - target->metaObject()->property(d->propertyIdx); - if (prop.hasNotifySignal()) - QMetaObject::connect(target, prop.notifySignalIndex(), - object, sigIdx); - } - aConnected.setBit(id); - } + connectAlias(id); if (d->propertyIdx == -1) { *reinterpret_cast(a[0]) = target; @@ -818,4 +806,38 @@ void QDeclarativeVMEMetaObject::setVMEProperty(int index, const QScriptValue &v) return writeVarProperty(index - propOffset, v); } +void QDeclarativeVMEMetaObject::connectAlias(int aliasId) +{ + if (!aConnected.testBit(aliasId)) { + aConnected.setBit(aliasId); + + QDeclarativeContext *context = ctxt->asQDeclarativeContext(); + QDeclarativeContextPrivate *ctxtPriv = QDeclarativeContextPrivate::get(context); + + QDeclarativeVMEMetaData::AliasData *d = metaData->aliasData() + aliasId; + + QObject *target = ctxtPriv->data->idValues[d->contextIdx].data(); + if (!target) + return; + + int sigIdx = methodOffset + aliasId + metaData->propertyCount; + QMetaObject::connect(context, d->contextIdx + ctxtPriv->notifyIndex, object, sigIdx); + + if (d->propertyIdx != -1) { + QMetaProperty prop = target->metaObject()->property(d->propertyIdx); + if (prop.hasNotifySignal()) + QDeclarativePropertyPrivate::connect(target, prop.notifySignalIndex(), object, sigIdx); + } + } +} + +void QDeclarativeVMEMetaObject::connectAliasSignal(int index) +{ + int aliasId = (index - methodOffset) - metaData->propertyCount; + if (aliasId < 0 || aliasId >= metaData->aliasCount) + return; + + connectAlias(aliasId); +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h index 20ca80b..4ccaa73 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject_p.h +++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h @@ -126,6 +126,7 @@ public: QScriptValue vmeProperty(int index); void setVMEProperty(int index, const QScriptValue &); + void connectAliasSignal(int index); protected: virtual int metaCall(QMetaObject::Call _c, int _id, void **_a); @@ -140,6 +141,7 @@ private: QDeclarativeVMEVariant *data; + void connectAlias(int aliasId); QBitArray aConnected; QBitArray aInterceptors; QHash > interceptors; diff --git a/src/declarative/qml/qdeclarativewatcher.cpp b/src/declarative/qml/qdeclarativewatcher.cpp index da1419f..b9d5ec8 100644 --- a/src/declarative/qml/qdeclarativewatcher.cpp +++ b/src/declarative/qml/qdeclarativewatcher.cpp @@ -46,6 +46,7 @@ #include "qdeclarative.h" #include +#include "private/qdeclarativeproperty_p.h" #include #include @@ -103,7 +104,7 @@ QDeclarativeWatchProxy::QDeclarativeWatchProxy(int id, refreshIdx = QDeclarativeWatchProxy::staticMetaObject.indexOfMethod("notifyValueChanged()"); if (prop.hasNotifySignal()) - QMetaObject::connect(m_object, prop.notifySignalIndex(), this, refreshIdx); + QDeclarativePropertyPrivate::connect(m_object, prop.notifySignalIndex(), this, refreshIdx); } void QDeclarativeWatchProxy::notifyValueChanged() diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 3c82fc5..9a8c944 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1825,7 +1825,6 @@ void tst_qdeclarativelanguage::aliasPropertyChangeSignals() QObject *o = component.create(); QVERIFY(o != 0); - QEXPECT_FAIL("", "QTBUG-14089", Abort); QCOMPARE(o->property("test").toBool(), true); delete o; -- cgit v0.12 From 9c46cde0ca27bf5edc05046b84096379d46dca33 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 7 Oct 2010 10:26:25 +0200 Subject: Fix compilation after merge request 2286 --- tools/qtconfig/mainwindow.cpp | 2 +- tools/qtconfig/mainwindow.h | 8 ++++---- tools/qtconfig/paletteeditoradvanced.h | 4 ++-- tools/qtconfig/previewwidget.h | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index 1a30405..f07da4f 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -421,7 +421,7 @@ MainWindow::MainWindow() tr("Experimental aRts support for GStreamer."), Qt::ToolTipRole); #ifdef HAVE_PHONON - phononVersionLabel->setText(QLatin1String(Phonon::phononVersion())); + ui->phononVersionLabel->setText(QLatin1String(Phonon::phononVersion())); #endif #ifndef QT_NO_GSTREAMER if (gst_init_check(0, 0, 0)) { diff --git a/tools/qtconfig/mainwindow.h b/tools/qtconfig/mainwindow.h index 7cc6522..50d73f9 100644 --- a/tools/qtconfig/mainwindow.h +++ b/tools/qtconfig/mainwindow.h @@ -42,14 +42,14 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -namespace Ui { - class MainWindow; -} - #include QT_BEGIN_NAMESPACE +namespace Ui { + class MainWindow; +} + class MainWindow : public QMainWindow { Q_OBJECT diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h index 9f7a3f7..2bdb95d 100644 --- a/tools/qtconfig/paletteeditoradvanced.h +++ b/tools/qtconfig/paletteeditoradvanced.h @@ -44,12 +44,12 @@ #include +QT_BEGIN_NAMESPACE + namespace Ui { class PaletteEditorAdvanced; } -QT_BEGIN_NAMESPACE - class ColorButton; class PaletteEditorAdvanced : public QDialog diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index f3e5f71..e7707cd 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -44,11 +44,12 @@ #include +QT_BEGIN_NAMESPACE + namespace Ui { class PreviewWidget; } -QT_BEGIN_NAMESPACE class PreviewWidget : public QWidget { -- cgit v0.12 From c9533981e129655e2ca74b13ac1ff107df7db0e7 Mon Sep 17 00:00:00 2001 From: Patrick Spendrin Date: Wed, 6 Oct 2010 13:18:59 +0200 Subject: ActiveQt: also make the designer plugin for qaxwidget build in the opensource versions Reviewed-by: Olivier Goffart Merge-Request: 843 --- tools/designer/src/plugins/plugins.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/designer/src/plugins/plugins.pro b/tools/designer/src/plugins/plugins.pro index cf4fa8a..bcebb82 100644 --- a/tools/designer/src/plugins/plugins.pro +++ b/tools/designer/src/plugins/plugins.pro @@ -3,7 +3,7 @@ CONFIG += ordered REQUIRES = !CONFIG(static,shared|static) contains(QT_CONFIG, qt3support): SUBDIRS += widgets -win32:!contains(QT_EDITION, OpenSource):SUBDIRS += activeqt +win32: SUBDIRS += activeqt # contains(QT_CONFIG, opengl): SUBDIRS += tools/view3d contains(QT_CONFIG, webkit): SUBDIRS += qwebview contains(QT_CONFIG, phonon): SUBDIRS += phononwidgets -- cgit v0.12 From 6967f9e3fadfff8122809207dc7a99af444f699b Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Thu, 7 Oct 2010 10:33:05 +0200 Subject: Fix build with cups 1.5 snapshots Without this patch, Qt CUPS support fails to build with current CUPS snapshots: In file included from ../../include/QtGui/private/qcups_p.h:1:0, from painting/qpdf.cpp:47: .../qcups_p.h:78:11: error: 'ppd_file_t' does not name a type .../qcups_p.h:80:11: error: 'ppd_file_t' does not name a type .../qcups_p.h:81:11: error: 'ppd_option_t' does not name a type .../qcups_p.h:84:11: error: 'ppd_option_t' does not name a type .../qcups_p.h:87:34: error: ISO C++ forbids declaration of 'type name' with no type .../qcups_p.h:87:47: error: template argument 1 is invalid .../qcups_p.h:103:56: error: 'ppd_group_t' does not name a type .../qcups_p.h:103:77: error: ISO C++ forbids declaration of 'group' with no type .../qcups_p.h:104:62: error: 'ppd_group_t' does not name a type .../qcups_p.h:104:75: error: ISO C++ forbids declaration of 'group' with no type .../qcups_p.h:108:11: error: 'ppd_option_t' does not name a type .../qcups_p.h:110:5: error: 'ppd_file_t' does not name a type Merge-request: 835 Reviewed-by: Olivier Goffart --- src/gui/painting/qcups_p.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/painting/qcups_p.h b/src/gui/painting/qcups_p.h index 9259679..239c244 100644 --- a/src/gui/painting/qcups_p.h +++ b/src/gui/painting/qcups_p.h @@ -59,6 +59,7 @@ #ifndef QT_NO_CUPS #include #include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From f9a8c4ec598a0070b9d2d861efe5ee69d5045a1f Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 7 Oct 2010 19:05:27 +1000 Subject: Support device orientation in harmattan Task-number: QTBUG-14137 Reviewed-by: Aaron Kennedy --- tools/qml/deviceorientation_harmattan.cpp | 161 ++++++++++++++++++++++++++++++ tools/qml/qml.pri | 5 + 2 files changed, 166 insertions(+) create mode 100644 tools/qml/deviceorientation_harmattan.cpp diff --git a/tools/qml/deviceorientation_harmattan.cpp b/tools/qml/deviceorientation_harmattan.cpp new file mode 100644 index 0000000..22f9f4c --- /dev/null +++ b/tools/qml/deviceorientation_harmattan.cpp @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** 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 tools applications 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 "deviceorientation.h" +#include +#include + +#define ORIENTATION_SERVICE "com.nokia.SensorService" +#define ORIENTATION_PATH "/org/maemo/contextkit/Screen/TopEdge" +#define CONTEXT_INTERFACE "org.maemo.contextkit.Property" +#define CONTEXT_CHANGED "ValueChanged" +#define CONTEXT_SUBSCRIBE "Subscribe" +#define CONTEXT_UNSUBSCRIBE "Unsubscribe" +#define CONTEXT_GET "Get" + + +class HarmattanOrientation : public DeviceOrientation +{ + Q_OBJECT +public: + HarmattanOrientation() + : o(UnknownOrientation), sensorEnabled(false) + { + resumeListening(); + // connect to the orientation change signal + bool ok = QDBusConnection::systemBus().connect(ORIENTATION_SERVICE, ORIENTATION_PATH, + CONTEXT_INTERFACE, + CONTEXT_CHANGED, + this, + SLOT(deviceOrientationChanged(QList,quint64))); +// qDebug() << "connection OK" << ok; + QDBusMessage reply = QDBusConnection::systemBus().call( + QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH, + CONTEXT_INTERFACE, CONTEXT_GET)); + if (reply.type() != QDBusMessage::ErrorMessage) { + QList args; + qvariant_cast(reply.arguments().at(0)) >> args; + deviceOrientationChanged(args, 0); + } + } + + ~HarmattanOrientation() + { + // unsubscribe from the orientation sensor + if (sensorEnabled) + QDBusConnection::systemBus().call( + QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH, + CONTEXT_INTERFACE, CONTEXT_UNSUBSCRIBE)); + } + + inline Orientation orientation() const + { + return o; + } + + void setOrientation(Orientation) + { + } + + void pauseListening() { + if (sensorEnabled) { + // unsubscribe from the orientation sensor + QDBusConnection::systemBus().call( + QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH, + CONTEXT_INTERFACE, CONTEXT_UNSUBSCRIBE)); + sensorEnabled = false; + } + } + + void resumeListening() { + if (!sensorEnabled) { + // subscribe to the orientation sensor + QDBusMessage reply = QDBusConnection::systemBus().call( + QDBusMessage::createMethodCall(ORIENTATION_SERVICE, ORIENTATION_PATH, + CONTEXT_INTERFACE, CONTEXT_SUBSCRIBE)); + + if (reply.type() == QDBusMessage::ErrorMessage) { + qWarning("Unable to retrieve device orientation: %s", qPrintable(reply.errorMessage())); + } else { + sensorEnabled = true; + } + } + } + +private Q_SLOTS: + void deviceOrientationChanged(QList args,quint64) + { + if (args.count() == 0) + return; + Orientation newOrientation = toOrientation(args.at(0).toString()); + if (newOrientation != o) { + o = newOrientation; + emit orientationChanged(); + } +// qDebug() << "orientation" << args.at(0).toString(); + } + +private: + static Orientation toOrientation(const QString &nativeOrientation) + { + if (nativeOrientation == "top") + return Landscape; + else if (nativeOrientation == "left") + return Portrait; + else if (nativeOrientation == "bottom") + return LandscapeInverted; + else if (nativeOrientation == "right") + return PortraitInverted; + return UnknownOrientation; + } + +private: + Orientation o; + bool sensorEnabled; +}; + +DeviceOrientation* DeviceOrientation::instance() +{ + static HarmattanOrientation *o = new HarmattanOrientation; + return o; +} + +#include "deviceorientation_harmattan.moc" diff --git a/tools/qml/qml.pri b/tools/qml/qml.pri index e5b2c7f..5db7678 100644 --- a/tools/qml/qml.pri +++ b/tools/qml/qml.pri @@ -29,6 +29,11 @@ symbian:!contains(S60_VERSION, 3.1):!contains(S60_VERSION, 3.2) { SOURCES += $$PWD/deviceorientation_maemo5.cpp FORMS = $$PWD/recopts_maemo5.ui \ $$PWD/proxysettings_maemo5.ui +} else:linux-g++-maemo { + QT += dbus + SOURCES += $$PWD/deviceorientation_harmattan.cpp + FORMS = $$PWD/recopts.ui \ + $$PWD/proxysettings.ui } else { SOURCES += $$PWD/deviceorientation.cpp FORMS = $$PWD/recopts.ui \ -- cgit v0.12 From cdb680fb847f6220598655fb8e1195fb4c98bbe8 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 7 Oct 2010 11:29:55 +0200 Subject: Compile fix for mingw Reviewed-by: Olivier Goffart --- src/corelib/statemachine/qstatemachine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index d704615..09558a9 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1389,7 +1389,7 @@ void QStateMachinePrivate::cancelAllDelayedEvents() delayedEvents.clear(); } -namespace { +namespace _QStateMachine_Internal{ class GoToStateTransition : public QAbstractTransition { @@ -1403,7 +1403,9 @@ protected: }; } // namespace - +// mingw compiler tries to export QObject::findChild(), +// which doesn't work if its in an anonymous namespace. +using namespace _QStateMachine_Internal; /*! \internal -- cgit v0.12 From 75e478abdf336bbdc1b00e2ca4f5293d5455a0cb Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Thu, 7 Oct 2010 11:37:46 +0200 Subject: Compile fixes for mingw Reviewed-by: Trond --- src/gui/kernel/qapplication_win.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 26f4ea7..a32a957 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -951,8 +951,8 @@ Q_GLOBAL_STATIC(WinClassNameHash, winclassNames) // const QString qt_reg_winclass(QWidget *w) // register window class { - int flags = w ? w->windowFlags() : 0; - int type = flags & Qt::WindowType_Mask; + Qt::WindowFlags flags = w ? w->windowFlags() : (Qt::WindowFlags)0; + Qt::WindowFlags type = flags & Qt::WindowType_Mask; uint style; bool icon; @@ -2331,7 +2331,7 @@ extern "C" LRESULT QT_WIN_CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wPa case WM_GETOBJECT: { // Ignoring all requests while starting up - if (QApplication::startingUp() || QApplication::closingDown() || (LONG)lParam != OBJID_CLIENT) { + if (QApplication::startingUp() || QApplication::closingDown() || lParam != (LPARAM)OBJID_CLIENT) { result = false; break; } -- cgit v0.12 From 3fddf68f376fe06d0af3f390a94ed84cc1a3fa38 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 7 Oct 2010 12:36:30 +0200 Subject: Ensure that actions are still fired even if there is no visible window On Mac, if there is no visible window then actions can still be fired from the menubar as the menubar can still be accessed and used. This ensures that the actions are still triggered in this circumstance. Task-number: QTBUG-13941 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 7a9dc70..9b07d64 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -320,5 +320,10 @@ static void cleanupCocoaApplicationDelegate() [NSApp terminate:self]; } +- (void)qtDispatcherToQAction:(id)sender +{ + [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender]; +} + @end #endif -- cgit v0.12 From fbca6e1747eb8430729f0f0eb80b13f6d3d19f3a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 7 Oct 2010 12:51:43 +0200 Subject: Fix text rendering in GL when using the broken-fbo-fallback This is a backport of 3874cd95e203da40d5205ef6455d7f56cba6923a which was committed to qt:master. Since the patch that originally exposed the bug was added to 4.7.2, this patch is required there as well. Bug is visible when resizing the glyph cache on devices where QGLContext::brokenFBOReadback defaults to true, or by setting this to true on desktop. Reviewed-by: Gunnar --- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 9a5bac0..919c542 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -137,7 +137,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) if (ctx->d_ptr->workaround_brokenFBOReadBack) { QImageTextureGlyphCache::resizeTextureData(width, height); Q_ASSERT(image().depth() == 8); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits()); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits()); glDeleteTextures(1, &oldTexture); return; } -- cgit v0.12 From e3edad83a1e6e99a551d40d4118352435c6dd710 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 7 Oct 2010 14:16:50 +0200 Subject: Revert the integration of the merge request 2286. The merge request 2286 will be integrated in master. This should let an angry developer calm down and resume his work. --- tools/qtconfig/colorbutton.cpp | 9 +- tools/qtconfig/main.cpp | 1 + tools/qtconfig/mainwindow.cpp | 785 ++++++++------- tools/qtconfig/mainwindow.h | 19 +- tools/qtconfig/mainwindow.ui | 1388 -------------------------- tools/qtconfig/mainwindowbase.cpp | 250 +++++ tools/qtconfig/mainwindowbase.h | 95 ++ tools/qtconfig/mainwindowbase.ui | 1384 +++++++++++++++++++++++++ tools/qtconfig/paletteeditoradvanced.cpp | 579 +++++++---- tools/qtconfig/paletteeditoradvanced.h | 66 +- tools/qtconfig/paletteeditoradvanced.ui | 416 -------- tools/qtconfig/paletteeditoradvancedbase.cpp | 144 +++ tools/qtconfig/paletteeditoradvancedbase.h | 78 ++ tools/qtconfig/paletteeditoradvancedbase.ui | 617 ++++++++++++ tools/qtconfig/previewframe.cpp | 18 +- tools/qtconfig/previewframe.h | 13 +- tools/qtconfig/previewwidget.cpp | 29 +- tools/qtconfig/previewwidget.h | 18 +- tools/qtconfig/previewwidget.ui | 252 ----- tools/qtconfig/previewwidgetbase.cpp | 88 ++ tools/qtconfig/previewwidgetbase.h | 68 ++ tools/qtconfig/previewwidgetbase.ui | 340 +++++++ tools/qtconfig/qtconfig.pro | 19 +- tools/tools.pro | 2 +- 24 files changed, 3990 insertions(+), 2688 deletions(-) delete mode 100644 tools/qtconfig/mainwindow.ui create mode 100644 tools/qtconfig/mainwindowbase.cpp create mode 100644 tools/qtconfig/mainwindowbase.h create mode 100644 tools/qtconfig/mainwindowbase.ui delete mode 100644 tools/qtconfig/paletteeditoradvanced.ui create mode 100644 tools/qtconfig/paletteeditoradvancedbase.cpp create mode 100644 tools/qtconfig/paletteeditoradvancedbase.h create mode 100644 tools/qtconfig/paletteeditoradvancedbase.ui delete mode 100644 tools/qtconfig/previewwidget.ui create mode 100644 tools/qtconfig/previewwidgetbase.cpp create mode 100644 tools/qtconfig/previewwidgetbase.h create mode 100644 tools/qtconfig/previewwidgetbase.ui diff --git a/tools/qtconfig/colorbutton.cpp b/tools/qtconfig/colorbutton.cpp index 443effa..30617e4 100644 --- a/tools/qtconfig/colorbutton.cpp +++ b/tools/qtconfig/colorbutton.cpp @@ -52,20 +52,19 @@ QT_BEGIN_NAMESPACE ColorButton::ColorButton(QWidget *parent) - : QAbstractButton(parent) - , mousepressed(false) - , col(Qt::black) + : QAbstractButton(parent), mousepressed(false) { setAcceptDrops(true); + col = Qt::black; connect(this, SIGNAL(clicked()), SLOT(changeColor())); } ColorButton::ColorButton(const QColor &c, QWidget *parent) : QAbstractButton(parent) - , col(c) { setAcceptDrops(true); + col = c; connect(this, SIGNAL(clicked()), SLOT(changeColor())); } @@ -183,7 +182,7 @@ void ColorButton::mouseReleaseEvent(QMouseEvent *e) void ColorButton::mouseMoveEvent(QMouseEvent *e) { - if (!mousepressed) + if (! mousepressed) return; if ((presspos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { diff --git a/tools/qtconfig/main.cpp b/tools/qtconfig/main.cpp index 47b0994..928cf01 100644 --- a/tools/qtconfig/main.cpp +++ b/tools/qtconfig/main.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "ui_previewwidgetbase.h" #include "mainwindow.h" #include #include diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp index f07da4f..9675f99 100644 --- a/tools/qtconfig/mainwindow.cpp +++ b/tools/qtconfig/mainwindow.cpp @@ -40,8 +40,6 @@ ****************************************************************************/ #include "mainwindow.h" -#include "ui_mainwindow.h" - #include "colorbutton.h" #include "previewframe.h" #include "paletteeditoradvanced.h" @@ -61,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -155,20 +154,36 @@ static const char *phonon_text = "

      It is reccommended to leave all settings on \"Auto\" to let " "Phonon determine your settings automatically."; +static QColorGroup::ColorRole centralFromItem( int item ) +{ + switch( item ) { + case 0: return QColorGroup::Window; + case 1: return QColorGroup::WindowText; + case 2: return QColorGroup::Button; + case 3: return QColorGroup::Base; + case 4: return QColorGroup::Text; + case 5: return QColorGroup::BrightText; + case 6: return QColorGroup::ButtonText; + case 7: return QColorGroup::Highlight; + case 8: return QColorGroup::HighlightedText; + default: return QColorGroup::NColorRoles; + } +} + -QPalette::ColorGroup MainWindow::groupFromIndex(int item) +static QColorGroup::ColorRole effectFromItem( int item ) { - switch (item) { - case 0: - default: - return QPalette::Active; - case 1: - return QPalette::Inactive; - case 2: - return QPalette::Disabled; + switch( item ) { + case 0: return QColorGroup::Light; + case 1: return QColorGroup::Midlight; + case 2: return QColorGroup::Mid; + case 3: return QColorGroup::Dark; + case 4: return QColorGroup::Shadow; + default: return QColorGroup::NColorRoles; } } + static void setStyleHelper(QWidget *w, QStyle *s) { const QObjectList children = w->children(); @@ -180,140 +195,99 @@ static void setStyleHelper(QWidget *w, QStyle *s) w->setStyle(s); } -MainWindow::MainWindow() - : ui(new Ui::MainWindow), - editPalette(palette()), - previewPalette(palette()), - previewstyle(0) -{ - ui->setupUi(this); - statusBar(); - - // signals and slots connections - connect(ui->fontPathLineEdit, SIGNAL(returnPressed()), SLOT(addFontpath())); - connect(ui->addFontPathButton, SIGNAL(clicked()), SLOT(addFontpath())); - connect(ui->addSubstitutionButton, SIGNAL(clicked()), SLOT(addSubstitute())); - connect(ui->browseFontPathButton, SIGNAL(clicked()), SLOT(browseFontpath())); - connect(ui->fontStyleCombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(ui->pointSizeCombo, SIGNAL(activated(int)), SLOT(buildFont())); - connect(ui->downFontpathButton, SIGNAL(clicked()), SLOT(downFontpath())); - connect(ui->downSubstitutionButton, SIGNAL(clicked()), SLOT(downSubstitute())); - connect(ui->fontFamilyCombo, SIGNAL(activated(QString)), SLOT(familySelected(QString))); - connect(ui->fileExitAction, SIGNAL(activated()), SLOT(fileExit())); - connect(ui->fileSaveAction, SIGNAL(activated()), SLOT(fileSave())); - connect(ui->helpAboutAction, SIGNAL(activated()), SLOT(helpAbout())); - connect(ui->helpAboutQtAction, SIGNAL(activated()), SLOT(helpAboutQt())); - connect(ui->mainTabWidget, SIGNAL(currentChanged(QWidget*)), SLOT(pageChanged(QWidget*))); - connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(ui->removeFontpathButton, SIGNAL(clicked()), SLOT(removeFontpath())); - connect(ui->removeSubstitutionButton, SIGNAL(clicked()), SLOT(removeSubstitute())); - connect(ui->toolBoxEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->doubleClickIntervalSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->cursorFlashTimeSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->wheelScrollLinesSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->menuEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->comboEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->audiosinkCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->videomodeCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->toolTipEffectCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->strutWidthSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->strutHeightSpinBox, SIGNAL(valueChanged(int)), SLOT(somethingModified())); - connect(ui->effectsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->resolveLinksCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->fontEmbeddingCheckBox, SIGNAL(clicked()), SLOT(somethingModified())); - connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); - connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified())); - connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); - connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); - connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette())); - connect(ui->upFontpathButton, SIGNAL(clicked()), SLOT(upFontpath())); - connect(ui->upSubstitutionButton, SIGNAL(clicked()), SLOT(upSubstitute())); +MainWindow::MainWindow() + : MainWindowBase(0, "main window"), + editPalette(palette()), previewPalette(palette()), previewstyle(0) +{ modified = true; desktopThemeName = tr("Desktop Settings (Default)"); QStringList gstyles = QStyleFactory::keys(); gstyles.sort(); - ui->guiStyleCombo->addItem(desktopThemeName); - ui->guiStyleCombo->setItemData(ui->guiStyleCombo->findText(desktopThemeName), - tr("Choose style and palette based on your desktop settings."), - Qt::ToolTipRole); - ui->guiStyleCombo->addItems(gstyles); + gstylecombo->addItem(desktopThemeName); + gstylecombo->setItemData(gstylecombo->findText(desktopThemeName), + tr("Choose style and palette based on your desktop settings."), Qt::ToolTipRole); + gstylecombo->insertStringList(gstyles); QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QString currentstyle = settings.value(QLatin1String("style")).toString(); if (currentstyle.isEmpty()) { - ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->findText(desktopThemeName)); - currentstyle = QApplication::style()->objectName(); + gstylecombo->setCurrentItem(gstylecombo->findText(desktopThemeName)); + currentstyle = QLatin1String(QApplication::style()->name()); } else { - int index = ui->guiStyleCombo->findText(currentstyle, Qt::MatchFixedString); + int index = gstylecombo->findText(currentstyle, Qt::MatchFixedString); if (index != -1) { - ui->guiStyleCombo->setCurrentIndex(index); + gstylecombo->setCurrentItem(index); } else { // we give up - ui->guiStyleCombo->addItem(tr("Unknown")); - ui->guiStyleCombo->setCurrentIndex(ui->guiStyleCombo->count() - 1); + gstylecombo->insertItem(QLatin1String("Unknown")); + gstylecombo->setCurrentItem(gstylecombo->count() - 1); } } - ui->buttonMainColor->setColor(palette().color(QPalette::Active, QPalette::Button)); - ui->buttonWindowColor->setColor(palette().color(QPalette::Active, QPalette::Window)); - connect(ui->buttonMainColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette())); - connect(ui->buttonWindowColor, SIGNAL(colorChanged(QColor)), SLOT(buildPalette())); + buttonMainColor->setColor(palette().color(QPalette::Active, + QColorGroup::Button)); + buttonMainColor2->setColor(palette().color(QPalette::Active, + QColorGroup::Window)); + connect(buttonMainColor, SIGNAL(colorChanged(QColor)), + this, SLOT(buildPalette())); + connect(buttonMainColor2, SIGNAL(colorChanged(QColor)), + this, SLOT(buildPalette())); if (X11->desktopEnvironment == DE_KDE) - ui->colorConfig->hide(); + colorConfig->hide(); else - ui->kdeNoteLabel->hide(); + labelKDENote->hide(); QFontDatabase db; QStringList families = db.families(); - ui->fontFamilyCombo->addItems(families); + familycombo->insertStringList(families); QStringList fs = families; QStringList fs2 = QFont::substitutions(); QStringList::Iterator fsit = fs2.begin(); while (fsit != fs2.end()) { - if (!fs.contains(*fsit)) + if (! fs.contains(*fsit)) fs += *fsit; fsit++; } fs.sort(); - ui->familySubstitutionCombo->addItems(fs); + familysubcombo->insertStringList(fs); - ui->chooseSubstitutionCombo->addItems(families); - QList sizes = db.standardSizes(); - foreach(int i, sizes) - ui->pointSizeCombo->addItem(QString::number(i)); + choosesubcombo->insertStringList(families); + Q3ValueList sizes = db.standardSizes(); + Q3ValueList::Iterator it = sizes.begin(); + while (it != sizes.end()) + psizecombo->insertItem(QString::number(*it++)); - ui->doubleClickIntervalSpinBox->setValue(QApplication::doubleClickInterval()); - ui->cursorFlashTimeSpinBox->setValue(QApplication::cursorFlashTime()); - ui->wheelScrollLinesSpinBox->setValue(QApplication::wheelScrollLines()); + dcispin->setValue(QApplication::doubleClickInterval()); + cfispin->setValue(QApplication::cursorFlashTime()); + wslspin->setValue(QApplication::wheelScrollLines()); // ############# - // resolveLinksCheckBox->setChecked(qt_resolve_symlinks); +// resolvelinks->setChecked(qt_resolve_symlinks); - ui->effectsCheckBox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); - ui->effectsFrame->setEnabled(ui->effectsCheckBox->isChecked()); + effectcheckbox->setChecked(QApplication::isEffectEnabled(Qt::UI_General)); + effectbase->setEnabled(effectcheckbox->isChecked()); if (QApplication::isEffectEnabled(Qt::UI_FadeMenu)) - ui->menuEffectCombo->setCurrentIndex(2); + menueffect->setCurrentItem(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateMenu)) - ui->menuEffectCombo->setCurrentIndex(1); + menueffect->setCurrentItem(1); if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)) - ui->comboEffectCombo->setCurrentIndex(1); + comboeffect->setCurrentItem(1); if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)) - ui->toolTipEffectCombo->setCurrentIndex(2); + tooltipeffect->setCurrentItem(2); else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip)) - ui->toolTipEffectCombo->setCurrentIndex(1); + tooltipeffect->setCurrentItem(1); - if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox)) - ui->toolBoxEffectCombo->setCurrentIndex(1); + if ( QApplication::isEffectEnabled( Qt::UI_AnimateToolBox ) ) + toolboxeffect->setCurrentItem( 1 ); QSize globalStrut = QApplication::globalStrut(); - ui->strutWidthSpinBox->setValue(globalStrut.width()); - ui->strutHeightSpinBox->setValue(globalStrut.height()); + strutwidth->setValue(globalStrut.width()); + strutheight->setValue(globalStrut.height()); // find the default family QStringList::Iterator sit = families.begin(); @@ -332,10 +306,10 @@ MainWindow::MainWindow() if (i == -1) // no clue about the current font i = 0; - ui->fontFamilyCombo->setCurrentIndex(i); + familycombo->setCurrentItem(i); - QStringList styles = db.styles(ui->fontFamilyCombo->currentText()); - ui->fontStyleCombo->addItems(styles); + QStringList styles = db.styles(familycombo->currentText()); + stylecombo->insertStringList(styles); QString stylestring = db.styleString(QApplication::font()); sit = styles.begin(); @@ -354,98 +328,91 @@ MainWindow::MainWindow() i = possible; if (i == -1) // no clue about the current font i = 0; - ui->fontStyleCombo->setCurrentIndex(i); + stylecombo->setCurrentItem(i); i = 0; - for (int psize = QApplication::font().pointSize(); i < ui->pointSizeCombo->count(); ++i) { - const int sz = ui->pointSizeCombo->itemText(i).toInt(); + for (int psize = QApplication::font().pointSize(); i < psizecombo->count(); ++i) { + const int sz = psizecombo->text(i).toInt(); if (sz == psize) { - ui->pointSizeCombo->setCurrentIndex(i); + psizecombo->setCurrentItem(i); break; } else if(sz > psize) { - ui->pointSizeCombo->insertItem(i, QString::number(psize)); - ui->pointSizeCombo->setCurrentIndex(i); + psizecombo->insertItem(i, QString::number(psize)); + psizecombo->setCurrentItem(i); break; } } - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + sublistbox->clear(); + sublistbox->insertStringList(subs); - ui->rtlExtensionsCheckBox->setChecked(settings.value(QLatin1String("useRtlExtensions"), false) - .toBool()); + rtlExtensions->setChecked(settings.value(QLatin1String("useRtlExtensions"), false).toBool()); #ifdef Q_WS_X11 - QString settingsInputStyle = settings.value(QLatin1String("XIMInputStyle")).toString(); - if (!settingsInputStyle.isEmpty()) - ui->inputStyleCombo->setCurrentIndex(ui->inputStyleCombo->findText(settingsInputStyle)); + inputStyle->setCurrentText(settings.value(QLatin1String("XIMInputStyle"), trUtf8("On The Spot")).toString()); #else - ui->inputStyleCombo->hide(); - ui->inputStyleComboLabel->hide(); + inputStyle->hide(); + inputStyleLabel->hide(); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) - QStringList inputMethodCombo = QInputContextFactory::keys(); - int inputMethodComboIndex = -1; + QStringList inputMethods = QInputContextFactory::keys(); + int inputMethodIndex = -1; QString defaultInputMethod = settings.value(QLatin1String("DefaultInputMethod"), QLatin1String("xim")).toString(); - for (int i = inputMethodCombo.size()-1; i >= 0; --i) { - const QString &im = inputMethodCombo.at(i); + for (int i = inputMethods.size()-1; i >= 0; --i) { + const QString &im = inputMethods.at(i); if (im.contains(QLatin1String("imsw"))) { - inputMethodCombo.removeAt(i); - if (inputMethodComboIndex > i) - --inputMethodComboIndex; + inputMethods.removeAt(i); + if (inputMethodIndex > i) + --inputMethodIndex; } else if (im == defaultInputMethod) { - inputMethodComboIndex = i; + inputMethodIndex = i; } } - if (inputMethodComboIndex == -1 && !inputMethodCombo.isEmpty()) - inputMethodComboIndex = 0; - ui->inputMethodCombo->addItems(inputMethodCombo); - ui->inputMethodCombo->setCurrentIndex(inputMethodComboIndex); + if (inputMethodIndex == -1 && !inputMethods.isEmpty()) + inputMethodIndex = 0; + inputMethod->addItems(inputMethods); + inputMethod->setCurrentIndex(inputMethodIndex); #else - ui->inputMethodCombo->hide(); - ui->inputMethodComboLabel->hide(); + inputMethod->hide(); + inputMethodLabel->hide(); #endif - ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true) - .toBool()); + fontembeddingcheckbox->setChecked(settings.value(QLatin1String("embedFonts"), true).toBool()); fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); - ui->fontpathListBox->insertItems(0, fontpaths); - - ui->audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); - ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("Auto (default)")), - tr("Choose audio output automatically."), Qt::ToolTipRole); - ui->audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink")); - ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(tr("aRts")), - tr("Experimental aRts support for GStreamer."), - Qt::ToolTipRole); + fontpathlistbox->insertStringList(fontpaths); + + audiosinkCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); + audiosinkCombo->setItemData(audiosinkCombo->findText(tr("Auto (default)")), + tr("Choose audio output automatically."), Qt::ToolTipRole); + audiosinkCombo->addItem(tr("aRts"), QLatin1String("artssink")); + audiosinkCombo->setItemData(audiosinkCombo->findText(tr("aRts")), + tr("Experimental aRts support for GStreamer."), Qt::ToolTipRole); #ifdef HAVE_PHONON - ui->phononVersionLabel->setText(QLatin1String(Phonon::phononVersion())); + phononVersionLabel->setText(QLatin1String(Phonon::phononVersion())); #endif #ifndef QT_NO_GSTREAMER if (gst_init_check(0, 0, 0)) { gchar *versionString = gst_version_string(); - ui->gstVersionLabel->setText(QLatin1String(versionString)); + gstversionLabel->setText(QLatin1String(versionString)); g_free(versionString); - GList *factoryList = gst_registry_get_feature_list(gst_registry_get_default(), - GST_TYPE_ELEMENT_FACTORY); + GList* factoryList = gst_registry_get_feature_list(gst_registry_get_default (), GST_TYPE_ELEMENT_FACTORY); QString name, klass, description; - for (GList *iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) { + for (GList* iter = g_list_first(factoryList) ; iter != NULL ; iter = g_list_next(iter)) { GstPluginFeature *feature = GST_PLUGIN_FEATURE(iter->data); klass = QLatin1String(gst_element_factory_get_klass(GST_ELEMENT_FACTORY(feature))); if (klass == QLatin1String("Sink/Audio")) { name = QLatin1String(GST_PLUGIN_FEATURE_NAME(feature)); if (name == QLatin1String("sfsink")) - continue; // useless to output audio to file when you cannot set the file path + continue; //useless to output audio to file when you cannot set the file path else if (name == QLatin1String("autoaudiosink")) continue; //This is used implicitly from the auto setting GstElement *sink = gst_element_factory_make (qPrintable(name), NULL); if (sink) { - description = QLatin1String(gst_element_factory_get_description(GST_ELEMENT_FACTORY(feature))); - ui->audiosinkCombo->addItem(name, name); - ui->audiosinkCombo->setItemData(ui->audiosinkCombo->findText(name), description, - Qt::ToolTipRole); + description = QLatin1String(gst_element_factory_get_description (GST_ELEMENT_FACTORY(feature))); + audiosinkCombo->addItem(name, name); + audiosinkCombo->setItemData(audiosinkCombo->findText(name), description, Qt::ToolTipRole); gst_object_unref (sink); } } @@ -453,43 +420,39 @@ MainWindow::MainWindow() g_list_free(factoryList); } #else - ui->phononTab->setEnabled(false); - ui->phononLabel->setText(tr("Phonon GStreamer backend not available.")); + tab4->setEnabled(false); + phononLabel->setText(tr("Phonon GStreamer backend not available.")); #endif - ui->videomodeCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); - ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Auto (default)")), - tr("Choose render method automatically"), Qt::ToolTipRole); + videomodeCombo->addItem(tr("Auto (default)"), QLatin1String("Auto")); + videomodeCombo->setItemData(videomodeCombo->findText(tr("Auto (default)")), tr("Choose render method automatically"), Qt::ToolTipRole); #ifdef Q_WS_X11 - ui->videomodeCombo->addItem(tr("X11"), QLatin1String("X11")); - ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("X11")), - tr("Use X11 Overlays"), Qt::ToolTipRole); + videomodeCombo->addItem(tr("X11"), QLatin1String("X11")); + videomodeCombo->setItemData(videomodeCombo->findText(tr("X11")), tr("Use X11 Overlays"), Qt::ToolTipRole); #endif #ifndef QT_NO_OPENGL - ui->videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); - ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("OpenGL")), - tr("Use OpenGL if available"), Qt::ToolTipRole); + videomodeCombo->addItem(tr("OpenGL"), QLatin1String("OpenGL")); + videomodeCombo->setItemData(videomodeCombo->findText(tr("OpenGL")), tr("Use OpenGL if available"), Qt::ToolTipRole); #endif - ui->videomodeCombo->addItem(tr("Software"), QLatin1String("Software")); - ui->videomodeCombo->setItemData(ui->videomodeCombo->findText(tr("Software")), - tr("Use simple software rendering"), Qt::ToolTipRole); + videomodeCombo->addItem(tr("Software"), QLatin1String("Software")); + videomodeCombo->setItemData(videomodeCombo->findText(tr("Software")), tr("Use simple software rendering"), Qt::ToolTipRole); QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); - ui->audiosinkCombo->setCurrentIndex(ui->audiosinkCombo->findData(audioSink)); - ui->videomodeCombo->setCurrentIndex(ui->videomodeCombo->findData(videoMode)); + audiosinkCombo->setCurrentItem(audiosinkCombo->findData(audioSink)); + videomodeCombo->setCurrentItem(videomodeCombo->findData(videoMode)); settings.endGroup(); // Qt - ui->helpView->setText(tr(appearance_text)); + helpview->setText(tr(appearance_text)); setModified(false); updateStyleLayout(); } + MainWindow::~MainWindow() { - delete ui; } #ifdef Q_WS_X11 @@ -509,23 +472,23 @@ void MainWindow::fileSave() QSettings settings(QLatin1String("Trolltech")); settings.beginGroup(QLatin1String("Qt")); QFontDatabase db; - QFont font = db.font(ui->fontFamilyCombo->currentText(), - ui->fontStyleCombo->currentText(), - ui->pointSizeCombo->currentText().toInt()); + QFont font = db.font(familycombo->currentText(), + stylecombo->currentText(), + psizecombo->currentText().toInt()); QStringList actcg, inactcg, discg; - bool overrideDesktopSettings = (ui->guiStyleCombo->currentText() != desktopThemeName); + bool overrideDesktopSettings = (gstylecombo->currentText() != desktopThemeName); if (overrideDesktopSettings) { int i; - for (i = 0; i < QPalette::NColorRoles; i++) + for (i = 0; i < QColorGroup::NColorRoles; i++) actcg << editPalette.color(QPalette::Active, - QPalette::ColorRole(i)).name(); - for (i = 0; i < QPalette::NColorRoles; i++) + (QColorGroup::ColorRole) i).name(); + for (i = 0; i < QColorGroup::NColorRoles; i++) inactcg << editPalette.color(QPalette::Inactive, - QPalette::ColorRole(i)).name(); - for (i = 0; i < QPalette::NColorRoles; i++) + (QColorGroup::ColorRole) i).name(); + for (i = 0; i < QColorGroup::NColorRoles; i++) discg << editPalette.color(QPalette::Disabled, - QPalette::ColorRole(i)).name(); + (QColorGroup::ColorRole) i).name(); } settings.setValue(QLatin1String("font"), font.toString()); @@ -534,63 +497,59 @@ void MainWindow::fileSave() settings.setValue(QLatin1String("Palette/disabled"), discg); settings.setValue(QLatin1String("fontPath"), fontpaths); - settings.setValue(QLatin1String("embedFonts"), ui->fontEmbeddingCheckBox->isChecked()); - settings.setValue(QLatin1String("style"), - overrideDesktopSettings ? ui->guiStyleCombo->currentText() : QString()); + settings.setValue(QLatin1String("embedFonts"), fontembeddingcheckbox->isChecked()); + settings.setValue(QLatin1String("style"), overrideDesktopSettings ? gstylecombo->currentText() : QString()); - settings.setValue(QLatin1String("doubleClickInterval"), ui->doubleClickIntervalSpinBox->value()); - settings.setValue(QLatin1String("cursorFlashTime"), - ui->cursorFlashTimeSpinBox->value() == 9 ? 0 : ui->cursorFlashTimeSpinBox->value()); - settings.setValue(QLatin1String("wheelScrollLines"), ui->wheelScrollLinesSpinBox->value()); - settings.setValue(QLatin1String("resolveSymlinks"), ui->resolveLinksCheckBox->isChecked()); + settings.setValue(QLatin1String("doubleClickInterval"), dcispin->value()); + settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value() ); + settings.setValue(QLatin1String("wheelScrollLines"), wslspin->value()); + settings.setValue(QLatin1String("resolveSymlinks"), resolvelinks->isChecked()); - QSize strut(ui->strutWidthSpinBox->value(), ui->strutHeightSpinBox->value()); + QSize strut(strutwidth->value(), strutheight->value()); settings.setValue(QLatin1String("globalStrut/width"), strut.width()); settings.setValue(QLatin1String("globalStrut/height"), strut.height()); - settings.setValue(QLatin1String("useRtlExtensions"), ui->rtlExtensionsCheckBox->isChecked()); + settings.setValue(QLatin1String("useRtlExtensions"), rtlExtensions->isChecked()); #ifdef Q_WS_X11 - QString style = ui->inputStyleCombo->currentText(); + QString style = inputStyle->currentText(); QString str = QLatin1String("On The Spot"); - if (style == tr("Over The Spot")) + if ( style == trUtf8( "Over The Spot" ) ) str = QLatin1String("Over The Spot"); - else if (style == tr("Off The Spot")) + else if ( style == trUtf8( "Off The Spot" ) ) str = QLatin1String("Off The Spot"); - else if (style == tr("Root")) + else if ( style == trUtf8( "Root" ) ) str = QLatin1String("Root"); - settings.setValue(QLatin1String("XIMInputStyle"), str); + settings.setValue( QLatin1String("XIMInputStyle"), str ); #endif #if defined(Q_WS_X11) && !defined(QT_NO_XIM) - settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText()); + settings.setValue(QLatin1String("DefaultInputMethod"), inputMethod->currentText()); #endif QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); - settings.setValue(QLatin1String("audiosink"), - ui->audiosinkCombo->itemData(ui->audiosinkCombo->currentIndex())); - settings.setValue(QLatin1String("videomode"), - ui->videomodeCombo->itemData(ui->videomodeCombo->currentIndex())); + settings.setValue(QLatin1String("audiosink"), audiosinkCombo->itemData(audiosinkCombo->currentIndex())); + settings.setValue(QLatin1String("videomode"), videomodeCombo->itemData(videomodeCombo->currentIndex())); QStringList effects; - if (ui->effectsCheckBox->isChecked()) { + if (effectcheckbox->isChecked()) { effects << QLatin1String("general"); - switch (ui->menuEffectCombo->currentIndex()) { + switch (menueffect->currentItem()) { case 1: effects << QLatin1String("animatemenu"); break; case 2: effects << QLatin1String("fademenu"); break; } - switch (ui->comboEffectCombo->currentIndex()) { + switch (comboeffect->currentItem()) { case 1: effects << QLatin1String("animatecombo"); break; } - switch (ui->toolTipEffectCombo->currentIndex()) { + switch (tooltipeffect->currentItem()) { case 1: effects << QLatin1String("animatetooltip"); break; case 2: effects << QLatin1String("fadetooltip"); break; } - switch (ui->toolBoxEffectCombo->currentIndex()) { + switch ( toolboxeffect->currentItem() ) { case 1: effects << QLatin1String("animatetoolbox"); break; } } else @@ -614,63 +573,189 @@ void MainWindow::fileSave() #endif // Q_WS_X11 setModified(false); - statusBar()->showMessage(tr("Saved changes.")); + statusBar()->showMessage(QLatin1String("Saved changes.")); } + void MainWindow::fileExit() { qApp->closeAllWindows(); } + void MainWindow::setModified(bool m) { if (modified == m) return; modified = m; - ui->fileSaveAction->setEnabled(m); + fileSaveAction->setEnabled(m); } + void MainWindow::buildPalette() { - QPalette temp(ui->buttonMainColor->color(), ui->buttonWindowColor->color()); - for (int i = 0; i < QPalette::NColorGroups; i++) - temp = PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup(i), temp); + int i; + QColorGroup cg; + QColor btn = buttonMainColor->color(); + QColor back = buttonMainColor2->color(); + QPalette automake( btn, back ); + + for (i = 0; i<9; i++) + cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) ); + + editPalette.setActive( cg ); + buildActiveEffect(); + + cg = editPalette.inactive(); + + QPalette temp( editPalette.active().color( QColorGroup::Button ), + editPalette.active().color( QColorGroup::Window ) ); + + for (i = 0; i<9; i++) + cg.setColor( centralFromItem(i), temp.inactive().color( centralFromItem(i) ) ); + + editPalette.setInactive( cg ); + buildInactiveEffect(); + + cg = editPalette.disabled(); + + for (i = 0; i<9; i++) + cg.setColor( centralFromItem(i), temp.disabled().color( centralFromItem(i) ) ); + + editPalette.setDisabled( cg ); + buildDisabledEffect(); - editPalette = temp; - setPreviewPalette(editPalette); updateColorButtons(); setModified(true); } -void MainWindow::setPreviewPalette(const QPalette &pal) + +void MainWindow::buildActiveEffect() { - QPalette::ColorGroup colorGroup = groupFromIndex(ui->paletteCombo->currentIndex()); + QColorGroup cg = editPalette.active(); + QColor btn = cg.color( QColorGroup::Button ); - for (int i = 0; i < QPalette::NColorGroups; i++) { - for (int j = 0; j < QPalette::NColorRoles; j++) { - QPalette::ColorGroup targetGroup = QPalette::ColorGroup(i); - QPalette::ColorRole targetRole = QPalette::ColorRole(j); - previewPalette.setColor(targetGroup, targetRole, pal.color(colorGroup, targetRole)); - } + QPalette temp( btn, btn ); + + for (int i = 0; i<5; i++) + cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) ); + + editPalette.setActive( cg ); + setPreviewPalette( editPalette ); + + updateColorButtons(); +} + + +void MainWindow::buildInactive() +{ + editPalette.setInactive( editPalette.active() ); + buildInactiveEffect(); +} + + +void MainWindow::buildInactiveEffect() +{ + QColorGroup cg = editPalette.inactive(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = Qt::black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setInactive( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + + +void MainWindow::buildDisabled() +{ + QColorGroup cg = editPalette.active(); + cg.setColor( QColorGroup::ButtonText, Qt::darkGray ); + cg.setColor( QColorGroup::WindowText, Qt::darkGray ); + cg.setColor( QColorGroup::Text, Qt::darkGray ); + cg.setColor( QColorGroup::HighlightedText, Qt::darkGray ); + editPalette.setDisabled( cg ); + + buildDisabledEffect(); +} + + +void MainWindow::buildDisabledEffect() +{ + QColorGroup cg = editPalette.disabled(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = Qt::black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setDisabled( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + + +void MainWindow::setPreviewPalette( const QPalette& pal ) +{ + QColorGroup cg; + + switch (paletteCombo->currentItem()) { + case 0: + default: + cg = pal.active(); + break; + case 1: + cg = pal.inactive(); + break; + case 2: + cg = pal.disabled(); + break; } + previewPalette.setActive( cg ); + previewPalette.setInactive( cg ); + previewPalette.setDisabled( cg ); - ui->previewFrame->setPreviewPalette(previewPalette); + previewFrame->setPreviewPalette(previewPalette); } + void MainWindow::updateColorButtons() { - ui->buttonMainColor->setColor(editPalette.color(QPalette::Active, QPalette::Button)); - ui->buttonWindowColor->setColor(editPalette.color(QPalette::Active, QPalette::Window)); + buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button )); + buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Window )); } + void MainWindow::tunePalette() { bool ok; QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, - backgroundRole(), this); - if (!ok) + backgroundMode(), this); + if (! ok) return; editPalette = pal; @@ -678,6 +763,7 @@ void MainWindow::tunePalette() setModified(true); } + void MainWindow::paletteSelected(int) { setPreviewPalette(editPalette); @@ -685,10 +771,10 @@ void MainWindow::paletteSelected(int) void MainWindow::updateStyleLayout() { - QString currentStyle = ui->guiStyleCombo->currentText(); + QString currentStyle = gstylecombo->currentText(); bool autoStyle = (currentStyle == desktopThemeName); - ui->previewFrame->setPreviewVisible(!autoStyle); - ui->buildPaletteGroup->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); + previewFrame->setPreviewVisible(!autoStyle); + groupAutoPalette->setEnabled(currentStyle.toLower() != QLatin1String("gtk") && !autoStyle); } void MainWindow::styleSelected(const QString &stylename) @@ -700,7 +786,7 @@ void MainWindow::styleSelected(const QString &stylename) style = QStyleFactory::create(stylename); if (!style) return; - setStyleHelper(ui->previewFrame, style); + setStyleHelper(previewFrame, style); delete previewstyle; previewstyle = style; setModified(true); @@ -708,191 +794,210 @@ void MainWindow::styleSelected(const QString &stylename) updateStyleLayout(); } + void MainWindow::familySelected(const QString &family) { QFontDatabase db; QStringList styles = db.styles(family); - ui->fontStyleCombo->clear(); - ui->fontStyleCombo->addItems(styles); - ui->familySubstitutionCombo->addItem(family); + stylecombo->clear(); + stylecombo->insertStringList(styles); + familysubcombo->insertItem(family); buildFont(); } + void MainWindow::buildFont() { QFontDatabase db; - QFont font = db.font(ui->fontFamilyCombo->currentText(), - ui->fontStyleCombo->currentText(), - ui->pointSizeCombo->currentText().toInt()); - ui->sampleLineEdit->setFont(font); + QFont font = db.font(familycombo->currentText(), + stylecombo->currentText(), + psizecombo->currentText().toInt()); + samplelineedit->setFont(font); setModified(true); } + void MainWindow::substituteSelected(const QString &family) { QStringList subs = QFont::substitutes(family); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); + sublistbox->clear(); + sublistbox->insertStringList(subs); } + void MainWindow::removeSubstitute() { - if (!ui->substitutionsListBox->currentItem()) + if (sublistbox->currentItem() < 0 || + uint(sublistbox->currentItem()) > sublistbox->count()) return; - int row = ui->substitutionsListBox->currentRow(); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - subs.removeAt(ui->substitutionsListBox->currentRow()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - if (row > ui->substitutionsListBox->count()) - row = ui->substitutionsListBox->count() - 1; - ui->substitutionsListBox->setCurrentRow(row); - QFont::removeSubstitution(ui->familySubstitutionCombo->currentText()); - QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); + int item = sublistbox->currentItem(); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + subs.removeAt(sublistbox->currentItem()); + sublistbox->clear(); + sublistbox->insertStringList(subs); + if (uint(item) > sublistbox->count()) + item = int(sublistbox->count()) - 1; + sublistbox->setCurrentItem(item); + QFont::removeSubstitution(familysubcombo->currentText()); + QFont::insertSubstitutions(familysubcombo->currentText(), subs); setModified(true); } + void MainWindow::addSubstitute() { - if (!ui->substitutionsListBox->currentItem()) { - QFont::insertSubstitution(ui->familySubstitutionCombo->currentText(), - ui->chooseSubstitutionCombo->currentText()); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); + if (sublistbox->currentItem() < 0 || + uint(sublistbox->currentItem()) > sublistbox->count()) { + QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + sublistbox->clear(); + sublistbox->insertStringList(subs); setModified(true); return; } - int row = ui->substitutionsListBox->currentRow(); - QFont::insertSubstitution(ui->familySubstitutionCombo->currentText(), ui->chooseSubstitutionCombo->currentText()); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - ui->substitutionsListBox->setCurrentRow(row); + int item = sublistbox->currentItem(); + QFont::insertSubstitution(familysubcombo->currentText(), choosesubcombo->currentText()); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + sublistbox->clear(); + sublistbox->insertStringList(subs); + sublistbox->setCurrentItem(item); setModified(true); } + void MainWindow::downSubstitute() { - if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() >= ui->substitutionsListBox->count()) + if (sublistbox->currentItem() < 0 || + uint(sublistbox->currentItem()) >= sublistbox->count()) return; - int row = ui->substitutionsListBox->currentRow(); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - QString fam = subs.at(row); - subs.removeAt(row); - subs.insert(row + 1, fam); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - ui->substitutionsListBox->setCurrentRow(row + 1); - QFont::removeSubstitution(ui->familySubstitutionCombo->currentText()); - QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); + int item = sublistbox->currentItem(); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + QString fam = subs.at(item); + subs.removeAt(item); + subs.insert(item+1, fam); + sublistbox->clear(); + sublistbox->insertStringList(subs); + sublistbox->setCurrentItem(item + 1); + QFont::removeSubstitution(familysubcombo->currentText()); + QFont::insertSubstitutions(familysubcombo->currentText(), subs); setModified(true); } + void MainWindow::upSubstitute() { - if (!ui->substitutionsListBox->currentItem() || ui->substitutionsListBox->currentRow() < 1) + if (sublistbox->currentItem() < 1) return; - int row = ui->substitutionsListBox->currentRow(); - QStringList subs = QFont::substitutes(ui->familySubstitutionCombo->currentText()); - QString fam = subs.at(row); - subs.removeAt(row); - subs.insert(row-1, fam); - ui->substitutionsListBox->clear(); - ui->substitutionsListBox->insertItems(0, subs); - ui->substitutionsListBox->setCurrentRow(row - 1); - QFont::removeSubstitution(ui->familySubstitutionCombo->currentText()); - QFont::insertSubstitutions(ui->familySubstitutionCombo->currentText(), subs); + int item = sublistbox->currentItem(); + QStringList subs = QFont::substitutes(familysubcombo->currentText()); + QString fam = subs.at(item); + subs.removeAt(item); + subs.insert(item-1, fam); + sublistbox->clear(); + sublistbox->insertStringList(subs); + sublistbox->setCurrentItem(item - 1); + QFont::removeSubstitution(familysubcombo->currentText()); + QFont::insertSubstitutions(familysubcombo->currentText(), subs); setModified(true); } + void MainWindow::removeFontpath() { - if (!ui->fontpathListBox->currentItem()) + if (fontpathlistbox->currentItem() < 0 || + uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) return; - int row = ui->fontpathListBox->currentRow(); - fontpaths.removeAt(row); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - if (row > ui->fontpathListBox->count()) - row = ui->fontpathListBox->count() - 1; - ui->fontpathListBox->setCurrentRow(row); + int item = fontpathlistbox->currentItem(); + fontpaths.removeAt(fontpathlistbox->currentItem()); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + if (uint(item) > fontpathlistbox->count()) + item = int(fontpathlistbox->count()) - 1; + fontpathlistbox->setCurrentItem(item); setModified(true); } + void MainWindow::addFontpath() { - if (ui->fontPathLineEdit->text().isEmpty()) + if (fontpathlineedit->text().isEmpty()) return; - if (!ui->fontpathListBox->currentItem()) { - fontpaths.append(ui->fontPathLineEdit->text()); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); + if (fontpathlistbox->currentItem() < 0 || + uint(fontpathlistbox->currentItem()) > fontpathlistbox->count()) { + fontpaths.append(fontpathlineedit->text()); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); setModified(true); return; } - int row = ui->fontpathListBox->currentRow(); - fontpaths.insert(row + 1, ui->fontPathLineEdit->text()); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - ui->fontpathListBox->setCurrentRow(row); + int item = fontpathlistbox->currentItem(); + fontpaths.insert(fontpathlistbox->currentItem()+1, + fontpathlineedit->text()); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->setCurrentItem(item); setModified(true); } + void MainWindow::downFontpath() { - if (!ui->fontpathListBox->currentItem() - || ui->fontpathListBox->currentRow() >= (ui->fontpathListBox->count() - 1)) { + if (fontpathlistbox->currentItem() < 0 || + uint(fontpathlistbox->currentItem()) >= fontpathlistbox->count() - 1) return; - } - int row = ui->fontpathListBox->currentRow(); - QString fam = fontpaths.at(row); - fontpaths.removeAt(row); - fontpaths.insert(row + 1, fam); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - ui->fontpathListBox->setCurrentRow(row + 1); + int item = fontpathlistbox->currentItem(); + QString fam = fontpaths.at(item); + fontpaths.removeAt(item); + fontpaths.insert(item+1, fam); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->setCurrentItem(item + 1); setModified(true); } + void MainWindow::upFontpath() { - if (!ui->fontpathListBox->currentItem() || ui->fontpathListBox->currentRow() < 1) + if (fontpathlistbox->currentItem() < 1) return; - int row = ui->fontpathListBox->currentRow(); - QString fam = fontpaths.at(row); - fontpaths.removeAt(row); - fontpaths.insert(row - 1, fam); - ui->fontpathListBox->clear(); - ui->fontpathListBox->insertItems(0, fontpaths); - ui->fontpathListBox->setCurrentRow(row - 1); + int item = fontpathlistbox->currentItem(); + QString fam = fontpaths.at(item); + fontpaths.removeAt(item); + fontpaths.insert(item-1, fam); + fontpathlistbox->clear(); + fontpathlistbox->insertStringList(fontpaths); + fontpathlistbox->setCurrentItem(item - 1); setModified(true); } + void MainWindow::browseFontpath() { - QString dirname = QFileDialog::getExistingDirectory(this, tr("Select a Directory")); + QString dirname = QFileDialog::getExistingDirectory(QString(), this, 0, + tr("Select a Directory")); if (dirname.isNull()) return; - ui->fontPathLineEdit->setText(dirname); + fontpathlineedit->setText(dirname); } + void MainWindow::somethingModified() { setModified(true); } + void MainWindow::helpAbout() { QMessageBox box(this); @@ -905,42 +1010,44 @@ void MainWindow::helpAbout() box.exec(); } + void MainWindow::helpAboutQt() { QMessageBox::aboutQt(this, tr("Qt Configuration")); } + void MainWindow::pageChanged(QWidget *page) { - if (page == ui->interfaceTab) - ui->helpView->setText(tr(interface_text)); - else if (page == ui->appearanceTab) - ui->helpView->setText(tr(appearance_text)); - else if (page == ui->fontsTab) - ui->helpView->setText(tr(font_text)); - else if (page == ui->printerTab) - ui->helpView->setText(tr(printer_text)); - else if (page == ui->phononTab) - ui->helpView->setText(tr(phonon_text)); + if (page == tab) + helpview->setText(tr(interface_text)); + else if (page == tab1) + helpview->setText(tr(appearance_text)); + else if (page == tab2) + helpview->setText(tr(font_text)); + else if (page == tab3) + helpview->setText(tr(printer_text)); + else if (page == tab4) + helpview->setText(tr(phonon_text)); } + void MainWindow::closeEvent(QCloseEvent *e) { if (modified) { - switch (QMessageBox::warning(this, tr("Save Changes"), - tr("Save changes to settings?"), - (QMessageBox::Yes | QMessageBox::No - | QMessageBox::Cancel))) { - case QMessageBox::Yes: // save + switch(QMessageBox::warning(this, tr("Save Changes"), + tr("Save changes to settings?"), + tr("&Yes"), tr("&No"), tr("&Cancel"), 0, 2)) { + case 0: // save qApp->processEvents(); fileSave(); // fall through intended - case QMessageBox::No: // don't save + case 1: // don't save e->accept(); break; - case QMessageBox::Cancel: // cancel + case 2: // cancel e->ignore(); break; diff --git a/tools/qtconfig/mainwindow.h b/tools/qtconfig/mainwindow.h index 50d73f9..9bc8068 100644 --- a/tools/qtconfig/mainwindow.h +++ b/tools/qtconfig/mainwindow.h @@ -42,15 +42,11 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include +#include "mainwindowbase.h" QT_BEGIN_NAMESPACE -namespace Ui { - class MainWindow; -} - -class MainWindow : public QMainWindow +class MainWindow : public MainWindowBase { Q_OBJECT @@ -60,6 +56,7 @@ public: void closeEvent(QCloseEvent *); + public slots: virtual void buildPalette(); virtual void buildFont(); @@ -86,17 +83,21 @@ public slots: private: + void buildActive(); + void buildActiveEffect(); + void buildInactive(); + void buildInactiveEffect(); + void buildDisabled(); + void buildDisabledEffect(); + void updateColorButtons(); void updateFontSample(); void updateStyleLayout(); - static QPalette::ColorGroup groupFromIndex(int); - void setPreviewPalette(const QPalette &); void setModified(bool); - Ui::MainWindow *ui; QString desktopThemeName; QPalette editPalette, previewPalette; QStyle *previewstyle; diff --git a/tools/qtconfig/mainwindow.ui b/tools/qtconfig/mainwindow.ui deleted file mode 100644 index 2ca9101..0000000 --- a/tools/qtconfig/mainwindow.ui +++ /dev/null @@ -1,1388 +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 tools applications 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$ -** -********************************************************************* - MainWindow - - - - 0 - 0 - 815 - 716 - - - - Qt Configuration - - - - - 8 - - - - - - 200 - 0 - - - - true - - - - - - - 0 - - - - Appearance - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - GUI Style - - - - 4 - - - 8 - - - - - - 0 - 0 - - - - Select GUI &Style: - - - guiStyleCombo - - - - - - - - - - - - - - 0 - 0 - - - - Preview - - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - 0 - 0 - - - - - 410 - 260 - - - - - - - - - - - - 0 - 0 - - - - - 400 - 0 - - - - Build Palette - - - - - - - 0 - - - - - &Button Background: - - - buttonMainColor - - - - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - 1 - - - 0 - - - Window Back&ground: - - - Qt::AlignVCenter - - - 0 - - - buttonWindowColor - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 70 - 20 - - - - - - - - &Tune Palette... - - - - - - - - - - Please use the KDE Control Center to set the palette. - - - - - - - - - - - Fonts - - - - - - Default Font - - - - 8 - - - 4 - - - - - true - - - false - - - - - - - true - - - false - - - - - - - true - - - true - - - false - - - - - - - &Style: - - - fontStyleCombo - - - - - - - &Point Size: - - - pointSizeCombo - - - - - - - F&amily: - - - fontFamilyCombo - - - - - - - Sample Text - - - Qt::AlignHCenter - - - - - - - - - - Font Substitution - - - - 4 - - - 8 - - - - - 4 - - - 0 - - - - - S&elect or Enter a Family: - - - familySubstitutionCombo - - - - - - - true - - - true - - - false - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - Current Substitutions: - - - - - - - - - - 4 - - - 0 - - - - - Up - - - - - - - Down - - - - - - - Remove - - - - - - - - - QFrame::HLine - - - QFrame::Sunken - - - Qt::Horizontal - - - - - - - 4 - - - 0 - - - - - Select s&ubstitute Family: - - - chooseSubstitutionCombo - - - - - - - true - - - false - - - - - - - Add - - - - - - - - - - - - - Interface - - - - - - Feel Settings - - - - 8 - - - 4 - - - - - ms - - - 10 - - - 10000 - - - - - - - &Double Click Interval: - - - doubleClickIntervalSpinBox - - - - - - - No blinking - - - ms - - - 9 - - - 10000 - - - - - - - &Cursor Flash Time: - - - cursorFlashTimeSpinBox - - - - - - - lines - - - 1 - - - 20 - - - - - - - Wheel &Scroll Lines: - - - wheelScrollLinesSpinBox - - - - - - - Resolve symlinks in URLs - - - - - - - - - - GUI Effects - - - - 4 - - - 8 - - - - - &Enable - - - Alt+E - - - - - - - - 4 - - - - - &Menu Effect: - - - menuEffectCombo - - - - - - - C&omboBox Effect: - - - comboEffectCombo - - - - - - - &ToolTip Effect: - - - toolTipEffectCombo - - - - - - - Tool&Box Effect: - - - toolBoxEffectCombo - - - - - - - 0 - - - true - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - Disable - - - - - Animate - - - - - Fade - - - - - - - - - Disable - - - - - Animate - - - - - - - - - - - - - - Global Strut - - - - 8 - - - 4 - - - - - Minimum &Width: - - - strutWidthSpinBox - - - - - - - Minimum Hei&ght: - - - strutHeightSpinBox - - - - - - - pixels - - - 1000 - - - - - - - pixels - - - 1000 - - - - - - - - - - Enhanced support for languages written right-to-left - - - - - - - XIM Input Style: - - - - - - - 0 - - - - On The Spot - - - - - Over The Spot - - - - - Off The Spot - - - - - Root - - - - - - - - Default Input Method: - - - - - - - -1 - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - - - - - - Printer - - - - - - Enable Font embedding - - - true - - - - - - - - 0 - 0 - - - - Font Paths - - - - 4 - - - 8 - - - - - 0 - - - 4 - - - - - Up - - - - - - - Remove - - - - - - - Down - - - - - - - - - - - - 0 - - - 4 - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 20 - 20 - - - - - - - - Add - - - - - - - Browse... - - - - - - - Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. - - - - - - - - - - - - - - - - Phonon - - - - - - About Phonon - - - - - - Current Version: - - - - - - - Not available - - - - - - - Website: - - - - - - - <a href="http://phonon.kde.org">http://phonon.kde.org/</a> - - - true - - - - - - - - - - About GStreamer - - - - - - Current Version: - - - - - - - Not available - - - - - - - Website: - - - - - - - <a href="http://gstreamer.freedesktop.org/">http://gstreamer.freedesktop.org/</a> - - - true - - - - - - - - - - GStreamer backend settings - - - - - - Preferred audio sink: - - - audiosinkCombo - - - - - - - - - - Preferred render method: - - - videomodeCombo - - - - - - - - - - <!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> - - - Qt::RichText - - - false - - - true - - - 2 - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - 0 - 0 - 815 - 19 - - - - - - 203 - 114 - 161 - 110 - - - - &File - - - - - - - - - 543 - 98 - 161 - 106 - - - - &Help - - - - - - - - - - - &Save - - - Save - - - Ctrl+S - - - - - E&xit - - - Exit - - - Ctrl+Q - - - - - &About - - - About - - - - - - - - About &Qt - - - About Qt - - - - - - ColorButton - -

      colorbutton.h
      - - - PreviewFrame - -
      previewframe.h
      -
      - - - helpView - mainTabWidget - guiStyleCombo - tunePaletteButton - paletteCombo - fontFamilyCombo - fontStyleCombo - pointSizeCombo - sampleLineEdit - familySubstitutionCombo - substitutionsListBox - upSubstitutionButton - downSubstitutionButton - removeSubstitutionButton - chooseSubstitutionCombo - addSubstitutionButton - doubleClickIntervalSpinBox - cursorFlashTimeSpinBox - wheelScrollLinesSpinBox - resolveLinksCheckBox - effectsCheckBox - menuEffectCombo - comboEffectCombo - toolTipEffectCombo - toolBoxEffectCombo - strutWidthSpinBox - strutHeightSpinBox - rtlExtensionsCheckBox - inputStyleCombo - inputMethodCombo - fontEmbeddingCheckBox - fontpathListBox - upFontpathButton - downFontpathButton - removeFontpathButton - fontPathLineEdit - browseFontPathButton - addFontPathButton - audiosinkCombo - videomodeCombo - - - - - effectsCheckBox - toggled(bool) - effectsFrame - setEnabled(bool) - - - 417 - 257 - - - 578 - 379 - - - - - fontEmbeddingCheckBox - toggled(bool) - fontPathsGroup - setEnabled(bool) - - - 449 - 69 - - - 447 - 94 - - - - -
      diff --git a/tools/qtconfig/mainwindowbase.cpp b/tools/qtconfig/mainwindowbase.cpp new file mode 100644 index 0000000..2460bca --- /dev/null +++ b/tools/qtconfig/mainwindowbase.cpp @@ -0,0 +1,250 @@ +/**************************************************************************** +** +** 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 tools applications 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 "mainwindowbase.h" +#include "colorbutton.h" +#include "previewframe.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +/* + * Constructs a MainWindowBase as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + */ +MainWindowBase::MainWindowBase(QWidget* parent, const char* name, Qt::WindowFlags fl) + : Q3MainWindow(parent, name, fl) +{ + setupUi(this); + + (void)statusBar(); + + // signals and slots connections + connect(fontpathlineedit, SIGNAL(returnPressed()), this, SLOT(addFontpath())); + connect(PushButton15, SIGNAL(clicked()), this, SLOT(addFontpath())); + connect(PushButton1, SIGNAL(clicked()), this, SLOT(addSubstitute())); + connect(PushButton14, SIGNAL(clicked()), this, SLOT(browseFontpath())); + connect(stylecombo, SIGNAL(activated(int)), this, SLOT(buildFont())); + connect(psizecombo, SIGNAL(activated(int)), this, SLOT(buildFont())); + connect(PushButton12, SIGNAL(clicked()), this, SLOT(downFontpath())); + connect(PushButton3, SIGNAL(clicked()), this, SLOT(downSubstitute())); + connect(familycombo, SIGNAL(activated(QString)), this, SLOT(familySelected(QString))); + connect(fileExitAction, SIGNAL(activated()), this, SLOT(fileExit())); + connect(fileSaveAction, SIGNAL(activated()), this, SLOT(fileSave())); + connect(helpAboutAction, SIGNAL(activated()), this, SLOT(helpAbout())); + connect(helpAboutQtAction, SIGNAL(activated()), this, SLOT(helpAboutQt())); + connect(TabWidget3, SIGNAL(currentChanged(QWidget*)), this, SLOT(pageChanged(QWidget*))); + connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int))); + connect(PushButton13, SIGNAL(clicked()), this, SLOT(removeFontpath())); + connect(PushButton4, SIGNAL(clicked()), this, SLOT(removeSubstitute())); + connect(effectcheckbox, SIGNAL(toggled(bool)), effectbase, SLOT(setEnabled(bool))); + connect(fontembeddingcheckbox, SIGNAL(toggled(bool)), GroupBox10, SLOT(setEnabled(bool))); + connect(toolboxeffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(dcispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); + connect(cfispin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); + connect(wslspin, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); + connect(menueffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(comboeffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(audiosinkCombo, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(videomodeCombo, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(tooltipeffect, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(strutwidth, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); + connect(strutheight, SIGNAL(valueChanged(int)), this, SLOT(somethingModified())); + connect(effectcheckbox, SIGNAL(toggled(bool)), this, SLOT(somethingModified())); + connect(resolvelinks, SIGNAL(toggled(bool)), this, SLOT(somethingModified())); + connect(fontembeddingcheckbox, SIGNAL(clicked()), this, SLOT(somethingModified())); + connect(rtlExtensions, SIGNAL(toggled(bool)), this, SLOT(somethingModified())); + connect(inputStyle, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(inputMethod, SIGNAL(activated(int)), this, SLOT(somethingModified())); + connect(gstylecombo, SIGNAL(activated(QString)), this, SLOT(styleSelected(QString))); + connect(familysubcombo, SIGNAL(activated(QString)), this, SLOT(substituteSelected(QString))); + connect(btnAdvanced, SIGNAL(clicked()), this, SLOT(tunePalette())); + connect(PushButton11, SIGNAL(clicked()), this, SLOT(upFontpath())); + connect(PushButton2, SIGNAL(clicked()), this, SLOT(upSubstitute())); + init(); +} + +/* + * Destroys the object and frees any allocated resources + */ +MainWindowBase::~MainWindowBase() +{ + destroy(); + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void MainWindowBase::languageChange() +{ + retranslateUi(this); +} + +void MainWindowBase::init() +{ +} + +void MainWindowBase::destroy() +{ +} + +void MainWindowBase::addFontpath() +{ + qWarning("MainWindowBase::addFontpath(): Not implemented yet"); +} + +void MainWindowBase::addSubstitute() +{ + qWarning("MainWindowBase::addSubstitute(): Not implemented yet"); +} + +void MainWindowBase::browseFontpath() +{ + qWarning("MainWindowBase::browseFontpath(): Not implemented yet"); +} + +void MainWindowBase::buildFont() +{ + qWarning("MainWindowBase::buildFont(): Not implemented yet"); +} + +void MainWindowBase::buildPalette() +{ + qWarning("MainWindowBase::buildPalette(): Not implemented yet"); +} + +void MainWindowBase::downFontpath() +{ + qWarning("MainWindowBase::downFontpath(): Not implemented yet"); +} + +void MainWindowBase::downSubstitute() +{ + qWarning("MainWindowBase::downSubstitute(): Not implemented yet"); +} + +void MainWindowBase::familySelected( const QString &) +{ + qWarning("MainWindowBase::familySelected( const QString &): Not implemented yet"); +} + +void MainWindowBase::fileExit() +{ + qWarning("MainWindowBase::fileExit(): Not implemented yet"); +} + +void MainWindowBase::fileSave() +{ + qWarning("MainWindowBase::fileSave(): Not implemented yet"); +} + +void MainWindowBase::helpAbout() +{ + qWarning("MainWindowBase::helpAbout(): Not implemented yet"); +} + +void MainWindowBase::helpAboutQt() +{ + qWarning("MainWindowBase::helpAboutQt(): Not implemented yet"); +} + +void MainWindowBase::new_slot() +{ + qWarning("MainWindowBase::new_slot(): Not implemented yet"); +} + +void MainWindowBase::pageChanged( QWidget *) +{ + qWarning("MainWindowBase::pageChanged( QWidget *): Not implemented yet"); +} + +void MainWindowBase::paletteSelected(int) +{ + qWarning("MainWindowBase::paletteSelected(int): Not implemented yet"); +} + +void MainWindowBase::removeFontpath() +{ + qWarning("MainWindowBase::removeFontpath(): Not implemented yet"); +} + +void MainWindowBase::removeSubstitute() +{ + qWarning("MainWindowBase::removeSubstitute(): Not implemented yet"); +} + +void MainWindowBase::somethingModified() +{ + qWarning("MainWindowBase::somethingModified(): Not implemented yet"); +} + +void MainWindowBase::styleSelected( const QString &) +{ + qWarning("MainWindowBase::styleSelected( const QString &): Not implemented yet"); +} + +void MainWindowBase::substituteSelected( const QString &) +{ + qWarning("MainWindowBase::substituteSelected( const QString &): Not implemented yet"); +} + +void MainWindowBase::tunePalette() +{ + qWarning("MainWindowBase::tunePalette(): Not implemented yet"); +} + +void MainWindowBase::upFontpath() +{ + qWarning("MainWindowBase::upFontpath(): Not implemented yet"); +} + +void MainWindowBase::upSubstitute() +{ + qWarning("MainWindowBase::upSubstitute(): Not implemented yet"); +} + +QT_END_NAMESPACE diff --git a/tools/qtconfig/mainwindowbase.h b/tools/qtconfig/mainwindowbase.h new file mode 100644 index 0000000..1e1dabf --- /dev/null +++ b/tools/qtconfig/mainwindowbase.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** 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 tools applications 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 MAINWINDOWBASE_H +#define MAINWINDOWBASE_H + +#include "ui_mainwindowbase.h" +#include + +QT_BEGIN_NAMESPACE + +class ColorButton; +class PreviewFrame; + +class MainWindowBase : public Q3MainWindow, public Ui::MainWindowBase +{ + Q_OBJECT + +public: + MainWindowBase(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = Qt::Window); + ~MainWindowBase(); + +public slots: + virtual void addFontpath(); + virtual void addSubstitute(); + virtual void browseFontpath(); + virtual void buildFont(); + virtual void buildPalette(); + virtual void downFontpath(); + virtual void downSubstitute(); + virtual void familySelected( const QString & ); + virtual void fileExit(); + virtual void fileSave(); + virtual void helpAbout(); + virtual void helpAboutQt(); + virtual void new_slot(); + virtual void pageChanged( QWidget * ); + virtual void paletteSelected( int ); + virtual void removeFontpath(); + virtual void removeSubstitute(); + virtual void somethingModified(); + virtual void styleSelected( const QString & ); + virtual void substituteSelected( const QString & ); + virtual void tunePalette(); + virtual void upFontpath(); + virtual void upSubstitute(); + +protected slots: + virtual void languageChange(); + + virtual void init(); + virtual void destroy(); +}; + +QT_END_NAMESPACE + +#endif // MAINWINDOWBASE_H diff --git a/tools/qtconfig/mainwindowbase.ui b/tools/qtconfig/mainwindowbase.ui new file mode 100644 index 0000000..b09abd0 --- /dev/null +++ b/tools/qtconfig/mainwindowbase.ui @@ -0,0 +1,1384 @@ + + + ********************************************************************* +** +** 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 tools applications 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$ +** +********************************************************************* + MainWindowBase + + + + 0 + 0 + 815 + 716 + + + + Qt Configuration + + + + + 0 + 26 + 815 + 690 + + + + + 8 + + + + + + 200 + 0 + + + + true + + + + + + + 0 + + + + Appearance + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + GUI Style + + + + 4 + + + 8 + + + + + + 0 + 0 + + + + Select GUI &Style: + + + gstylecombo + + + + + + + + + + + + + + 0 + 0 + + + + Preview + + + + + + Select &Palette: + + + paletteCombo + + + + + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + + + + + + 0 + 0 + + + + + 410 + 260 + + + + + + + + + + + + 0 + 0 + + + + + 400 + 0 + + + + Build Palette + + + + + + + 0 + + + + + &3-D Effects: + + + buttonMainColor + + + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + 1 + + + 0 + + + Window Back&ground: + + + Qt::AlignVCenter + + + 0 + + + buttonMainColor2 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 70 + 20 + + + + + + + + &Tune Palette... + + + + + + + + + + Please use the KDE Control Center to set the palette. + + + + + + + + + + + Fonts + + + + + + Default Font + + + + 8 + + + 4 + + + + + true + + + false + + + + + + + true + + + false + + + + + + + true + + + true + + + false + + + + + + + &Style: + + + stylecombo + + + + + + + &Point Size: + + + psizecombo + + + + + + + F&amily: + + + familycombo + + + + + + + Sample Text + + + Qt::AlignHCenter + + + + + + + + + + Font Substitution + + + + 4 + + + 8 + + + + + 4 + + + 0 + + + + + S&elect or Enter a Family: + + + familysubcombo + + + + + + + true + + + true + + + false + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + Qt::Horizontal + + + + + + + Current Substitutions: + + + + + + + + + + 4 + + + 0 + + + + + Up + + + + + + + Down + + + + + + + Remove + + + + + + + + + QFrame::HLine + + + QFrame::Sunken + + + Qt::Horizontal + + + + + + + 4 + + + 0 + + + + + Select s&ubstitute Family: + + + choosesubcombo + + + + + + + true + + + false + + + + + + + Add + + + + + + + + + + + + + Interface + + + + + + Feel Settings + + + + 8 + + + 4 + + + + + ms + + + 10 + + + 10000 + + + + + + + &Double Click Interval: + + + dcispin + + + + + + + No blinking + + + ms + + + 9 + + + 10000 + + + + + + + &Cursor Flash Time: + + + cfispin + + + + + + + lines + + + 1 + + + 20 + + + + + + + Wheel &Scroll Lines: + + + wslspin + + + + + + + Resolve symlinks in URLs + + + + + + + + + + GUI Effects + + + + 4 + + + 8 + + + + + &Enable + + + Alt+E + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 4 + + + + + &Menu Effect: + + + menueffect + + + + + + + C&omboBox Effect: + + + comboeffect + + + + + + + &ToolTip Effect: + + + tooltipeffect + + + + + + + Tool&Box Effect: + + + toolboxeffect + + + + + + + 0 + + + true + + + + Disable + + + + + Animate + + + + + Fade + + + + + + + + + Disable + + + + + Animate + + + + + + + + + Disable + + + + + Animate + + + + + Fade + + + + + + + + + Disable + + + + + Animate + + + + + + + + + + + + + + Global Strut + + + + 8 + + + 4 + + + + + Minimum &Width: + + + strutwidth + + + + + + + Minimum Hei&ght: + + + strutheight + + + + + + + pixels + + + 1000 + + + + + + + pixels + + + 1000 + + + + + + + + + + Enhanced support for languages written right-to-left + + + + + + + XIM Input Style: + + + + + + + 0 + + + + On The Spot + + + + + Over The Spot + + + + + Off The Spot + + + + + Root + + + + + + + + Default Input Method: + + + + + + + -1 + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + Printer + + + + + + Enable Font embedding + + + true + + + + + + + + 0 + 0 + + + + Font Paths + + + + 4 + + + 8 + + + + + 0 + + + 4 + + + + + Up + + + + + + + Remove + + + + + + + Down + + + + + + + + + + + + 0 + + + 4 + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + Add + + + + + + + Browse... + + + + + + + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. + + + + + + + + + + + + + + + + Phonon + + + + + + About Phonon + + + + + + Current Version: + + + + + + + Not available + + + + + + + Website: + + + + + + + <!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> + + + true + + + + + + + + + + About GStreamer + + + + + + Current Version: + + + + + + + Not available + + + + + + + Website: + + + + + + + <!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> + + + true + + + + + + + + + + GStreamer backend settings + + + + + + Preferred audio sink: + + + audiosinkCombo + + + + + + + + + + Preferred render method: + + + videomodeCombo + + + + + + + + + + <!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> + + + Qt::RichText + + + false + + + true + + + 2 + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + 0 + 0 + 815 + 26 + + + + + + 0 + 0 + 123 + 92 + + + + &File + + + + + + + + + + + + 0 + 0 + 123 + 90 + + + + &Help + + + + + + + + + + + + + + &Save + + + Save + + + Ctrl+S + + + + + E&xit + + + Exit + + + + + + + + &About + + + About + + + + + + + + About &Qt + + + About Qt + + + + + + Q3Frame + QFrame +
      Qt3Support/Q3Frame
      + 1 +
      + + Q3MainWindow + QWidget +
      q3mainwindow.h
      + 1 +
      + + Q3ListBox + Q3Frame +
      q3listbox.h
      +
      + + ColorButton + +
      colorbutton.h
      +
      + + PreviewFrame + +
      previewframe.h
      +
      +
      + + helpview + familycombo + stylecombo + psizecombo + samplelineedit + familysubcombo + PushButton2 + PushButton3 + PushButton4 + choosesubcombo + PushButton1 + dcispin + cfispin + wslspin + effectcheckbox + menueffect + comboeffect + tooltipeffect + strutwidth + strutheight + sublistbox + + + +
      diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp index a700b8d..f59584e 100644 --- a/tools/qtconfig/paletteeditoradvanced.cpp +++ b/tools/qtconfig/paletteeditoradvanced.cpp @@ -38,74 +38,58 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "ui_paletteeditoradvanced.h" + #include "paletteeditoradvanced.h" #include "colorbutton.h" +#include +#include +#include +#include +#include +#include + QT_BEGIN_NAMESPACE -PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent) - : QDialog(parent), ui(new Ui::PaletteEditorAdvanced), selectedPalette(0) +PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent, + const char * name, bool modal, Qt::WindowFlags f ) + : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0) { - ui->setupUi(this); - - // create a ColorButton's - buttonCentral = new ColorButton(ui->groupCentral); - buttonCentral->setToolTip(tr("Choose a color")); - buttonCentral->setWhatsThis(tr("Choose a color for the selected central color role.")); - ui->layoutCentral->addWidget(buttonCentral); - ui->labelCentral->setBuddy(buttonCentral); - - buttonEffect = new ColorButton(ui->groupEffect); - buttonEffect->setToolTip(tr("Choose a color")); - buttonEffect->setWhatsThis(tr("Choose a color for the selected effect color role.")); + // work around buggy UI file + comboEffect->setEnabled(false); buttonEffect->setEnabled(false); - ui->layoutEffect->addWidget(buttonEffect); - ui->labelEffect->setBuddy(buttonEffect); - - // signals and slots connections - connect(ui->paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int))); - connect(ui->comboCentral, SIGNAL(activated(int)), SLOT(onCentral(int))); - connect(buttonCentral, SIGNAL(clicked()), SLOT(onChooseCentralColor())); - connect(buttonEffect, SIGNAL(clicked()), SLOT(onChooseEffectColor())); - connect(ui->comboEffect, SIGNAL(activated(int)), SLOT(onEffect(int))); - connect(ui->checkBuildEffect, SIGNAL(toggled(bool)), SLOT(onToggleBuildEffects(bool))); - connect(ui->checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); - connect(ui->checkBuildInactive, SIGNAL(toggled(bool)), SLOT(onToggleBuildInactive(bool))); - connect(ui->checkBuildDisabled, SIGNAL(toggled(bool)), SLOT(onToggleBuildDisabled(bool))); - onToggleBuildEffects(true); editPalette = QApplication::palette(); + setPreviewPalette( editPalette ); } PaletteEditorAdvanced::~PaletteEditorAdvanced() { - delete ui; } -void PaletteEditorAdvanced::onToggleBuildInactive(bool v) +void PaletteEditorAdvanced::onToggleBuildInactive( bool v ) { if (selectedPalette == 1) { - ui->groupCentral->setDisabled(v); - ui->groupEffect->setDisabled(v); + groupCentral->setDisabled(v); + groupEffect->setDisabled(v); } if (v) { - build(QPalette::Inactive); + buildInactive(); updateColorButtons(); } } -void PaletteEditorAdvanced::onToggleBuildDisabled(bool v) +void PaletteEditorAdvanced::onToggleBuildDisabled( bool v ) { if (selectedPalette == 2) { - ui->groupCentral->setDisabled(v); - ui->groupEffect->setDisabled(v); + groupCentral->setDisabled(v); + groupEffect->setDisabled(v); } if (v) { - build(QPalette::Disabled); + buildDisabled(); updateColorButtons(); } } @@ -115,204 +99,402 @@ void PaletteEditorAdvanced::paletteSelected(int p) selectedPalette = p; if(p == 1) { // inactive - ui->groupCentral->setDisabled(ui->checkBuildInactive->isChecked()); - ui->groupEffect->setDisabled(ui->checkBuildInactive->isChecked()); - } else if (p == 2) { // disabled - ui->groupCentral->setDisabled(ui->checkBuildDisabled->isChecked()); - ui->groupEffect->setDisabled(ui->checkBuildDisabled->isChecked()); - } else { - ui->groupCentral->setEnabled(true); - ui->groupEffect->setEnabled(true); + groupCentral->setDisabled(checkBuildInactive->isChecked()); + groupEffect->setDisabled(checkBuildInactive->isChecked()); + } + else if (p == 2) { // disabled + groupCentral->setDisabled(checkBuildDisabled->isChecked()); + groupEffect->setDisabled(checkBuildDisabled->isChecked()); + } + else { + groupCentral->setEnabled(true); + groupEffect->setEnabled(true); } updateColorButtons(); } void PaletteEditorAdvanced::onChooseCentralColor() { - QPalette::ColorGroup group = groupFromIndex(selectedPalette); - editPalette.setColor(group, centralFromIndex(ui->comboCentral->currentIndex()), - buttonCentral->color()); - - buildEffect(group); - if (group == QPalette::Active) { - if(ui->checkBuildInactive->isChecked()) - build(QPalette::Inactive); - if(ui->checkBuildDisabled->isChecked()) - build(QPalette::Disabled); + switch(selectedPalette) { + case 0: + default: + mapToActiveCentralRole( buttonCentral->color() ); + break; + case 1: + mapToInactiveCentralRole( buttonCentral->color() ); + break; + case 2: + mapToDisabledCentralRole( buttonCentral->color() ); + break; } - updateColorButtons(); } void PaletteEditorAdvanced::onChooseEffectColor() { - QPalette::ColorGroup group = groupFromIndex(selectedPalette); - editPalette.setColor(group, effectFromIndex(ui->comboEffect->currentIndex()), - buttonEffect->color()); - - if (group == QPalette::Active) { - if(ui->checkBuildInactive->isChecked()) - build(QPalette::Inactive); - if(ui->checkBuildDisabled->isChecked()) - build(QPalette::Disabled); + switch(selectedPalette) { + case 0: + default: + mapToActiveEffectRole( buttonEffect->color() ); + break; + case 1: + mapToInactiveEffectRole( buttonEffect->color() ); + break; + case 2: + mapToDisabledEffectRole( buttonEffect->color() ); + break; } - updateColorButtons(); } -void PaletteEditorAdvanced::onToggleBuildEffects(bool on) +void PaletteEditorAdvanced::onToggleBuildEffects( bool on ) { - if (on) { - for (int i = 0; i < QPalette::NColorGroups; i++) - buildEffect(QPalette::ColorGroup(i)); - } + if (!on) return; + buildActiveEffect(); + buildInactiveEffect(); + buildDisabledEffect(); } -QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item) +QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item ) { - switch (item) { - case 0: - default: - return QPalette::Active; - case 1: - return QPalette::Inactive; - case 2: - return QPalette::Disabled; + switch( item ) { + case 0: + return QColorGroup::Window; + case 1: + return QColorGroup::WindowText; + case 2: + return QColorGroup::Button; + case 3: + return QColorGroup::Base; + case 4: + return QColorGroup::Text; + case 5: + return QColorGroup::BrightText; + case 6: + return QColorGroup::ButtonText; + case 7: + return QColorGroup::Highlight; + case 8: + return QColorGroup::HighlightedText; + default: + return QColorGroup::NColorRoles; } } -QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item) +QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item ) + { - switch (item) { + switch( item ) { case 0: - return QPalette::Window; + return QColorGroup::Light; case 1: - return QPalette::WindowText; + return QColorGroup::Midlight; case 2: - return QPalette::Base; + return QColorGroup::Mid; case 3: - return QPalette::AlternateBase; + return QColorGroup::Dark; case 4: - return QPalette::ToolTipBase; - case 5: - return QPalette::ToolTipText; - case 6: - return QPalette::Text; - case 7: - return QPalette::Button; - case 8: - return QPalette::ButtonText; - case 9: - return QPalette::BrightText; - case 10: - return QPalette::Highlight; - case 11: - return QPalette::HighlightedText; - case 12: - return QPalette::Link; - case 13: - return QPalette::LinkVisited; + return QColorGroup::Shadow; default: - return QPalette::NoRole; + return QColorGroup::NColorRoles; } } -QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item) +void PaletteEditorAdvanced::onCentral( int item ) { - switch (item) { + QColor c; + + switch(selectedPalette) { case 0: - return QPalette::Light; + default: + c = editPalette.active().color( centralFromItem(item) ); + break; case 1: - return QPalette::Midlight; + c = editPalette.inactive().color( centralFromItem(item) ); + break; case 2: - return QPalette::Mid; - case 3: - return QPalette::Dark; - case 4: - return QPalette::Shadow; + c = editPalette.disabled().color( centralFromItem(item) ); + break; + } + + buttonCentral->setColor(c); +} + +void PaletteEditorAdvanced::onEffect( int item ) +{ + QColor c; + switch(selectedPalette) { + case 0: default: - return QPalette::NoRole; + c = editPalette.active().color( effectFromItem(item) ); + break; + case 1: + editPalette.inactive().color( effectFromItem(item) ); + break; + case 2: + editPalette.disabled().color( effectFromItem(item) ); + break; } + buttonEffect->setColor(c); } -void PaletteEditorAdvanced::onCentral(int item) +void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c ) { - QColor c = editPalette.color(groupFromIndex(selectedPalette), centralFromIndex(item)); - buttonCentral->setColor(c); + QColorGroup cg = editPalette.active(); + cg.setColor( centralFromItem(comboCentral->currentItem()), c ); + editPalette.setActive( cg ); + + buildActiveEffect(); + if(checkBuildInactive->isChecked()) + buildInactive(); + if(checkBuildDisabled->isChecked()) + buildDisabled(); + + setPreviewPalette( editPalette ); } -void PaletteEditorAdvanced::onEffect(int item) +void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c ) { - QColor c = editPalette.color(groupFromIndex(selectedPalette), effectFromIndex(item)); - buttonEffect->setColor(c); + QColorGroup cg = editPalette.active(); + cg.setColor( effectFromItem(comboEffect->currentItem()), c ); + editPalette.setActive( cg ); + + if(checkBuildInactive->isChecked()) + buildInactive(); + if(checkBuildDisabled->isChecked()) + buildDisabled(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm ) +{ + QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); + QColorGroup cg = editPalette.active(); + if ( !pm.isNull() ) + cg.setBrush( role, QBrush( cg.color( role ), pm ) ); + else + cg.setBrush( role, QBrush( cg.color( role ) ) ); + editPalette.setActive( cg ); + + + buildActiveEffect(); + if(checkBuildInactive->isChecked()) + buildInactive(); + if(checkBuildDisabled->isChecked()) + buildDisabled(); + + setPreviewPalette( editPalette ); } -QPalette PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup, - const QPalette &basePalette) +void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c ) { - QPalette result(basePalette); + QColorGroup cg = editPalette.inactive(); + cg.setColor( centralFromItem(comboCentral->currentItem()), c ); + editPalette.setInactive( cg ); - if (colorGroup == QPalette::Active) { - QPalette calculatedPalette(basePalette.color(colorGroup, QPalette::Button), - basePalette.color(colorGroup, QPalette::Window)); + buildInactiveEffect(); - for (int i = 0; i < 5; i++) { - QPalette::ColorRole effectRole = effectFromIndex(i); - result.setColor(colorGroup, effectRole, - calculatedPalette.color(colorGroup, effectRole)); - } - } else { - QColor btn = basePalette.color(colorGroup, QPalette::Button); + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c ) +{ + QColorGroup cg = editPalette.inactive(); + cg.setColor( effectFromItem(comboEffect->currentItem()), c ); + editPalette.setInactive( cg ); + + setPreviewPalette( editPalette ); +} - result.setColor(colorGroup, QPalette::Light, btn.lighter()); - result.setColor(colorGroup, QPalette::Midlight, btn.lighter(115)); - result.setColor(colorGroup, QPalette::Mid, btn.darker(150)); - result.setColor(colorGroup, QPalette::Dark, btn.darker()); - result.setColor(colorGroup, QPalette::Shadow, Qt::black); +void PaletteEditorAdvanced::mapToInactivePixmapRole( const QPixmap& pm ) +{ + QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); + QColorGroup cg = editPalette.inactive(); + if ( !pm.isNull() ) + cg.setBrush( role, QBrush( cg.color( role ), pm ) ); + else + cg.setBrush( role, QBrush( cg.color( role ) ) ); + editPalette.setInactive( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c ) +{ + QColorGroup cg = editPalette.disabled(); + cg.setColor( centralFromItem(comboCentral->currentItem()), c ); + editPalette.setDisabled( cg ); + + buildDisabledEffect(); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c ) +{ + QColorGroup cg = editPalette.disabled(); + cg.setColor( effectFromItem(comboEffect->currentItem()), c ); + editPalette.setDisabled( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm ) +{ + QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); + QColorGroup cg = editPalette.disabled(); + if ( !pm.isNull() ) + cg.setBrush( role, QBrush( cg.color( role ), pm ) ); + else + cg.setBrush( role, QBrush( cg.color( role ) ) ); + + editPalette.setDisabled( cg ); + + setPreviewPalette( editPalette ); +} + +void PaletteEditorAdvanced::buildActiveEffect() +{ + QColorGroup cg = editPalette.active(); + QColor btn = cg.color( QColorGroup::Button ); + + QPalette temp( btn, btn ); + + for (int i = 0; i<5; i++) + cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) ); + + editPalette.setActive( cg ); + setPreviewPalette( editPalette ); + + updateColorButtons(); +} + +void PaletteEditorAdvanced::buildInactive() +{ + editPalette.setInactive( editPalette.active() ); + if ( checkBuildEffect->isChecked() ) + buildInactiveEffect(); + else { + setPreviewPalette( editPalette ); + updateColorButtons(); } - return result; } -void PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup) +void PaletteEditorAdvanced::buildInactiveEffect() { - editPalette = buildEffect(colorGroup, editPalette); + QColorGroup cg = editPalette.inactive(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = Qt::black; + + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); + + editPalette.setInactive( cg ); + setPreviewPalette( editPalette ); updateColorButtons(); } -void PaletteEditorAdvanced::build(QPalette::ColorGroup colorGroup) +void PaletteEditorAdvanced::buildDisabled() { - if (colorGroup != QPalette::Active) { - for (int i = 0; i < QPalette::NColorRoles; i++) - editPalette.setColor(colorGroup, QPalette::ColorRole(i), - editPalette.color(QPalette::Active, QPalette::ColorRole(i))); + QColorGroup cg = editPalette.active(); + cg.setColor( QColorGroup::ButtonText, Qt::darkGray ); + cg.setColor( QColorGroup::WindowText, Qt::darkGray ); + cg.setColor( QColorGroup::Text, Qt::darkGray ); + cg.setColor( QColorGroup::HighlightedText, Qt::darkGray ); + editPalette.setDisabled( cg ); + + if ( checkBuildEffect->isChecked() ) + buildDisabledEffect(); + else { + setPreviewPalette( editPalette ); + updateColorButtons(); + } +} + +void PaletteEditorAdvanced::buildDisabledEffect() +{ + QColorGroup cg = editPalette.disabled(); + + QColor light, midlight, mid, dark, shadow; + QColor btn = cg.color( QColorGroup::Button ); + + light = btn.light(150); + midlight = btn.light(115); + mid = btn.dark(150); + dark = btn.dark(); + shadow = Qt::black; - if (colorGroup == QPalette::Disabled) { - editPalette.setColor(colorGroup, QPalette::ButtonText, Qt::darkGray); - editPalette.setColor(colorGroup, QPalette::WindowText, Qt::darkGray); - editPalette.setColor(colorGroup, QPalette::Text, Qt::darkGray); - editPalette.setColor(colorGroup, QPalette::HighlightedText, Qt::darkGray); - } + cg.setColor( QColorGroup::Light, light ); + cg.setColor( QColorGroup::Midlight, midlight ); + cg.setColor( QColorGroup::Mid, mid ); + cg.setColor( QColorGroup::Dark, dark ); + cg.setColor( QColorGroup::Shadow, shadow ); - if (ui->checkBuildEffect->isChecked()) - buildEffect(colorGroup); - else - updateColorButtons(); + editPalette.setDisabled( cg ); + setPreviewPalette( editPalette ); + updateColorButtons(); +} + +void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal ) +{ + QColorGroup cg; + + switch (selectedPalette) { + case 0: + default: + cg = pal.active(); + break; + case 1: + cg = pal.inactive(); + break; + case 2: + cg = pal.disabled(); + break; } + previewPalette.setActive( cg ); + previewPalette.setInactive( cg ); + previewPalette.setDisabled( cg ); } void PaletteEditorAdvanced::updateColorButtons() { - QPalette::ColorGroup colorGroup = groupFromIndex(selectedPalette); - buttonCentral->setColor(editPalette.color(colorGroup, - centralFromIndex(ui->comboCentral->currentIndex()))); - buttonEffect->setColor(editPalette.color(colorGroup, - effectFromIndex(ui->comboEffect->currentIndex()))); + QColor central, effect; + switch (selectedPalette) { + case 0: + default: + central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) ); + effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) ); + break; + case 1: + central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) ); + effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) ); + break; + case 2: + central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) ); + effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) ); + break; + } + + buttonCentral->setColor(central); + buttonEffect->setColor(effect); } -void PaletteEditorAdvanced::setPal(const QPalette &pal) +void PaletteEditorAdvanced::setPal( const QPalette& pal ) { editPalette = pal; + setPreviewPalette( pal ); updateColorButtons(); } @@ -321,51 +503,51 @@ QPalette PaletteEditorAdvanced::pal() const return editPalette; } -void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role) +void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode ) { int initRole = 0; - switch (role) { - case QPalette::Window: + switch( mode ) { + case Qt::PaletteBackground: initRole = 0; break; - case QPalette::WindowText: + case Qt::PaletteForeground: initRole = 1; break; - case QPalette::Base: + case Qt::PaletteButton: initRole = 2; break; - case QPalette::AlternateBase: + case Qt::PaletteBase: initRole = 3; break; - case QPalette::ToolTipBase: + case Qt::PaletteText: initRole = 4; break; - case QPalette::ToolTipText: + case Qt::PaletteBrightText: initRole = 5; break; - case QPalette::Text: + case Qt::PaletteButtonText: initRole = 6; break; - case QPalette::Button: + case Qt::PaletteHighlight: initRole = 7; break; - case QPalette::ButtonText: + case Qt::PaletteHighlightedText: initRole = 8; break; - case QPalette::BrightText: + case Qt::PaletteLight: initRole = 9; break; - case QPalette::Highlight: + case Qt::PaletteMidlight: initRole = 10; break; - case QPalette::HighlightedText: + case Qt::PaletteDark: initRole = 11; break; - case QPalette::Link: + case Qt::PaletteMid: initRole = 12; break; - case QPalette::LinkVisited: + case Qt::PaletteShadow: initRole = 13; break; default: @@ -373,27 +555,36 @@ void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role) break; } - if (initRole != -1) - ui->comboCentral->setCurrentIndex(initRole); + if ( initRole <= -1 ) return; + + if (initRole > 8 ) { + comboEffect->setCurrentItem( initRole - 9 ); + } + else { + comboCentral->setCurrentItem( initRole ); + } } -QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init, - QPalette::ColorRole backgroundRole, QWidget *parent) +QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init, + Qt::BackgroundMode mode, QWidget* parent, + const char* name ) { - PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent); - dlg->setupBackgroundRole(backgroundRole); + PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( parent, name, true ); + dlg->setupBackgroundMode( mode ); - if (init != QPalette()) - dlg->setPal(init); + if ( init != QPalette() ) + dlg->setPal( init ); int resultCode = dlg->exec(); QPalette result = init; - if (resultCode == QDialog::Accepted) + if ( resultCode == QDialog::Accepted ) { + if ( ok ) + *ok = true; result = dlg->pal(); - - if (ok) - *ok = resultCode; - + } else { + if ( ok ) + *ok = false; + } delete dlg; return result; } diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h index 2bdb95d..a1eb8e7 100644 --- a/tools/qtconfig/paletteeditoradvanced.h +++ b/tools/qtconfig/paletteeditoradvanced.h @@ -42,65 +42,69 @@ #ifndef PALETTEEDITORADVANCED_H #define PALETTEEDITORADVANCED_H -#include +#include "paletteeditoradvancedbase.h" QT_BEGIN_NAMESPACE -namespace Ui { - class PaletteEditorAdvanced; -} - -class ColorButton; - -class PaletteEditorAdvanced : public QDialog +class PaletteEditorAdvanced : public PaletteEditorAdvancedBase { Q_OBJECT public: - PaletteEditorAdvanced(QWidget *parent = 0); + PaletteEditorAdvanced( QWidget * parent=0, const char * name=0, + bool modal=false, Qt::WindowFlags f=0 ); ~PaletteEditorAdvanced(); - static QPalette getPalette(bool *ok, const QPalette &pal, - QPalette::ColorRole backgroundRole = QPalette::Window, - QWidget *parent = 0); - - static QPalette buildEffect(QPalette::ColorGroup colorGroup, const QPalette &basePalette); + static QPalette getPalette( bool *ok, const QPalette &pal, Qt::BackgroundMode mode = Qt::PaletteBackground, + QWidget* parent = 0, const char* name = 0 ); protected slots: void paletteSelected(int); - void onCentral(int); - void onEffect(int); + void onCentral( int ); + void onEffect( int ); void onChooseCentralColor(); void onChooseEffectColor(); - void onToggleBuildEffects(bool); - void onToggleBuildInactive(bool); - void onToggleBuildDisabled(bool); + void onToggleBuildEffects( bool ); + void onToggleBuildInactive( bool ); + void onToggleBuildDisabled( bool ); protected: - void buildEffect(QPalette::ColorGroup); - void build(QPalette::ColorGroup); + void mapToActiveCentralRole( const QColor& ); + void mapToActiveEffectRole( const QColor& ); + void mapToActivePixmapRole( const QPixmap& ); + void mapToInactiveCentralRole( const QColor& ); + void mapToInactiveEffectRole( const QColor& ); + void mapToInactivePixmapRole( const QPixmap& ); + void mapToDisabledCentralRole( const QColor& ); + void mapToDisabledEffectRole( const QColor& ); + void mapToDisabledPixmapRole( const QPixmap& ); + + + void buildPalette(); + void buildActiveEffect(); + void buildInactive(); + void buildInactiveEffect(); + void buildDisabled(); + void buildDisabledEffect(); private: + void setPreviewPalette( const QPalette& ); void updateColorButtons(); - void setupBackgroundRole(QPalette::ColorRole); + void setupBackgroundMode( Qt::BackgroundMode ); QPalette pal() const; - void setPal(const QPalette &); + void setPal( const QPalette& ); - static QPalette::ColorGroup groupFromIndex(int); - static QPalette::ColorRole centralFromIndex(int); - static QPalette::ColorRole effectFromIndex(int); + QColorGroup::ColorRole centralFromItem( int ); + QColorGroup::ColorRole effectFromItem( int ); QPalette editPalette; - - Ui::PaletteEditorAdvanced *ui; + QPalette previewPalette; int selectedPalette; - ColorButton *buttonCentral; - ColorButton *buttonEffect; }; QT_END_NAMESPACE -#endif // PALETTEEDITORADVANCED_H +#endif diff --git a/tools/qtconfig/paletteeditoradvanced.ui b/tools/qtconfig/paletteeditoradvanced.ui deleted file mode 100644 index b1d6b95..0000000 --- a/tools/qtconfig/paletteeditoradvanced.ui +++ /dev/null @@ -1,416 +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 tools applications 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$ -** -********************************************************************* - PaletteEditorAdvanced - - - - 0 - 0 - 239 - 344 - - - - Tune Palette - - - - - - - - Select &Palette: - - - paletteCombo - - - - - - - - Active Palette - - - - - Inactive Palette - - - - - Disabled Palette - - - - - - - - - - - 0 - 0 - - - - Auto - - - - - - Build inactive palette from active - - - true - - - - - - - Build disabled palette from active - - - true - - - - - - - - - - Central color &roles - - - - - - Choose central color role - - - <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> - - - - Window - - - - - WindowText - - - - - Base - - - - - AlternateBase - - - - - ToolTipBase - - - - - ToolTipText - - - - - Text - - - - - Button - - - - - ButtonText - - - - - BrightText - - - - - Highlight - - - - - HighlightedText - - - - - Link - - - - - LinkVisited - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - &Select Color: - - - - - - - - - - - - 3-D shadow &effects - - - - - - - - Generate shadings - - - Check to let 3D-effect colors be calculated from button-color. - - - Build &from button color - - - true - - - - - - - false - - - Choose 3D-effect color role - - - <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 - - - - - Midlight - - - - - Mid - - - - - Dark - - - - - Shadow - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Select Co&lor: - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - PaletteEditorAdvanced - accept() - - - 238 - 384 - - - 157 - 274 - - - - - buttonBox - rejected() - PaletteEditorAdvanced - reject() - - - 306 - 390 - - - 286 - 274 - - - - - checkBuildEffect - toggled(bool) - comboEffect - setDisabled(bool) - - - 82 - 262 - - - 190 - 262 - - - - - diff --git a/tools/qtconfig/paletteeditoradvancedbase.cpp b/tools/qtconfig/paletteeditoradvancedbase.cpp new file mode 100644 index 0000000..708c834 --- /dev/null +++ b/tools/qtconfig/paletteeditoradvancedbase.cpp @@ -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 tools applications 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 "paletteeditoradvancedbase.h" +#include "colorbutton.h" + +#include + +QT_BEGIN_NAMESPACE + +/* + * Constructs a PaletteEditorAdvancedBase as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * true to construct a modal dialog. + */ +PaletteEditorAdvancedBase::PaletteEditorAdvancedBase(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) + : QDialog(parent, name, modal, fl) +{ + setupUi(this); + + + // signals and slots connections + connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int))); + connect(comboCentral, SIGNAL(activated(int)), this, SLOT(onCentral(int))); + connect(buttonCentral, SIGNAL(clicked()), this, SLOT(onChooseCentralColor())); + connect(buttonEffect, SIGNAL(clicked()), this, SLOT(onChooseEffectColor())); + connect(comboEffect, SIGNAL(activated(int)), this, SLOT(onEffect(int))); + connect(checkBuildEffect, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildEffects(bool))); + connect(checkBuildEffect, SIGNAL(toggled(bool)), comboEffect, SLOT(setDisabled(bool))); + connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool))); + connect(checkBuildInactive, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildInactive(bool))); + connect(checkBuildDisabled, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildDisabled(bool))); + init(); +} + +/* + * Destroys the object and frees any allocated resources + */ +PaletteEditorAdvancedBase::~PaletteEditorAdvancedBase() +{ + destroy(); + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void PaletteEditorAdvancedBase::languageChange() +{ + retranslateUi(this); +} + +void PaletteEditorAdvancedBase::init() +{ +} + +void PaletteEditorAdvancedBase::destroy() +{ +} + +void PaletteEditorAdvancedBase::onCentral(int) +{ + qWarning("PaletteEditorAdvancedBase::onCentral(int): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::onChooseCentralColor() +{ + qWarning("PaletteEditorAdvancedBase::onChooseCentralColor(): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::onChooseEffectColor() +{ + qWarning("PaletteEditorAdvancedBase::onChooseEffectColor(): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::onEffect(int) +{ + qWarning("PaletteEditorAdvancedBase::onEffect(int): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::onToggleBuildDisabled(bool) +{ + qWarning("PaletteEditorAdvancedBase::onToggleBuildDisabled(bool): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::onToggleBuildEffects(bool) +{ + qWarning("PaletteEditorAdvancedBase::onToggleBuildEffects(bool): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::onToggleBuildInactive(bool) +{ + qWarning("PaletteEditorAdvancedBase::onToggleBuildInactive(bool): Not implemented yet"); +} + +void PaletteEditorAdvancedBase::paletteSelected(int) +{ + qWarning("PaletteEditorAdvancedBase::paletteSelected(int): Not implemented yet"); +} + +QT_END_NAMESPACE diff --git a/tools/qtconfig/paletteeditoradvancedbase.h b/tools/qtconfig/paletteeditoradvancedbase.h new file mode 100644 index 0000000..ee14a26 --- /dev/null +++ b/tools/qtconfig/paletteeditoradvancedbase.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** 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 tools applications 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 PALETTEEDITORADVANCEDBASE_H +#define PALETTEEDITORADVANCEDBASE_H + +#include "ui_paletteeditoradvancedbase.h" +#include + +QT_BEGIN_NAMESPACE + +class ColorButton; + +class PaletteEditorAdvancedBase : public QDialog, public Ui::PaletteEditorAdvancedBase +{ + Q_OBJECT + +public: + PaletteEditorAdvancedBase(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0); + ~PaletteEditorAdvancedBase(); + +protected slots: + virtual void languageChange(); + + virtual void init(); + virtual void destroy(); + virtual void onCentral(int); + virtual void onChooseCentralColor(); + virtual void onChooseEffectColor(); + virtual void onEffect(int); + virtual void onToggleBuildDisabled(bool); + virtual void onToggleBuildEffects(bool); + virtual void onToggleBuildInactive(bool); + virtual void paletteSelected(int); + +}; + +QT_END_NAMESPACE + +#endif // PALETTEEDITORADVANCEDBASE_H diff --git a/tools/qtconfig/paletteeditoradvancedbase.ui b/tools/qtconfig/paletteeditoradvancedbase.ui new file mode 100644 index 0000000..12c5a7d --- /dev/null +++ b/tools/qtconfig/paletteeditoradvancedbase.ui @@ -0,0 +1,617 @@ + + + ********************************************************************* +** +** 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 tools applications 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$ +** +********************************************************************* + + PaletteEditorAdvancedBase + + + PaletteEditorAdvancedBase + + + true + + + + 0 + 0 + 295 + 346 + + + + Tune Palette + + + true + + + <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> + + + + unnamed + + + 11 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + TextLabel1 + + + Select &Palette: + + + paletteCombo + + + + + + + paletteCombo + + + + Active Palette + + + + + Inactive Palette + + + + + Disabled Palette + + + + + + + + + + ButtonGroup1 + + + + 5 + 4 + 0 + 0 + + + + Auto + + + + unnamed + + + 11 + + + 6 + + + + + checkBuildInactive + + + Build inactive palette from active + + + true + + + + + + + checkBuildDisabled + + + Build disabled palette from active + + + true + + + + + + + + + + groupCentral + + + Central color &roles + + + + unnamed + + + 11 + + + 6 + + + + + comboCentral + + + Choose central color role + + + <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> + + + + Window + + + + + WindowText + + + + + Button + + + + + Base + + + + + Text + + + + + BrightText + + + + + ButtonText + + + + + Highlight + + + + + HighlightedText + + + + + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + labelCentral + + + + 1 + 1 + 0 + 0 + + + + + 0 + 0 + + + + &Select Color: + + + buttonCentral + + + + + + + buttonCentral + + + + 0 + 0 + 0 + 0 + + + + Qt::TabFocus + + + Choose a color + + + Choose a color for the selected central color role. + + + + + + + + + + + + groupEffect + + + 3-D shadow &effects + + + + unnamed + + + 11 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + checkBuildEffect + + + Build &from button color + + + true + + + Generate shadings + + + Check to let 3D-effect colors be calculated from button-color. + + + + + + + comboEffect + + + Choose 3D-effect color role + + + <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 + + + + + Midlight + + + + + Mid + + + + + Dark + + + + + Shadow + + + + + + + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + labelEffect + + + + 1 + 1 + 0 + 0 + + + + + 0 + 0 + + + + Select Co&lor: + + + buttonEffect + + + + + + + buttonEffect + + + + 0 + 0 + 0 + 0 + + + + Qt::TabFocus + + + Choose a color + + + Choose a color for the selected effect color role. + + + + + + + + + + + + unnamed + + + 0 + + + 6 + + + + + + 20 + 20 + + + + Expanding + + + Horizontal + + + + + + + buttonOk + + + OK + + + true + + + true + + + Close dialog and apply all changes. + + + + + + + buttonCancel + + + Cancel + + + true + + + Close dialog and discard all changes. + + + + + + + + + + + ColorButton + +
      colorbutton.h
      + + 40 + 25 + + 0 + + 5 + 5 + + image0 + + color + pixmap + +
      +
      + + buttonOk + buttonCancel + paletteCombo + checkBuildInactive + checkBuildDisabled + comboCentral + buttonCentral + checkBuildEffect + comboEffect + buttonEffect + + + + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + +
      diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp index f37ac78..3b46e8d 100644 --- a/tools/qtconfig/previewframe.cpp +++ b/tools/qtconfig/previewframe.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include "previewframe.h" -#include "previewwidget.h" #include #include @@ -48,8 +47,8 @@ QT_BEGIN_NAMESPACE -PreviewFrame::PreviewFrame(QWidget *parent) - : QFrame(parent) +PreviewFrame::PreviewFrame( QWidget *parent, const char *name ) + : QFrame( parent, name ) { setMinimumSize(200, 200); setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); @@ -83,22 +82,23 @@ void PreviewFrame::setPreviewVisible(bool visible) workspace->viewport()->update(); } -Workspace::Workspace(PreviewFrame *parent) +Workspace::Workspace(PreviewFrame* parent, const char* name) : QMdiArea(parent) { previewFrame = parent; PreviewWidget *previewWidget = previewFrame->widget(); + setObjectName(QLatin1String(name)); QMdiSubWindow *frame = addSubWindow(previewWidget, Qt::Window); - frame->move(10, 10); + frame->move(10,10); frame->show(); } -void Workspace::paintEvent(QPaintEvent *) +void Workspace::paintEvent( QPaintEvent* ) { - QPainter p(viewport()); + QPainter p (viewport()); p.fillRect(rect(), palette().color(backgroundRole()).dark()); - p.setPen(QPen(Qt::white)); - p.drawText(0, height() / 2, width(), height(), Qt::AlignHCenter, previewFrame->previewText()); + p.setPen( QPen( Qt::white ) ); + p.drawText ( 0, height() / 2, width(), height(), Qt::AlignHCenter, previewFrame->previewText()); } QT_END_NAMESPACE diff --git a/tools/qtconfig/previewframe.h b/tools/qtconfig/previewframe.h index 41c5030..de364e4 100644 --- a/tools/qtconfig/previewframe.h +++ b/tools/qtconfig/previewframe.h @@ -42,6 +42,8 @@ #ifndef PREVIEWFRAME_H #define PREVIEWFRAME_H +#include "previewwidget.h" + #include QT_BEGIN_NAMESPACE @@ -52,29 +54,28 @@ class Workspace : public QMdiArea Q_OBJECT public: - Workspace(PreviewFrame *parent = 0); + Workspace( PreviewFrame* parent = 0, const char* name = 0 ); ~Workspace() {} protected: - void paintEvent(QPaintEvent *); + void paintEvent( QPaintEvent* ); private: PreviewFrame *previewFrame; }; -class PreviewWidget; class PreviewFrame : public QFrame { Q_OBJECT public: - PreviewFrame(QWidget *parent = 0); + PreviewFrame( QWidget *parent = 0, const char *name = 0 ); void setPreviewPalette(QPalette); void setPreviewVisible(bool val); QString previewText() const; PreviewWidget *widget() const { return previewWidget; } private: - Workspace *workspace; - PreviewWidget *previewWidget; + Workspace *workspace; + PreviewWidget *previewWidget; QString m_previewWindowText; }; diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp index 0573846..757b448 100644 --- a/tools/qtconfig/previewwidget.cpp +++ b/tools/qtconfig/previewwidget.cpp @@ -40,32 +40,32 @@ ****************************************************************************/ #include "previewwidget.h" -#include "ui_previewwidget.h" #include QT_BEGIN_NAMESPACE -PreviewWidget::PreviewWidget(QWidget *parent) - : QWidget(parent), ui(new Ui::PreviewWidget) +PreviewWidget::PreviewWidget( QWidget *parent, const char *name ) + : PreviewWidgetBase( parent, name ) { - ui->setupUi(this); - // install event filter on child widgets - QList l = findChildren(); - foreach(QWidget *w, l) { - w->installEventFilter(this); - w->setFocusPolicy(Qt::NoFocus); + QObjectList l = queryList("QWidget"); + for (int i = 0; i < l.size(); ++i) { + QObject * obj = l.at(i); + obj->installEventFilter(this); + ((QWidget*)obj)->setFocusPolicy(Qt::NoFocus); } } -PreviewWidget::~PreviewWidget() + +void PreviewWidget::closeEvent(QCloseEvent *e) { - delete ui; + e->ignore(); } + bool PreviewWidget::eventFilter(QObject *, QEvent *e) { - switch (e->type()) { + switch ( e->type() ) { case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: @@ -81,9 +81,4 @@ bool PreviewWidget::eventFilter(QObject *, QEvent *e) return false; } -void PreviewWidget::closeEvent(QCloseEvent *e) -{ - e->ignore(); -} - QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidget.h b/tools/qtconfig/previewwidget.h index e7707cd..37e9cba 100644 --- a/tools/qtconfig/previewwidget.h +++ b/tools/qtconfig/previewwidget.h @@ -42,29 +42,21 @@ #ifndef PREVIEWWIDGET_H #define PREVIEWWIDGET_H -#include +#include "previewwidgetbase.h" QT_BEGIN_NAMESPACE -namespace Ui { - class PreviewWidget; -} - - -class PreviewWidget : public QWidget +class PreviewWidget : public PreviewWidgetBase { Q_OBJECT public: - PreviewWidget(QWidget *parent = 0); - ~PreviewWidget(); + PreviewWidget( QWidget *parent = 0, const char *name = 0 ); - bool eventFilter(QObject *, QEvent *); -private: void closeEvent(QCloseEvent *); - Ui::PreviewWidget *ui; + bool eventFilter(QObject *, QEvent *); }; QT_END_NAMESPACE -#endif // PREVIEWWIDGET_H +#endif diff --git a/tools/qtconfig/previewwidget.ui b/tools/qtconfig/previewwidget.ui deleted file mode 100644 index 2e0789f..0000000 --- a/tools/qtconfig/previewwidget.ui +++ /dev/null @@ -1,252 +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 tools applications 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$ -** -********************************************************************* - PreviewWidget - - - - 0 - 0 - 398 - 282 - - - - - 0 - 0 - - - - Preview Window - - - - - - - - 6 - - - 0 - - - - - GroupBox - - - - 6 - - - 11 - - - - - RadioButton1 - - - true - - - - - - - RadioButton2 - - - - - - - RadioButton3 - - - - - - - - - - GroupBox2 - - - - 6 - - - 11 - - - - - CheckBox1 - - - true - - - - - - - CheckBox2 - - - - - - - - - - 50 - - - - - - - - - 6 - - - 0 - - - - - LineEdit - - - - - - - - ComboBox - - - - - - - - 6 - - - 0 - - - - - - - - PushButton - - - - - - - - - Qt::Horizontal - - - - - - - Qt::Horizontal - - - - - - - - 32767 - 55 - - - - true - - - <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> - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 0 - - - - - - - - - diff --git a/tools/qtconfig/previewwidgetbase.cpp b/tools/qtconfig/previewwidgetbase.cpp new file mode 100644 index 0000000..9234b6f --- /dev/null +++ b/tools/qtconfig/previewwidgetbase.cpp @@ -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 tools applications 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 "previewwidgetbase.h" + +#include + +QT_BEGIN_NAMESPACE + +/* + * Constructs a PreviewWidgetBase as a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + */ +PreviewWidgetBase::PreviewWidgetBase(QWidget* parent, const char* name, Qt::WindowFlags fl) + : QWidget(parent, name, fl) +{ + setupUi(this); + + + // signals and slots connections + init(); +} + +/* + * Destroys the object and frees any allocated resources + */ +PreviewWidgetBase::~PreviewWidgetBase() +{ + destroy(); + // no need to delete child widgets, Qt does it all for us +} + +/* + * Sets the strings of the subwidgets using the current + * language. + */ +void PreviewWidgetBase::languageChange() +{ + retranslateUi(this); +} + +void PreviewWidgetBase::init() +{ +} + +void PreviewWidgetBase::destroy() +{ +} + +QT_END_NAMESPACE diff --git a/tools/qtconfig/previewwidgetbase.h b/tools/qtconfig/previewwidgetbase.h new file mode 100644 index 0000000..829415e --- /dev/null +++ b/tools/qtconfig/previewwidgetbase.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** 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 tools applications 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 PREVIEWWIDGETBASE_H +#define PREVIEWWIDGETBASE_H + +#include "ui_previewwidgetbase.h" +#include + +QT_BEGIN_NAMESPACE + +class PreviewWidgetBase : public QWidget, public Ui::PreviewWidgetBase +{ + Q_OBJECT + +public: + PreviewWidgetBase(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = 0); + ~PreviewWidgetBase(); + +protected slots: + virtual void languageChange(); + + virtual void init(); + virtual void destroy(); + +}; + +QT_END_NAMESPACE + +#endif // PREVIEWWIDGETBASE_H diff --git a/tools/qtconfig/previewwidgetbase.ui b/tools/qtconfig/previewwidgetbase.ui new file mode 100644 index 0000000..701bf84 --- /dev/null +++ b/tools/qtconfig/previewwidgetbase.ui @@ -0,0 +1,340 @@ + + + ********************************************************************* +** +** 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 tools applications 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$ +** +********************************************************************* + + PreviewWidgetBase + + + PreviewWidgetBase + + + + 0 + 0 + 378 + 236 + + + + + 1 + 1 + 0 + 0 + + + + Preview Window + + + + unnamed + + + 11 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + unnamed + + + 0 + + + 6 + + + + + ButtonGroup1 + + + ButtonGroup + + + + unnamed + + + 11 + + + 6 + + + + + RadioButton1 + + + RadioButton1 + + + true + + + + + + + RadioButton2 + + + RadioButton2 + + + + + + + RadioButton3 + + + RadioButton3 + + + + + + + + + + ButtonGroup2 + + + ButtonGroup2 + + + + unnamed + + + 11 + + + 6 + + + + + CheckBox1 + + + CheckBox1 + + + true + + + + + + + CheckBox2 + + + CheckBox2 + + + + + + + + + + ProgressBar1 + + + 50 + + + + + + + + + unnamed + + + 0 + + + 6 + + + + + LineEdit1 + + + LineEdit + + + + + + + ComboBox1 + + + + ComboBox + + + + + + + + unnamed + + + 0 + + + 6 + + + + + SpinBox1 + + + + + + + PushButton1 + + + PushButton + + + + + + + + + ScrollBar1 + + + Qt::Horizontal + + + + + + + Slider1 + + + Qt::Horizontal + + + + + + + textView + + + + 32767 + 50 + + + + true + + + <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> + + + + + + + + + + + + 20 + 20 + + + + Expanding + + + Vertical + + + + + + qPixmapFromMimeSource + diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro index cb06e5a..d1fd320 100644 --- a/tools/qtconfig/qtconfig.pro +++ b/tools/qtconfig/qtconfig.pro @@ -1,10 +1,11 @@ TEMPLATE = app -CONFIG += qt warn_on x11 +CONFIG += qt warn_on x11 build_all:!build_pass { CONFIG -= build_all CONFIG += release } LANGUAGE = C++ +QT += qt3support contains(QT_CONFIG, gstreamer):LIBS += $$QT_LIBS_GSTREAMER -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 contains(QT_CONFIG, gstreamer):QMAKE_CXXFLAGS += $$QT_CFLAGS_GSTREAMER @@ -12,17 +13,19 @@ contains(QT_CONFIG, phonon) { QT += phonon DEFINES += HAVE_PHONON } -SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp -HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h +SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \ + mainwindowbase.cpp paletteeditoradvancedbase.cpp previewwidgetbase.cpp +HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \ + mainwindowbase.h paletteeditoradvancedbase.h previewwidgetbase.h -FORMS = mainwindow.ui paletteeditoradvanced.ui previewwidget.ui +FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidgetbase.ui RESOURCES = qtconfig.qrc PROJECTNAME = Qt Configuration -TARGET = qtconfig -DESTDIR = ../../bin +TARGET = qtconfig +DESTDIR = ../../bin target.path=$$[QT_INSTALL_BINS] INSTALLS += target -INCLUDEPATH += . -DBFILE = qtconfig.db +INCLUDEPATH += . +DBFILE = qtconfig.db diff --git a/tools/tools.pro b/tools/tools.pro index c64fe25..8f23fe4 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -20,7 +20,7 @@ TEMPLATE = subdirs SUBDIRS += designer } } - unix:!mac:!embedded:SUBDIRS += qtconfig + unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig win32:!wince*:SUBDIRS += activeqt } contains(QT_CONFIG, declarative):SUBDIRS += qml -- cgit v0.12 From 494ce0dac35c7ade0ce78589878597a7ca912864 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 5 Oct 2010 14:39:41 +0300 Subject: Make default application deployment removable Default application deployment was hard coded in qmake, so it was impossible to replace with custom deployment. Now the default deployment is generated via .prf files and is removable. Task-number: QTBUG-13367 Reviewed-by: axis --- doc/src/development/qmake-manual.qdoc | 16 +++++ doc/src/snippets/code/doc_src_qmake-manual.qdoc | 4 ++ mkspecs/common/symbian/symbian.conf | 2 +- mkspecs/features/symbian/application_icon.prf | 51 ++++++++++----- mkspecs/features/symbian/default_post.prf | 9 +-- qmake/generators/symbian/symbiancommon.cpp | 82 +------------------------ 6 files changed, 62 insertions(+), 102 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index bc0df04..a5d0207 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1449,6 +1449,22 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 141 + On the Symbian platform, a default deployment is generated for all + application projects. You can modify the autogenerated default + deployment via following \c DEPLOYMENT variable values: + + \list + \o default_bin_deployment - Application executable + \o default_resource_deployment - Application resources, including icon + \o default_reg_deployment - Application registration file + \endlist + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 154 + + This will entirely remove the default application deployment. + On the Symbian platform, you can use \c{DEPLOYMENT.installer_header} variable to generate smart installer wrapper for your application. If you specify just UID of the installer package as the value, then diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 379d081..20d8d45 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -1014,3 +1014,7 @@ BLD_INF_RULES.prj_exports += my_exports my_note.pkg_postrules.installer = "\"myinstallnote.txt\" - \"\", FILETEXT, TEXTCONTINUE" DEPLOYMENT += my_note //! [153] + +//! [154] +DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_deployment +//! [154] diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index cc5b788..0bdc8e5 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -194,7 +194,7 @@ pkg_platform_dependencies = \ "[0x20032DE7],0,0,0,{\"S60ProductID\"}" \ " " -DEPLOYMENT += default_deployment +DEPLOYMENT += default_deployment default_bin_deployment default_resource_deployment default_reg_deployment defineReplace(symbianRemoveSpecialCharacters) { # Produce identical string to what SymbianCommonGenerator::removeSpecialCharacters and diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 9a9395a..2948811 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -1,21 +1,39 @@ load(data_caging_paths) -# If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW -# requires the registration resource file to exist always -contains( CONFIG, no_icon ) { - symbian:RSS_RULES += "hidden = KAppIsHidden;" - CONFIG -= no_icon -} else { -# There is no point in compiling the MIF icon if no_icon CONFIGS is set - !isEmpty(ICON) { +contains(CONFIG, no_icon) { + # If no_icon keyword exist, the S60 UI app is just made hidden. This because S60 app FW + # requires the registration resource file to exist always + contains(QT, gui):contains(CONFIG, qt) { + symbian:RSS_RULES += "hidden = KAppIsHidden;" + CONFIG -= no_icon + } +} + +!contains(CONFIG, no_icon) { + baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET)) + symbian-abld|symbian-sbsv2 { + resourceZDir = $$EPOCROOT$$HW_ZDIR$$APP_RESOURCE_DIR + regZDir = $$EPOCROOT$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR + } else { + isEmpty(DESTDIR) { + resourceZDir = . + } else { + resourceZDir = $$DESTDIR + } + regZDir = $$resourceZDir + } + + default_resource_deployment.sources += $$resourceZDir/$${baseTarget}.rsc + default_resource_deployment.path = $$APP_RESOURCE_DIR + default_reg_deployment.sources += $$regZDir/$${baseTarget}_reg.rsc + default_reg_deployment.path = $$REG_RESOURCE_IMPORT_DIR + !isEmpty(ICON) { !count(ICON, 1) { ICON = $$first(ICON) warning("Only first icon specified in ICON variable is used: $$ICON") } - baseTarget = $$symbianRemoveSpecialCharacters($$basename(TARGET)) - # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code !symbian-sbsv2 { # Absolute path required for shadow builds. @@ -27,13 +45,10 @@ contains( CONFIG, no_icon ) { ICON_backslashed = $$ICON symbian-abld { + # ${ZDIR} is defined in Makefile mifIconZDir = ${ZDIR}$$APP_RESOURCE_DIR } else { - isEmpty(DESTDIR) { - mifIconZDir = . - } else { - mifIconZDir = $$DESTDIR - } + mifIconZDir = $$resourceZDir } # Extra compiler rules for mifconv @@ -53,6 +68,10 @@ contains( CONFIG, no_icon ) { } # Rules to use generated MIF file from symbian resources RSS_RULES.number_of_icons = $$size(ICON_backslashed) - RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif + RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif + + default_resource_deployment.sources += $$resourceZDir/$${baseTarget}.mif } } + + diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf index 0564e9b..a9b6d0e 100644 --- a/mkspecs/features/symbian/default_post.prf +++ b/mkspecs/features/symbian/default_post.prf @@ -9,6 +9,11 @@ contains(TEMPLATE, ".*app") { } else { QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY } + + default_bin_deployment.sources += $$symbianRemoveSpecialCharacters($$basename(TARGET)).exe + default_bin_deployment.path += /sys/bin + + load(application_icon.prf) } contains(TEMPLATE, lib): { contains(CONFIG, staticlib)|contains(CONFIG, static): { @@ -26,10 +31,6 @@ contains(TEMPLATE, lib): { MMP_RULES -= EXPORTUNFROZEN } -contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG,qt) { - load(application_icon.prf) -} - isEmpty(TARGET.UID3):TARGET.UID3 = $$generate_uid("$${OUT_PWD}/$${TARGET}") isEmpty(TARGET.UID2) { contains(CONFIG, stdbinary) { diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 91e126c..c0a6626 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -383,87 +383,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB t << manufacturerStr << endl; } - // Install paths on the phone *** should be dynamic at some point - QString installPathBin = "!:\\sys\\bin"; - QString installPathResource = "!:\\resource\\apps"; - QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps"; - - // Find location of builds - QString destDirBin; - QString destDirResource; - QString destDirRegResource; - if (epocBuild) { - destDirBin = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)").arg(epocRoot()); - destDirResource = QString("%1epoc32/data/z/resource/apps").arg(epocRoot()); - destDirRegResource = QString("%1epoc32/data/z/private/10003a3f/import/apps").arg(epocRoot()); - } else { - destDirBin = project->first("DESTDIR"); - if (destDirBin.isEmpty()) - destDirBin = "."; - else if (destDirBin.endsWith('/') || destDirBin.endsWith('\\')) - destDirBin.chop(1); - destDirResource = destDirBin; - destDirRegResource = destDirBin; - } - - if (targetType == TypeExe) { - // deploy .exe file - t << "; Executable and default resource files" << endl; - QString exeFile = fixedTarget + ".exe"; - t << QString("\"%1/%2\" - \"%3\\%4\"") - .arg(destDirBin) - .arg(exeFile) - .arg(installPathBin) - .arg(exeFile) << endl; - ts << QString("\"\" - \"%1\\%2\"") - .arg(romPath(installPathBin)) - .arg(exeFile) << endl; - - // deploy rsc & reg_rsc file - if (!project->isActiveConfig("no_icon")) { - t << QString("\"%1/%2\" - \"%3\\%4\"") - .arg(destDirResource) - .arg(fixedTarget + ".rsc") - .arg(installPathResource) - .arg(fixedTarget + ".rsc") << endl; - ts << QString("\"\" - \"%1\\%2\"") - .arg(romPath(installPathResource)) - .arg(fixedTarget + ".rsc") << endl; - - t << QString("\"%1/%2\" - \"%3\\%4\"") - .arg(destDirRegResource) - .arg(fixedTarget + "_reg.rsc") - .arg(installPathRegResource) - .arg(fixedTarget + "_reg.rsc") << endl; - ts << QString("\"\" - \"%1\\%2\"") - .arg(romPath(installPathRegResource)) - .arg(fixedTarget + "_reg.rsc") << endl; - - if (!iconFile.isEmpty()) { - if (epocBuild) { - t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"") - .arg(epocRoot()) - .arg(iconFile) - .arg(QDir::toNativeSeparators(iconFile)) << endl << endl; - ts << QString("\"\" - \"%1\"") - .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl; - } else { - QDir mifIconDir(project->first("DESTDIR")); - QFileInfo mifIcon(mifIconDir.relativeFilePath(project->first("TARGET"))); - QString mifIconFileName = mifIcon.fileName(); - mifIconFileName.append(".mif"); - t << QString("\"%1/%2\" - \"!:%3\"") - .arg(mifIcon.path()) - .arg(mifIconFileName) - .arg(QDir::toNativeSeparators(iconFile)) << endl << endl; - ts << QString("\"\" - \"%1\"") - .arg(romPath(QDir::toNativeSeparators(iconFile))) << endl << endl; - } - } - } - } - - // deploy any additional DEPLOYMENT files + // deploy files specified by DEPLOYMENT variable QString remoteTestPath; QString zDir; remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); -- cgit v0.12 From 50b2477e6ffd64a0730cc5c0f0a6190b1a6b5861 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 5 Oct 2010 17:20:29 +0300 Subject: Added .flags modifier support for DEPLOYMENT items in Symbian The .flags modifier can be used to specify pkg flags for files. For example, to make default application run after install: default_bin_deployment.flags += FR RI For example, to show a note at installation time: notedep.sources = install_note.txt notedep.flags = FT TC DEPLOYMENT += notedep See Symbian package file format documentation for exact supported flag values. Task-number: QTBUG-13367 Reviewed-by: Janne Anttila --- doc/src/development/qmake-manual.qdoc | 17 +++++++++++++++++ doc/src/snippets/code/doc_src_qmake-manual.qdoc | 7 +++++++ .../generators/symbian/initprojectdeploy_symbian.cpp | 20 ++++++++++++++------ qmake/generators/symbian/initprojectdeploy_symbian.h | 6 +++++- qmake/generators/symbian/symbiancommon.cpp | 20 ++++++++++++++++++-- 5 files changed, 61 insertions(+), 9 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index a5d0207..fe2e82a 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1465,6 +1465,23 @@ This will entirely remove the default application deployment. + On the Symbian platform, you can specify file specific install options + with \c{.flags} modifier. Please consult the Symbian platform documentation + for supported options. + + For example: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 155 + + This will show a message box that gives user an option to cancel the + installation and then automatically runs the application after + installation is complete. + + \note Automatically running the applications after install may require signing + the package with better than self-signed certificate, depending on the phone model. + Additionally, some tools such as Runonphone may not work properly with sis + packages that automatically run the application upon install. + On the Symbian platform, you can use \c{DEPLOYMENT.installer_header} variable to generate smart installer wrapper for your application. If you specify just UID of the installer package as the value, then diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 20d8d45..a5bc1f3 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -1018,3 +1018,10 @@ DEPLOYMENT += my_note //! [154] DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_deployment //! [154] + +//! [155] +default_bin_deployment.flags += FILERUN RUNINSTALL +dep_note.sources = install_note.txt +dep_note.flags = FILETEXT TEXTEXIT +DEPLOYMENT += dep_note +//! [155] diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 776a646..5a6f66f 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -248,6 +248,8 @@ void initProjectDeploySymbian(QMakeProject* project, continue; } + QStringList flags = project->values(item + ".flags"); + foreach(QString source, project->values(item + ".sources")) { source = Option::fixPathToLocalOS(source); QString nameFilter; @@ -279,13 +281,15 @@ void initProjectDeploySymbian(QMakeProject* project, Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), false, true), fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") - + info.fileName()))); + + info.fileName()), + flags)); } else { deploymentList.append(CopyItem( Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), false, true), fixPathToEpocOS(deploymentDrive + QLatin1String("/" SYSBIN_DIR "/") - + info.fileName()))); + + info.fileName()), + flags)); } } if (isPlugin(info, devicePath)) { @@ -296,7 +300,8 @@ void initProjectDeploySymbian(QMakeProject* project, // Generate deployment even if file doesn't exist, as this may be the case // when generating .pkg files. deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()), - fixPathToEpocOS(devicePath + "/" + info.fileName()))); + fixPathToEpocOS(devicePath + "/" + info.fileName()), + flags)); continue; } } @@ -323,12 +328,14 @@ void initProjectDeploySymbian(QMakeProject* project, deploymentList.append(CopyItem( Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") - + iterator.fileName()))); + + iterator.fileName()), + flags)); } else { deploymentList.append(CopyItem( Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), fixPathToEpocOS(deploymentDrive + QLatin1String("/" SYSBIN_DIR "/") - + iterator.fileName()))); + + iterator.fileName()), + flags)); } } createPluginStub(info, devicePath + "/" + absoluteItemPath.right(diffSize), @@ -338,7 +345,8 @@ void initProjectDeploySymbian(QMakeProject* project, deploymentList.append(CopyItem( Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), fixPathToEpocOS(devicePath + "/" + absoluteItemPath.right(diffSize) - + "/" + iterator.fileName()))); + + "/" + iterator.fileName()), + flags)); } } } diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h index 2653d2a..bc17b04 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.h +++ b/qmake/generators/symbian/initprojectdeploy_symbian.h @@ -56,9 +56,13 @@ struct CopyItem { - CopyItem(const QString& f, const QString& t) : from(f) , to(t) { } + CopyItem(const QString& f, const QString& t) + : from(f) , to(t) { } + CopyItem(const QString& f, const QString& t, const QStringList& l) + : from(f) , to(t), flags(l) { } QString from; QString to; + QStringList flags; }; typedef QList DeploymentList; diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index c0a6626..5e8bc4a 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -397,6 +397,15 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB for (int i = 0; i < depList.size(); ++i) { QString from = depList.at(i).from; QString to = depList.at(i).to; + QString flags; + bool showOnlyFile = false; + foreach(QString flag, depList.at(i).flags) { + if (flag == QLatin1String("FT") + || flag == QLatin1String("FILETEXT")) { + showOnlyFile = true; + } + flags.append(QLatin1Char(',')).append(flag); + } if (epocBuild) { // Deploy anything not already deployed from under epoc32 instead from under @@ -410,8 +419,15 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB } } - t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl; - ts << QString("\"\" - \"%1\"").arg(romPath(to)) << endl; + // Files with "FILETEXT"/"FT" flag are meant for showing only at installation time + // and therefore do not belong to the stub package and will not install the file into phone. + if (showOnlyFile) + to.clear(); + else + ts << QString("\"\" - \"%1\"").arg(romPath(to)) << endl; + + t << QString("\"%1\" - \"%2\"%3").arg(from.replace('\\','/')).arg(to).arg(flags) << endl; + } t << endl; ts << endl; -- cgit v0.12 From 9cb24d1c4b7359ec84708ba770050de720b50cdf Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 7 Oct 2010 15:36:45 +0300 Subject: Implement support for DEPLOYMENT.display_name in Symbian The default package name and the default name that appears in the application menu is derived from the TARGET variable. Often the default is not optimal for displaying to end user. To set a better display name for these purposes DEPLOYMENT.display_name variable can now be used. Task-number: QTBUG-14280 Reviewed-by: Janne Anttila --- doc/src/development/qmake-manual.qdoc | 7 +++++++ doc/src/snippets/code/doc_src_qmake-manual.qdoc | 4 ++++ qmake/generators/symbian/symbiancommon.cpp | 21 ++++++++++++++------- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index fe2e82a..588a9cc 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1482,6 +1482,13 @@ Additionally, some tools such as Runonphone may not work properly with sis packages that automatically run the application upon install. + On the Symbian platform, the default package name and the default name that + appears in application menu is derived from the \c TARGET variable. + Often the default is not optimal for displaying to end user. To set a better + display name for these purposes, use \c{DEPLOYMENT.display_name} variable: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 156 + On the Symbian platform, you can use \c{DEPLOYMENT.installer_header} variable to generate smart installer wrapper for your application. If you specify just UID of the installer package as the value, then diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index a5bc1f3..4f74e9c 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -1025,3 +1025,7 @@ dep_note.sources = install_note.txt dep_note.flags = FILETEXT TEXTEXIT DEPLOYMENT += dep_note //! [155] + +//! [156] +DEPLOYMENT.display_name = My Qt App +//! [156] diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 5e8bc4a..0938b58 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -320,7 +320,9 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB // Package header QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; - QString visualTarget = generator->escapeFilePath(project->first("TARGET")); + QString visualTarget = project->values("DEPLOYMENT.display_name").join(" "); + if (visualTarget.isEmpty()) + visualTarget = generator->escapeFilePath(project->first("TARGET")); visualTarget = removePathSeparators(visualTarget); QString wrapperTarget = visualTarget + " installer"; @@ -641,6 +643,11 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes) if (ft.open(QIODevice::WriteOnly)) { generatedFiles << ft.fileName(); QTextStream t(&ft); + + QString displayName = generator->project->values("DEPLOYMENT.display_name").join(" "); + if (displayName.isEmpty()) + displayName = generator->escapeFilePath(generator->project->first("TARGET")); + t << "// ============================================================================" << endl; t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: "; t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl; @@ -649,16 +656,16 @@ void SymbianCommonGenerator::writeLocFile(QStringList &symbianLangCodes) t << "// ============================================================================" << endl; t << endl; t << "#ifdef LANGUAGE_SC" << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl; + t << "#define STRING_r_caption \"" << displayName << "\"" << endl; foreach(QString lang, symbianLangCodes) { t << "#elif defined LANGUAGE_" << lang << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl; + t << "#define STRING_r_caption \"" << displayName << "\"" << endl; } t << "#else" << endl; - t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl; - t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl; + t << "#define STRING_r_short_caption \"" << displayName << "\"" << endl; + t << "#define STRING_r_caption \"" << displayName << "\"" << endl; t << "#endif" << endl; } else { PRINT_FILE_CREATE_ERROR(filename); -- cgit v0.12 From a3c755e358596238dc7fc1c284328a6226c2ed3a Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 7 Oct 2010 12:41:03 +0300 Subject: Removed the need for S60main.rsc resource file in Symbian. Qt upgrade was failing since the s60main.rsc is being locked by S60 application framework. And when installer detects that old version of Qt has already been installed it first tries to uninstall the old one and then install the new one. The uninstallion failed since the file was locked by the running Qt application. It should be noted that this patch fixes the Qt upgradibility only for Qt versions where patch is included. I.e. the versions before 4.7.2 need a different mechanism to be upgradable. This different mechanism is based on partial upgrade SIS packages as described in QT-4052. Task-number: QT-3471 Reviewed-by: Axis --- src/gui/kernel/qt_s60_p.h | 9 ++++++++- src/gui/kernel/qwidget_s60.cpp | 25 ++++++++++++++++++++++--- src/gui/s60framework/qs60mainapplication.cpp | 5 ----- src/gui/s60framework/qs60mainappui.cpp | 28 ++++++++++++++-------------- src/gui/s60framework/s60framework.pri | 18 ------------------ src/s60installs/s60installs.pro | 17 ++++------------- src/s60main/s60main.rsg | 3 --- 7 files changed, 48 insertions(+), 57 deletions(-) delete mode 100644 src/s60main/s60main.rsg diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 7fd2baa..93f64f6 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -142,6 +142,7 @@ public: int avkonComponentsSupportTransparency : 1; int menuBeingConstructed : 1; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type + static CEikButtonGroupContainer *cba; enum ScanCodeState { Unpressed, @@ -162,6 +163,7 @@ public: static inline CAknTitlePane* titlePane(); static inline CAknContextPane* contextPane(); static inline CEikButtonGroupContainer* buttonGroupContainer(); + static inline void setButtonGroupContainer(CEikButtonGroupContainer* newCba); static void setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible); #endif static void controlVisibilityChanged(CCoeControl *control, bool visible); @@ -383,7 +385,12 @@ inline CAknContextPane* QS60Data::contextPane() inline CEikButtonGroupContainer* QS60Data::buttonGroupContainer() { - return CEikonEnv::Static()->AppUiFactory()->Cba(); + return QS60Data::cba; +} + +inline void QS60Data::setButtonGroupContainer(CEikButtonGroupContainer *newCba) +{ + QS60Data::cba = newCba; } #endif // Q_WS_S60 diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 4109ed8..49d2ffc 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -69,6 +69,7 @@ extern bool qt_nograb(); QWidget *QWidgetPrivate::mouseGrabber = 0; QWidget *QWidgetPrivate::keyboardGrabber = 0; +CEikButtonGroupContainer *QS60Data::cba = 0; static bool isEqual(const QList& a, const QList& b) { @@ -494,9 +495,27 @@ void QWidgetPrivate::show_sys() // Create the status pane and CBA here CEikAppUi *ui = static_cast(S60->appUi()); MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory(); - TRAP_IGNORE(factory->ReadAppInfoResourceL(0, ui)); - if (S60->buttonGroupContainer()) - S60->buttonGroupContainer()->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + + QT_TRAP_THROWING( + factory->CreateResourceIndependentFurnitureL(ui); + + TRect boundingRect = static_cast(S60->appUi())->ClientRect(); + + CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba, + CEikButtonGroupContainer::EHorizontal,ui,R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + + CEikButtonGroupContainer *oldCba = CEikonEnv::Static()->AppUiFactory()->SwapButtonGroup(cba); + Q_ASSERT(!oldCba); + S60->setButtonGroupContainer(cba); + + CEikMenuBar *menuBar = new(ELeave) CEikMenuBar; + menuBar->ConstructL(ui, 0, R_AVKON_MENUPANE_EMPTY); + menuBar->SetMenuType(CEikMenuBar::EMenuOptions); + S60->appUi()->AddToStackL(menuBar,ECoeStackPriorityMenu,ECoeStackFlagRefusesFocus); + + CEikMenuBar *oldMenu = CEikonEnv::Static()->AppUiFactory()->SwapMenuBar(menuBar); + Q_ASSERT(!oldMenu); + ) if (S60->statusPane()) { // Use QDesktopWidget as the status pane observer to proxy for the AppUi. diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp index 5d4c54e..74432af 100644 --- a/src/gui/s60framework/qs60mainapplication.cpp +++ b/src/gui/s60framework/qs60mainapplication.cpp @@ -58,7 +58,6 @@ CApaApplication *newS60Application() return new QS60MainApplication; } -_LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main" QT_LIBINFIX_UNICODE L".rsc"); /*! \class QS60MainApplication @@ -129,10 +128,6 @@ TUid QS60MainApplication::AppDllUid() const */ TFileName QS60MainApplication::ResourceFileName() const { - TFindFile finder(iCoeEnv->FsSession()); - TInt err = finder.FindByDir(KQtWrapperResourceFile, KNullDesC); - if (err == KErrNone) - return finder.File(); return KNullDesC(); } diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp index ea9dbb3..92b3b55 100644 --- a/src/gui/s60framework/qs60mainappui.cpp +++ b/src/gui/s60framework/qs60mainappui.cpp @@ -50,16 +50,6 @@ #endif #include #include -#ifdef Q_WS_S60 -# if defined(QT_LIBINFIX_UNQUOTED) -// Two level macro needed for proper expansion of libinfix -# define QT_S60MAIN_RSG_2(x) -# define QT_S60MAIN_RSG(x) QT_S60MAIN_RSG_2(x) -# include QT_S60MAIN_RSG(QT_LIBINFIX_UNQUOTED) -# else -# include -# endif -#endif #include "qs60mainappui.h" #include @@ -125,8 +115,8 @@ void QS60MainAppUi::ConstructL() #ifdef Q_WS_S60 flags |= CAknAppUi::EAknEnableSkin; // After 5th Edition S60, native side supports animated wallpapers. - // However, there is no support for that feature on Qt side, so indicate to - // native UI framework that this application will not support background animations. + // However, there is no support for that feature on Qt side, so indicate to + // native UI framework that this application will not support background animations. if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) flags |= KAknDisableAnimationBackground; #endif @@ -244,7 +234,7 @@ void QS60MainAppUi::DynInitMenuBarL(TInt /* resourceId */, CEikMenuBar * /* menu void QS60MainAppUi::DynInitMenuPaneL(TInt resourceId, CEikMenuPane *menuPane) { #ifdef Q_WS_S60 - if (resourceId == R_QT_WRAPPERAPP_MENU) { + if (resourceId == R_AVKON_MENUPANE_EMPTY) { if (menuPane->NumberOfItemsInPane() <= 1) QT_TRYCATCH_LEAVING(qt_symbian_show_toplevel(menuPane)); @@ -274,7 +264,17 @@ void QS60MainAppUi::RestoreMenuL(CCoeControl *menuWindow, TInt resourceId, TMenu DynInitMenuPaneL(resourceId, (CEikMenuPane*)menuWindow); else DynInitMenuBarL(resourceId, (CEikMenuBar*)menuWindow); - } else + } else if(resourceId == R_AVKON_MENUPANE_EMPTY) { + CEikMenuBarTitle *title = new(ELeave) CEikMenuBarTitle; + CleanupStack::PushL(title); + + title->iData.iMenuPaneResourceId = R_AVKON_MENUPANE_EMPTY; + title->iTitleFlags = 0; + + S60->menuBar()->TitleArray()->AddTitleL(title); + CleanupStack::Pop( title ); + } + else #endif { QS60MainAppUiBase::RestoreMenuL(menuWindow, resourceId, menuType); diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri index edbacc0..19525b7 100644 --- a/src/gui/s60framework/s60framework.pri +++ b/src/gui/s60framework/s60framework.pri @@ -1,21 +1,3 @@ -contains(QT_CONFIG, s60) { -# This block serves the minimalistic resource file for S60 3.1 platforms. -# Note there is no way to ifdef S60 version in mmp file, that is why the resource -# file is always compiled for WINSCW - - minimalAppResource31 = \ - "SOURCEPATH s60framework" \ - "START RESOURCE s60main.rss" \ - "TARGET s60main$${QT_LIBINFIX}" \ - "HEADER" \ - "TARGETPATH /resource/apps" \ - "END" - - MMP_RULES += minimalAppResource31 - - SYMBIAN_RESOURCES += s60framework/s60main.rss -} - SOURCES += s60framework/qs60mainapplication.cpp \ s60framework/qs60mainappui.cpp \ s60framework/qs60maindocument.cpp diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 1f622c0..c73ed06 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -11,10 +11,10 @@ symbian: { isEmpty(QT_LIBINFIX) { TARGET.UID3 = 0x2001E61C - + # Sqlite3 is expected to be already found on phone if infixed configuration is built. # It is also expected that devices newer than those based on S60 5.0 all have sqlite3.dll. - contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { BLD_INF_RULES.prj_exports += \ "sqlite3.sis /epoc32/data/qt/sis/sqlite3.sis" \ "sqlite3_selfsigned.sis /epoc32/data/qt/sis/sqlite3_selfsigned.sis" @@ -35,15 +35,6 @@ symbian: { } VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} - symbian-abld|symbian-sbsv2 { - qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main$${QT_LIBINFIX}.rsc - } else { - qtresources.sources = $$QMAKE_LIBDIR_QT/s60main$${QT_LIBINFIX}.rsc - DESTDIR = $$QMAKE_LIBDIR_QT - } - qtresources.path = c:$$APP_RESOURCE_DIR - DEPLOYMENT += qtresources - qtlibraries.sources = \ $$QMAKE_LIBDIR_QT/QtCore$${QT_LIBINFIX}.dll \ $$QMAKE_LIBDIR_QT/QtXml$${QT_LIBINFIX}.dll \ @@ -109,9 +100,9 @@ symbian: { qtlibraries.pkg_prerules = vendorinfo qtlibraries.pkg_prerules += "; Dependencies of Qt libraries" - + # It is expected that Symbian^3 and newer phones will have sufficiently new OpenC already installed - contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { qtlibraries.pkg_prerules += "(0x20013851), 1, 5, 1, {\"PIPS Installer\"}" contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { qtlibraries.pkg_prerules += "(0x200110CB), 1, 5, 1, {\"Open C LIBSSL Common\"}" diff --git a/src/s60main/s60main.rsg b/src/s60main/s60main.rsg deleted file mode 100644 index 8cdf3ba..0000000 --- a/src/s60main/s60main.rsg +++ /dev/null @@ -1,3 +0,0 @@ -#define R_DEFAULT_DOCUMENT_NAME 0x55567002 -#define R_QT_WRAPPERAPP_MENUBAR 0x55567004 -#define R_QT_WRAPPERAPP_MENU 0x55567005 -- cgit v0.12 From d0f8bfe36e1375ec2628c6bf7fed213cb8d07f1a Mon Sep 17 00:00:00 2001 From: Adrian Constantin Date: Tue, 5 Oct 2010 21:31:27 +0300 Subject: Fix the icd auto config test after restructuring the icd plugin dependencies * Remove the auto config tests related to libicd-network-wlan-dev * Add test for the icd backend * Add test for connsettings See also f532d8fcd236be9933e4186a95561e1c264de277. Reviewed-by: Aaron McCarthy --- config.tests/unix/icd/icd.cpp | 8 +++++++- configure | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config.tests/unix/icd/icd.cpp b/config.tests/unix/icd/icd.cpp index 19c171b..08ef115 100644 --- a/config.tests/unix/icd/icd.cpp +++ b/config.tests/unix/icd/icd.cpp @@ -39,9 +39,15 @@ ** ****************************************************************************/ -#include #include + #include +#include + +#include +#include + +#include int main(int, char **) { diff --git a/configure b/configure index aca3467..0152c8e 100755 --- a/configure +++ b/configure @@ -5485,8 +5485,8 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then # auto-detect icd support if [ "$CFG_GLIB" = "yes" -a "$CFG_ICD" != "no" ]; then if [ -n "$PKG_CONFIG" ]; then - QT_CFLAGS_CONNSETTINGS=`$PKG_CONFIG --cflags connsettings 2>/dev/null` - QT_LIBS_CONNSETTINGS=`$PKG_CONFIG --libs connsettings 2>/dev/null` + QT_CFLAGS_CONNSETTINGS=`$PKG_CONFIG --cflags connsettings icd2 2>/dev/null` + QT_LIBS_CONNSETTINGS=`$PKG_CONFIG --libs connsettings icd2 2>/dev/null` fi if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/icd "ICD" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_CONNSETTINGS $QT_LIBS_CONNSETTINGS; then [ "$CFG_ICD" = "auto" ] && CFG_ICD=yes -- cgit v0.12 From 7f875312dcc09a4b2dcc5030e813e921b1dc7ee4 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 7 Oct 2010 15:52:27 +0200 Subject: Fix crash when using Q_GLOBAL_STATIC(QWidget...) If Q_GLOBAL_STATIC is used with a QWidget (or subclass) then the destructor of QWidget will be executed after the destructor of QApplication. Since ~QApplication() destroys the S60 environment and the trap handler, we need to be sure that if QApplication is destroyed, we do not attempt to use anything from the S60 environment. This includes RWsSession and the trap handler. The fix is to avoid flushing the WSERV buffer if QApplication has been deleted already. Reviewed-by: axis --- src/gui/kernel/qwidget_s60.cpp | 3 ++- tests/auto/qapplication/tst_qapplication.cpp | 40 ++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 49d2ffc..9a451ce 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1252,7 +1252,8 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) // At this point the backing store should already be destroyed // so we flush the command buffer to ensure that the freeing of // those resources and deleting the window can happen "atomically" - S60->wsSession().Flush(); + if (qApp) + S60->wsSession().Flush(); } } diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index 91ae921..a198d7f 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -147,6 +147,10 @@ private slots: void symbianNeedForTraps(); void symbianLeaveThroughMain(); void qtbug_12673(); + + + + void globalStaticObjectDestruction(); // run this last }; class EventSpy : public QObject @@ -2257,6 +2261,42 @@ void tst_QApplication::qtbug_12673() #endif // Q_OS_SYMBIAN } +/* + This test is meant to ensure that certain objects (public & commonly used) + can safely be used in a Q_GLOBAL_STATIC such that their destructors are + executed *after* the destruction of QApplication. + */ +Q_GLOBAL_STATIC(QLocale, tst_qapp_locale); +Q_GLOBAL_STATIC(QProcess, tst_qapp_process); +Q_GLOBAL_STATIC(QFileSystemWatcher, tst_qapp_fileSystemWatcher); +Q_GLOBAL_STATIC(QSharedMemory, tst_qapp_sharedMemory); +Q_GLOBAL_STATIC(QElapsedTimer, tst_qapp_elapsedTimer); +Q_GLOBAL_STATIC(QMutex, tst_qapp_mutex); +Q_GLOBAL_STATIC(QWidget, tst_qapp_widget); +Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap); +Q_GLOBAL_STATIC(QFont, tst_qapp_font); +Q_GLOBAL_STATIC(QRegion, tst_qapp_region); +Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase); +Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor); + +void tst_QApplication::globalStaticObjectDestruction() +{ + int argc = 1; + QApplication app(argc, &argv0, QApplication::GuiServer); + QVERIFY(tst_qapp_locale()); + QVERIFY(tst_qapp_process()); + QVERIFY(tst_qapp_fileSystemWatcher()); + QVERIFY(tst_qapp_sharedMemory()); + QVERIFY(tst_qapp_elapsedTimer()); + QVERIFY(tst_qapp_mutex()); + QVERIFY(tst_qapp_widget()); + QVERIFY(tst_qapp_pixmap()); + QVERIFY(tst_qapp_font()); + QVERIFY(tst_qapp_region()); + QVERIFY(tst_qapp_fontDatabase()); + QVERIFY(tst_qapp_cursor()); +} + //QTEST_APPLESS_MAIN(tst_QApplication) int main(int argc, char *argv[]) { -- cgit v0.12 From 91efdcaed6fe9e931b049460d9a177a4c4e5ac3e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 7 Oct 2010 16:12:39 +0200 Subject: Merge faba550d704312a29d9485bcaaa506331f102301 from 4.7 to master. The file had been renamed so git did not merge it properly --- src/corelib/arch/qatomic_armv5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/arch/qatomic_armv5.h b/src/corelib/arch/qatomic_armv5.h index ab48380..f0f2f9a 100644 --- a/src/corelib/arch/qatomic_armv5.h +++ b/src/corelib/arch/qatomic_armv5.h @@ -107,7 +107,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() // kernel places a restartable cmpxchg implementation at a fixed address extern "C" typedef int (qt_atomic_eabi_cmpxchg_int_t)(int oldval, int newval, volatile int *ptr); -extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(void *oldval, void *newval, volatile void *ptr); +extern "C" typedef int (qt_atomic_eabi_cmpxchg_ptr_t)(const void *oldval, void *newval, volatile void *ptr); #define qt_atomic_eabi_cmpxchg_int (*reinterpret_cast(0xffff0fc0)) #define qt_atomic_eabi_cmpxchg_ptr (*reinterpret_cast(0xffff0fc0)) -- cgit v0.12 From e7db6cd0bddb7203c5460e97e2b8164bbaf420b8 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 7 Oct 2010 18:51:49 +0200 Subject: Live texture updates to meegographicssystem plugin. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 848 Reviewed-by: Samuel Rødal --- src/gui/image/qpixmap_x11_p.h | 1 + .../graphicssystems/meego/qmeegoextensions.cpp | 32 ++++ .../graphicssystems/meego/qmeegoextensions.h | 15 ++ .../graphicssystems/meego/qmeegographicssystem.cpp | 203 +++++++++++++++++++++ .../graphicssystems/meego/qmeegographicssystem.h | 21 +++ .../graphicssystems/meego/qmeegopixmapdata.cpp | 30 +++ .../graphicssystems/meego/qmeegopixmapdata.h | 1 + 7 files changed, 303 insertions(+) diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index 821fb69..f171281 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -115,6 +115,7 @@ private: friend class QEglContext; // Needs gl_surface friend class QGLContext; // Needs gl_surface friend class QX11GLPixmapData; // Needs gl_surface + friend class QMeeGoGraphicsSystem; // Needs gl_surface and flags friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface void release(); diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp index e7f6439..611c962 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.cpp +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.cpp @@ -46,6 +46,7 @@ bool QMeeGoExtensions::initialized = false; bool QMeeGoExtensions::hasImageShared = false; bool QMeeGoExtensions::hasSurfaceScaling = false; +bool QMeeGoExtensions::hasLockSurface = false; /* Extension funcs */ @@ -53,11 +54,15 @@ typedef EGLBoolean (EGLAPIENTRY *eglQueryImageNOKFunc)(EGLDisplay, EGLImageKHR, typedef EGLNativeSharedImageTypeNOK (EGLAPIENTRY *eglCreateSharedImageNOKFunc)(EGLDisplay, EGLImageKHR, EGLint*); typedef EGLBoolean (EGLAPIENTRY *eglDestroySharedImageNOKFunc)(EGLDisplay, EGLNativeSharedImageTypeNOK); typedef EGLBoolean (EGLAPIENTRY *eglSetSurfaceScalingNOKFunc)(EGLDisplay, EGLSurface, EGLint, EGLint, EGLint, EGLint); +typedef EGLBoolean (EGLAPIENTRY *eglLockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRY *eglUnlockSurfaceKHRFunc)(EGLDisplay display, EGLSurface surface); static eglQueryImageNOKFunc _eglQueryImageNOK = 0; static eglCreateSharedImageNOKFunc _eglCreateSharedImageNOK = 0; static eglDestroySharedImageNOKFunc _eglDestroySharedImageNOK = 0; static eglSetSurfaceScalingNOKFunc _eglSetSurfaceScalingNOK = 0; +static eglLockSurfaceKHRFunc _eglLockSurfaceKHR = 0; +static eglUnlockSurfaceKHRFunc _eglUnlockSurfaceKHR = 0; /* Public */ @@ -101,6 +106,22 @@ bool QMeeGoExtensions::eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surfac return _eglSetSurfaceScalingNOK(dpy, surface, x, y, width, height); } +bool QMeeGoExtensions::eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list) +{ + if (! hasLockSurface) + qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!"); + + return _eglLockSurfaceKHR(display, surface, attrib_list); +} + +bool QMeeGoExtensions::eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface) +{ + if (! hasLockSurface) + qFatal("EGL_KHR_lock_surface2 not found but trying to use capability!"); + + return _eglUnlockSurfaceKHR(display, surface); +} + /* Private */ void QMeeGoExtensions::initialize() @@ -113,6 +134,8 @@ void QMeeGoExtensions::initialize() _eglQueryImageNOK = (eglQueryImageNOKFunc) eglGetProcAddress("eglQueryImageNOK"); _eglCreateSharedImageNOK = (eglCreateSharedImageNOKFunc) eglGetProcAddress("eglCreateSharedImageNOK"); _eglDestroySharedImageNOK = (eglDestroySharedImageNOKFunc) eglGetProcAddress("eglDestroySharedImageNOK"); + _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR"); + _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR"); Q_ASSERT(_eglQueryImageNOK && _eglCreateSharedImageNOK && _eglDestroySharedImageNOK); hasImageShared = true; @@ -125,5 +148,14 @@ void QMeeGoExtensions::initialize() Q_ASSERT(_eglSetSurfaceScalingNOK); hasSurfaceScaling = true; } + + if (QEgl::hasExtension("EGL_KHR_lock_surface2")) { + qDebug("MeegoGraphics: found EGL_KHR_lock_surface2"); + _eglLockSurfaceKHR = (eglLockSurfaceKHRFunc) eglGetProcAddress("eglLockSurfaceKHR"); + _eglUnlockSurfaceKHR = (eglUnlockSurfaceKHRFunc) eglGetProcAddress("eglUnlockSurfaceKHR"); + + Q_ASSERT(_eglLockSurfaceKHR && _eglUnlockSurfaceKHR); + hasLockSurface = true; + } } diff --git a/src/plugins/graphicssystems/meego/qmeegoextensions.h b/src/plugins/graphicssystems/meego/qmeegoextensions.h index ee20bd8..9e78caf 100644 --- a/src/plugins/graphicssystems/meego/qmeegoextensions.h +++ b/src/plugins/graphicssystems/meego/qmeegoextensions.h @@ -65,6 +65,18 @@ typedef void* EGLNativeSharedImageTypeNOK; #define EGL_FIXED_HEIGHT_NOK 0x30DC #endif +#ifndef EGL_BITMAP_POINTER_KHR +#define EGL_BITMAP_POINTER_KHR 0x30C6 +#define EGL_BITMAP_PITCH_KHR 0x30C7 +#endif + +#ifndef EGL_MAP_PRESERVE_PIXELS_KHR +#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 +#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 +#define EGL_READ_SURFACE_BIT_KHR 0x0001 +#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 +#endif + /* Class */ class QMeeGoExtensions @@ -76,6 +88,8 @@ public: static bool eglQueryImageNOK(EGLDisplay dpy, EGLImageKHR image, EGLint prop, EGLint *v); static bool eglDestroySharedImageNOK(EGLDisplay dpy, EGLNativeSharedImageTypeNOK img); static bool eglSetSurfaceScalingNOK(EGLDisplay dpy, EGLSurface surface, int x, int y, int width, int height); + static bool eglLockSurfaceKHR(EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); + static bool eglUnlockSurfaceKHR(EGLDisplay display, EGLSurface surface); private: static void initialize(); @@ -83,6 +97,7 @@ private: static bool initialized; static bool hasImageShared; static bool hasSurfaceScaling; + static bool hasLockSurface; }; #endif diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 2a64d49..f8b228c 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include "qmeegopixmapdata.h" #include "qmeegographicssystem.h" @@ -58,6 +59,8 @@ bool QMeeGoGraphicsSystem::surfaceWasCreated = false; +QHash QMeeGoGraphicsSystem::liveTexturePixmaps; + QMeeGoGraphicsSystem::QMeeGoGraphicsSystem() { qDebug("Using the meego graphics system"); @@ -170,6 +173,22 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(Qt::HANDLE handl } } +QPixmapData *QMeeGoGraphicsSystem::pixmapDataFromEGLImage(Qt::HANDLE handle) +{ + if (QMeeGoGraphicsSystem::meeGoRunning()) { + QMeeGoPixmapData *pmd = new QMeeGoPixmapData; + pmd->fromEGLImage(handle); + + // FIXME Ok. This is a bit BAD BAD BAD. We're abusing here the fact that we KNOW + // that this function is used for the live pixmap... + pmd->texture()->options &= ~QGLContext::InvertedYBindOption; + return QMeeGoGraphicsSystem::wrapPixmapData(pmd); + } else { + qFatal("Can't create from EGL image when not running meego graphics system!"); + return NULL; + } +} + void QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(QPixmap *pixmap) { QMeeGoPixmapData *pmd = (QMeeGoPixmapData *) pixmap->pixmapData(); @@ -188,6 +207,109 @@ QPixmapData *QMeeGoGraphicsSystem::pixmapDataWithGLTexture(int w, int h) return QMeeGoGraphicsSystem::wrapPixmapData(pmd); } +Qt::HANDLE QMeeGoGraphicsSystem::createLiveTexture(int w, int h, QImage::Format format) +{ + // No need to wrap the QPixmapData here. This QPixmap(Data) is a + // internal implementation and we don't migrate it between + // graphics system switching. + + // We use a bit ugly way of enforcing a color format on the X pixmap -- we create + // a local QImage and fromImage from there. This is quite redundant (extra overhead of creating + // the useless image only to delete it) but shouldn't be too bad for now... you're not expected + // to call createLiveTexture too often anyways. Would be great if QX11PixmapData had a way to + // force the X format upon creation or resize. + + QImage image(w, h, format); + QX11PixmapData *pmd = new QX11PixmapData(QPixmapData::PixmapType); + pmd->fromImage(image, Qt::NoOpaqueDetection); + QPixmap *p = new QPixmap(pmd); + + liveTexturePixmaps.insert(p->handle(), p); + return p->handle(); +} + +void QMeeGoGraphicsSystem::destroyLiveTexture(Qt::HANDLE h) +{ + if (liveTexturePixmaps.contains(h)) { + QPixmap *p = liveTexturePixmaps.value(h); + delete p; + liveTexturePixmaps.remove(h); + } else + qWarning("Trying to destroy live texture %ld which was not found!", h); +} + +bool QMeeGoGraphicsSystem::lockLiveTexture(Qt::HANDLE h) +{ + if (! liveTexturePixmaps.contains(h)) { + qWarning("Trying to lock live texture %ld which was not found!", h); + return false; + } + + EGLint attribs[] = { + EGL_MAP_PRESERVE_PIXELS_KHR, EGL_TRUE, + EGL_LOCK_USAGE_HINT_KHR, EGL_READ_SURFACE_BIT_KHR | EGL_WRITE_SURFACE_BIT_KHR, + EGL_NONE + }; + + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + EGLSurface surface = getSurfaceForLiveTexturePixmap(liveTexturePixmaps.value(h)); + return QMeeGoExtensions::eglLockSurfaceKHR(QEgl::display(), surface, attribs); +} + +bool QMeeGoGraphicsSystem::unlockLiveTexture(Qt::HANDLE h) +{ + if (! liveTexturePixmaps.contains(h)) { + qWarning("Trying to lock live texture %ld which was not found!", h); + return false; + } + + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoExtensions::ensureInitialized(); + + EGLSurface surface = getSurfaceForLiveTexturePixmap(liveTexturePixmaps.value(h)); + if (QMeeGoExtensions::eglUnlockSurfaceKHR(QEgl::display(), surface)) { + glFinish(); + return true; + } else { + return false; + } +} + +void QMeeGoGraphicsSystem::queryLiveTexture(Qt::HANDLE h, void **data, int *pitch) +{ + // FIXME Only allow this on locked surfaces + if (! liveTexturePixmaps.contains(h)) { + qWarning("Trying to query live texture %ld which was not found!", h); + return; + } + + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoExtensions::ensureInitialized(); + + EGLSurface surface = getSurfaceForLiveTexturePixmap(liveTexturePixmaps.value(h)); + eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_POINTER_KHR, (EGLint*) data); + eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_PITCH_KHR, (EGLint*) pitch); +} + +Qt::HANDLE QMeeGoGraphicsSystem::liveTextureToEGLImage(Qt::HANDLE h) +{ + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoExtensions::ensureInitialized(); + + EGLint attribs[] = { + EGL_IMAGE_PRESERVED_KHR, EGL_TRUE, + EGL_NONE + }; + + EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, + (EGLClientBuffer) h, attribs); + + if (eglImage == EGL_NO_IMAGE_KHR) + qWarning("eglCreateImageKHR failed!"); + + return (Qt::HANDLE) eglImage; +} + bool QMeeGoGraphicsSystem::meeGoRunning() { if (! QApplicationPrivate::instance()) { @@ -204,6 +326,52 @@ bool QMeeGoGraphicsSystem::meeGoRunning() return (name == "meego"); } +void QMeeGoGraphicsSystem::destroySurfaceForLiveTexturePixmap(QPixmapData* pmd) +{ + Q_ASSERT(pmd->classId() == QPixmapData::X11Class); + QX11PixmapData *pixmapData = static_cast(pmd); + if (pixmapData->gl_surface) { + eglDestroySurface(QEgl::display(), (EGLSurface)pixmapData->gl_surface); + pixmapData->gl_surface = 0; + } +} + +EGLSurface QMeeGoGraphicsSystem::getSurfaceForLiveTexturePixmap(QPixmap *pixmap) +{ + // This code is a crative remix of the stuff that can be found in the + // Qt's TFP implementation in /src/opengl/qgl_x11egl.cpp ::bindiTextureFromNativePixmap + QX11PixmapData *pixmapData = static_cast(pixmap->data_ptr().data()); + Q_ASSERT(pixmapData->classId() == QPixmapData::X11Class); + bool hasAlpha = pixmapData->hasAlphaChannel(); + + if (pixmapData->gl_surface && + hasAlpha == (pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha)) + return pixmapData->gl_surface; + + // Check to see if the surface is still valid + if (pixmapData->gl_surface && + hasAlpha != ((pixmapData->flags & QX11PixmapData::GlSurfaceCreatedWithAlpha) > 0)) { + // Surface is invalid! + QMeeGoGraphicsSystem::destroySurfaceForLiveTexturePixmap(pixmapData); + } + + if (pixmapData->gl_surface == 0) { + EGLConfig config = QEgl::defaultConfig(QInternal::Pixmap, + QEgl::OpenGL, + hasAlpha ? QEgl::Translucent : QEgl::NoOptions); + + pixmapData->gl_surface = (void*)QEgl::createSurface(pixmap, config); + + if (hasAlpha) + pixmapData->flags = pixmapData->flags | QX11PixmapData::GlSurfaceCreatedWithAlpha; + + if (pixmapData->gl_surface == (void*)EGL_NO_SURFACE) + return NULL; + } + + return pixmapData->gl_surface; +} + /* C API */ int qt_meego_image_to_egl_shared_image(const QImage &image) @@ -216,6 +384,11 @@ QPixmapData* qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const return QMeeGoGraphicsSystem::pixmapDataFromEGLSharedImage(handle, softImage); } +QPixmapData* qt_meego_pixmapdata_from_egl_image(Qt::HANDLE handle) +{ + return QMeeGoGraphicsSystem::pixmapDataFromEGLImage(handle); +} + QPixmapData* qt_meego_pixmapdata_with_gl_texture(int w, int h) { return QMeeGoGraphicsSystem::pixmapDataWithGLTexture(w, h); @@ -245,3 +418,33 @@ void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap) { QMeeGoGraphicsSystem::updateEGLSharedImagePixmap(pixmap); } + +Qt::HANDLE qt_meego_live_texture_create(int w, int h, QImage::Format format) +{ + return QMeeGoGraphicsSystem::createLiveTexture(w, h, format); +} + +void qt_meego_live_texture_destroy(Qt::HANDLE h) +{ + QMeeGoGraphicsSystem::destroyLiveTexture(h); +} + +bool qt_meego_live_texture_lock(Qt::HANDLE h) +{ + return QMeeGoGraphicsSystem::lockLiveTexture(h); +} + +bool qt_meego_live_texture_unlock(Qt::HANDLE h) +{ + return QMeeGoGraphicsSystem::unlockLiveTexture(h); +} + +void qt_meego_live_texture_query(Qt::HANDLE h, void **data, int *pitch) +{ + return QMeeGoGraphicsSystem::queryLiveTexture(h, data, pitch); +} + +Qt::HANDLE qt_meego_live_texture_to_egl_image(Qt::HANDLE h) +{ + return QMeeGoGraphicsSystem::liveTextureToEGLImage(h); +} diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.h b/src/plugins/graphicssystems/meego/qmeegographicssystem.h index 905f0c3..934d32d 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.h +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.h @@ -43,6 +43,9 @@ #define MGRAPHICSSYSTEM_H #include +#include +#include +#include class QMeeGoGraphicsSystem : public QGraphicsSystem { @@ -60,13 +63,24 @@ public: static void setTranslucent(bool translucent); static QPixmapData *pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage); + static QPixmapData *pixmapDataFromEGLImage(Qt::HANDLE handle); static QPixmapData *pixmapDataWithGLTexture(int w, int h); static void updateEGLSharedImagePixmap(QPixmap *pixmap); + static Qt::HANDLE createLiveTexture(int w, int h, QImage::Format format); + static void destroyLiveTexture(Qt::HANDLE h); + static bool lockLiveTexture(Qt::HANDLE h); + static bool unlockLiveTexture(Qt::HANDLE h); + static void queryLiveTexture(Qt::HANDLE h, void **data, int *pitch); + static Qt::HANDLE liveTextureToEGLImage(Qt::HANDLE h); + private: static bool meeGoRunning(); + static EGLSurface getSurfaceForLiveTexturePixmap(QPixmap *pixmap); + static void destroySurfaceForLiveTexturePixmap(QPixmapData* pmd); static bool surfaceWasCreated; + static QHash liveTexturePixmaps; }; /* C api */ @@ -74,12 +88,19 @@ private: extern "C" { Q_DECL_EXPORT int qt_meego_image_to_egl_shared_image(const QImage &image); Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_from_egl_shared_image(Qt::HANDLE handle, const QImage &softImage); + Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_from_egl_image(Qt::HANDLE handle); Q_DECL_EXPORT QPixmapData* qt_meego_pixmapdata_with_gl_texture(int w, int h); Q_DECL_EXPORT void qt_meego_update_egl_shared_image_pixmap(QPixmap *pixmap); Q_DECL_EXPORT bool qt_meego_destroy_egl_shared_image(Qt::HANDLE handle); Q_DECL_EXPORT void qt_meego_set_surface_fixed_size(int width, int height); Q_DECL_EXPORT void qt_meego_set_surface_scaling(int x, int y, int width, int height); Q_DECL_EXPORT void qt_meego_set_translucent(bool translucent); + Q_DECL_EXPORT Qt::HANDLE m_live_texture_create(int w, int h, QImage::Format format); + Q_DECL_EXPORT void m_live_texture_destroy(Qt::HANDLE h); + Q_DECL_EXPORT bool m_live_texture_lock(Qt::HANDLE h); + Q_DECL_EXPORT bool m_live_texture_unlock(Qt::HANDLE h); + Q_DECL_EXPORT void m_live_texture_query(Qt::HANDLE h, void **data, int *pitch); + Q_DECL_EXPORT Qt::HANDLE m_live_texture_to_egl_image(Qt::HANDLE h); } #endif diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp index 33611dc..84fc593 100644 --- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp +++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp @@ -87,6 +87,36 @@ void QMeeGoPixmapData::fromImage(const QImage &image, } } +void QMeeGoPixmapData::fromEGLImage(Qt::HANDLE handle) +{ + QGLShareContextScope ctx(qt_gl_share_widget()->context()); + QMeeGoExtensions::ensureInitialized(); + + bool textureIsBound = false; + GLuint newTextureId; + GLint newWidth, newHeight; + + glGenTextures(1, &newTextureId); + glBindTexture(GL_TEXTURE_2D, newTextureId); + + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (EGLImageKHR) handle); + GLint err = glGetError(); + if (err == GL_NO_ERROR) + textureIsBound = true; + + QMeeGoExtensions::eglQueryImageNOK(QEgl::display(), (EGLImageKHR) handle, EGL_WIDTH, &newWidth); + QMeeGoExtensions::eglQueryImageNOK(QEgl::display(), (EGLImageKHR) handle, EGL_HEIGHT, &newHeight); + + if (textureIsBound) { + // FIXME Remove this ugly hasAlphaChannel check when Qt lands the NoOpaqueCheck flag fix + // for QGLPixmapData. + fromTexture(newTextureId, newWidth, newHeight, true); + } else { + qWarning("Failed to create a texture from an egl image!"); + glDeleteTextures(1, &newTextureId); + } +} + void QMeeGoPixmapData::fromEGLSharedImage(Qt::HANDLE handle, const QImage &si) { if (si.isNull()) diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.h b/src/plugins/graphicssystems/meego/qmeegopixmapdata.h index 8af33bd..8b1ae14 100644 --- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.h +++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.h @@ -56,6 +56,7 @@ public: QMeeGoPixmapData(); void fromTexture(GLuint textureId, int w, int h, bool alpha); + virtual void fromEGLImage(Qt::HANDLE handle); virtual void fromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage); virtual void fromImage (const QImage &image, Qt::ImageConversionFlags flags); virtual QImage toImage() const; -- cgit v0.12 From df61814c228e6f2badf378e25b69daf9941c646b Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Thu, 7 Oct 2010 18:51:50 +0200 Subject: Live texture updates to meegographicssystem helper. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 848 Reviewed-by: Samuel Rødal --- .../qmeegographicssystemhelper.cpp | 9 +- .../qmeegographicssystemhelper.h | 7 + .../qmeegographicssystemhelper.pro | 4 +- .../qmeegographicssystemhelper/qmeegoliveimage.cpp | 115 ---------------- tools/qmeegographicssystemhelper/qmeegoliveimage.h | 106 --------------- .../qmeegographicssystemhelper/qmeegoliveimage_p.h | 63 --------- .../qmeegolivepixmap.cpp | 150 +++++++++------------ .../qmeegographicssystemhelper/qmeegolivepixmap.h | 35 +++-- .../qmeegolivepixmap_p.h | 11 +- tools/qmeegographicssystemhelper/qmeegoruntime.cpp | 92 +++++++++++-- tools/qmeegographicssystemhelper/qmeegoruntime.h | 11 +- 11 files changed, 197 insertions(+), 406 deletions(-) delete mode 100644 tools/qmeegographicssystemhelper/qmeegoliveimage.cpp delete mode 100644 tools/qmeegographicssystemhelper/qmeegoliveimage.h delete mode 100644 tools/qmeegographicssystemhelper/qmeegoliveimage_p.h diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp index 0670ac4..d348e70 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp @@ -68,6 +68,11 @@ bool QMeeGoGraphicsSystemHelper::isRunningMeeGo() return (runningGraphicsSystemName() == QLatin1String("meego")); } +bool QMeeGoGraphicsSystemHelper::isRunningRuntime() +{ + return (QApplicationPrivate::instance()->graphics_system_name == QLatin1String("runtime")); +} + void QMeeGoGraphicsSystemHelper::switchToMeeGo() { if (isRunningMeeGo()) @@ -105,13 +110,13 @@ QPixmap QMeeGoGraphicsSystemHelper::pixmapFromEGLSharedImage(Qt::HANDLE handle, // This function is supported when not running meego too. A raster-backed // pixmap will be created... but when you switch back to 'meego', it'll // be replaced with a EGL shared image backing. - return QMeeGoRuntime::pixmapFromEGLSharedImage(handle, softImage); + return QPixmap(QMeeGoRuntime::pixmapDataFromEGLSharedImage(handle, softImage)); } QPixmap QMeeGoGraphicsSystemHelper::pixmapWithGLTexture(int w, int h) { ENSURE_RUNNING_MEEGO; - return QMeeGoRuntime::pixmapWithGLTexture(w, h); + return QPixmap(QMeeGoRuntime::pixmapDataWithGLTexture(w, h)); } bool QMeeGoGraphicsSystemHelper::destroyEGLSharedImage(Qt::HANDLE handle) diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h index 02f2fa2..2bb75eb 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h @@ -89,6 +89,13 @@ public: switching is 'meego'. */ static bool isRunningMeeGo(); + + //! Returns true if running with a 'runtime' graphicssystem. + /*! + This function can be used in combination with ::runningGraphicsSystemName to figure out + the existing situation. + */ + static bool isRunningRuntime(); //! Switches to meego graphics system. /*! diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index 1e6e233..4d69fac 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -6,5 +6,5 @@ include(../../src/qbase.pri) QT += gui INCLUDEPATH += '../../src/plugins/graphicssystems/meego' -HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoliveimage.h qmeegoruntime.h qmeegoliveimage_p.h qmeegolivepixmap_p.h -SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegoliveimage.cpp +HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h +SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp diff --git a/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp b/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp deleted file mode 100644 index 83a1e28..0000000 --- a/tools/qmeegographicssystemhelper/qmeegoliveimage.cpp +++ /dev/null @@ -1,115 +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 plugins 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 "qmeegoliveimage.h" -#include "qmeegoliveimage_p.h" -#include "qmeegolivepixmap.h" -#include "qmeegolivepixmap_p.h" - -/* QMeeGoLiveImagePrivate */ - -QMeeGoLiveImagePrivate::QMeeGoLiveImagePrivate() -{ -} - -QMeeGoLiveImagePrivate::~QMeeGoLiveImagePrivate() -{ - if (attachedPixmaps.length() > 0) - qWarning("Destroying QMeeGoLiveImage but it still has QMeeGoLivePixmaps attached!"); -} - -void QMeeGoLiveImagePrivate::attachPixmap(QMeeGoLivePixmap* pixmap) -{ - attachedPixmaps << pixmap; -} - -void QMeeGoLiveImagePrivate::detachPixmap(QMeeGoLivePixmap* pixmap) -{ - attachedPixmaps.removeAll(pixmap); -} - -/* QMeeGoLiveImage */ - -QMeeGoLiveImage* QMeeGoLiveImage::liveImageWithSize(int w, int h, Format format, int buffers) -{ - if (format != Format_ARGB32_Premultiplied) { - qWarning("Only _ARGB32_Premultiplied format is supported for live images now!"); - return 0; - } - - if (buffers != 1) { - qWarning("Only single-buffer streams are supported at the moment"); - return 0; - } - - QMeeGoLiveImage *liveImage = new QMeeGoLiveImage(w, h); - return liveImage; -} - -QMeeGoLiveImage::QMeeGoLiveImage(int w, int h) : QImage(w, h, QImage::Format_ARGB32_Premultiplied), d_ptr(new QMeeGoLiveImagePrivate()) -{ - Q_D(QMeeGoLiveImage); - d->q_ptr = this; -} - -QMeeGoLiveImage::~QMeeGoLiveImage() -{ -} - -void QMeeGoLiveImage::lock(int buffer) -{ - if (buffer != 0) - qWarning("Only locking 0 buffer is supported at the moment!"); -} - -void QMeeGoLiveImage::release(int buffer) -{ - Q_D(QMeeGoLiveImage); - - if (buffer != 0) { - qWarning("Only locking 0 buffer is supported at the moment!"); - return; - } - - // We need to copy the update image to all the client QMeeGoLivePixmap's - foreach (QMeeGoLivePixmap* livePixmap, d->attachedPixmaps) - livePixmap->d_ptr->copyBackFrom((const void *) bits()); -} diff --git a/tools/qmeegographicssystemhelper/qmeegoliveimage.h b/tools/qmeegographicssystemhelper/qmeegoliveimage.h deleted file mode 100644 index 1e21e7b..0000000 --- a/tools/qmeegographicssystemhelper/qmeegoliveimage.h +++ /dev/null @@ -1,106 +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 plugins 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 QMEEGOLIVEIMAGE_H -#define QMEEGOLIVEIMAGE_H - -#include - -class QMeeGoLivePixmap; -class QMeeGoLiveImagePrivate; - -//! A streamable QImage subclass. -/*! -*/ - -class QMeeGoLiveImage : public QImage -{ -public: - //! Format specifier. - /*! - Used to specify the format of the underlying image data for QMeeGoLiveImage. - */ - enum Format { - Format_ARGB32_Premultiplied //! 32bit, AARRGGBB format. The typical Qt format. - }; - - //! Locks the access to the image. - /*! - All drawing/access to the underlying image data needs to happen between - ::lock() and ::unlock() pairs. - */ - void lock(int buffer = 0); - - //! Unlocks the access to the image. - /*! - All drawing/access to the underlying image data needs to happen between - ::lock() and ::unlock() pairs. - */ - void release(int buffer = 0); - - //! Destroys the image. - /*! - It's a mistake to destroy an image before destroying all the QMeeGoLivePixmaps - built on top of it. You should first destroy all the QMeeGoLivePixmaps. - */ - virtual ~QMeeGoLiveImage(); - - //! Creates and returns a new live image with the given parameters. - /*! - The new image is created with the given width w and the given height h. - The format specifies the color format used by the image. Optionally, a - number of buffers can be specfied for a stream-like behavior. - */ - static QMeeGoLiveImage* liveImageWithSize(int w, int h, Format format, int buffers = 1); - -private: - QMeeGoLiveImage(int w, int h); //! Private bits. - Q_DISABLE_COPY(QMeeGoLiveImage) - Q_DECLARE_PRIVATE(QMeeGoLiveImage) - -protected: - QScopedPointer d_ptr; - - friend class QMeeGoLivePixmap; - friend class QMeeGoLivePixmapPrivate; -}; - -#endif diff --git a/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h b/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h deleted file mode 100644 index 085fed4..0000000 --- a/tools/qmeegographicssystemhelper/qmeegoliveimage_p.h +++ /dev/null @@ -1,63 +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 plugins 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 "qmeegoliveimage.h" - -#ifndef QMEEGOLIVEIMAGE_P_H -#define QMEEGOLIVEIMAGE_P_H - -class QMeeGoLiveImagePrivate -{ -public: - Q_DECLARE_PUBLIC(QMeeGoLiveImage); - QMeeGoLiveImagePrivate(); - virtual ~QMeeGoLiveImagePrivate(); - void attachPixmap(QMeeGoLivePixmap* pixmap); - void detachPixmap(QMeeGoLivePixmap* pixmap); - - QList attachedPixmaps; - QMeeGoLiveImage *q_ptr; - - friend class QMeeGoLivePixmap; - friend class QMeeGoLivePixmapPrivate; -}; - -#endif diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp index 2a1c04b..b9dbb2b 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp @@ -43,121 +43,101 @@ #include #include #include "qmeegolivepixmap_p.h" -#include "qmeegoliveimage_p.h" +#include "qmeegoruntime.h" #include /* QMeeGoLivePixmapPrivate */ -QMeeGoLivePixmapPrivate::QMeeGoLivePixmapPrivate() : shm(0), shmSerial(0), owns(true), parentImage(0) +QMeeGoLivePixmapPrivate::QMeeGoLivePixmapPrivate(Qt::HANDLE h) : handle(h) { } -void QMeeGoLivePixmapPrivate::copyBackFrom(const void *raw) +QMeeGoLivePixmapPrivate::~QMeeGoLivePixmapPrivate() { - Q_Q(QMeeGoLivePixmap); - - q->detach(); - shm->lock(); - uchar *dest = ((uchar *) shm->data()) + (2 * sizeof(int)); - memcpy(dest, raw, q->width() * q->height() * 4); - shm->unlock(); } -QMeeGoLivePixmapPrivate::~QMeeGoLivePixmapPrivate() +/* QMeeGoLivePixmap */ + +QMeeGoLivePixmap* QMeeGoLivePixmap::livePixmapWithSize(int w, int h, Format format) { - Q_Q(QMeeGoLivePixmap); + QImage::Format qtFormat; + if (format == Format_RGB16) + qtFormat = QImage::Format_RGB16; + else if (format == Format_ARGB32_Premultiplied) + qtFormat = QImage::Format_ARGB32_Premultiplied; + else { + qWarning("Unsupported live pixmap format!"); + return 0; + } - if (parentImage) - parentImage->d_ptr->detachPixmap(q); - - if (shm) - shm->detach(); - - if (owns) - delete shm; -} + Qt::HANDLE liveTextureHandle = QMeeGoRuntime::createLiveTexture(w, h, qtFormat); + if (! liveTextureHandle) { + qWarning("Failed to create a live texture with given size!"); + return NULL; + } -/* QMeeGoLivePixmap */ + return QMeeGoLivePixmap::fromHandle(liveTextureHandle); +} -QMeeGoLivePixmap::QMeeGoLivePixmap(QPixmapData *p) : QPixmap(p), d_ptr(new QMeeGoLivePixmapPrivate()) +QMeeGoLivePixmap::QMeeGoLivePixmap(QPixmapData *p, Qt::HANDLE h) : QPixmap(p), d_ptr(new QMeeGoLivePixmapPrivate(h)) { Q_D(QMeeGoLivePixmap); d->q_ptr = this; } -QMeeGoLivePixmap* QMeeGoLivePixmap::fromLiveImage(QMeeGoLiveImage *liveImage) +QMeeGoLivePixmap* QMeeGoLivePixmap::fromHandle(Qt::HANDLE liveTextureHandle) { - static int counter = 100; - QSharedMemory *shm = NULL; - uchar* imgData = NULL; - int *header = NULL; - int w = liveImage->width(); - int h = liveImage->height(); - - counter++; - shm = new QSharedMemory(QString(QLatin1String("QMeeGoLivePixmap%1")).arg(counter)); - shm->create((w * h * 4) + 2 * sizeof(int)); // +2 to store width & height - shm->attach(); - - imgData = ((uchar *) shm->data()) + (2 * sizeof(int)); - header = (int *) shm->data(); - - header[0] = w; - header[1] = h; - - QImage img(imgData, w, h, QImage::Format_ARGB32_Premultiplied); - - QPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType); - pmd->fromImage(img, Qt::NoOpaqueDetection); - - QMeeGoLivePixmap *livePixmap = new QMeeGoLivePixmap(pmd); - livePixmap->d_ptr->shm = shm; - livePixmap->d_ptr->owns = true; - livePixmap->d_ptr->shmSerial = counter; - livePixmap->d_ptr->parentImage = liveImage; - - liveImage->d_ptr->attachPixmap(livePixmap); + Qt::HANDLE eglImage = QMeeGoRuntime::liveTextureToEGLImage(liveTextureHandle); + if (! eglImage) { + qWarning("Failed to bind the live texture as an egl image!"); + return NULL; + } - return livePixmap; + QPixmapData *pmd = QMeeGoRuntime::pixmapDataFromEGLImage(eglImage); + if (! pmd) { + qWarning("Failed to allocate a pixmap data from a given live texture egl image!"); + return NULL; + } + + return new QMeeGoLivePixmap(pmd, liveTextureHandle); } -QMeeGoLivePixmap* QMeeGoLivePixmap::fromHandle(Qt::HANDLE handle) +Qt::HANDLE QMeeGoLivePixmap::handle() { - QSharedMemory *shm = NULL; - int *header; - int width; - int height; - uchar* imgData; - - shm = new QSharedMemory(QString(QLatin1String("QMeeGoLivePixmap%1")).arg(handle)); - shm->attach(); - - shm->lock(); - header = (int *) shm->data(); - width = header[0]; - height = header[1]; - shm->unlock(); - - imgData = ((uchar *) shm->data()) + (2 * sizeof(int)); - QImage img(imgData, width, height, QImage::Format_ARGB32_Premultiplied); - - QPixmapData *pmd = new QRasterPixmapData(QPixmapData::PixmapType); - pmd->fromImage(img, Qt::NoOpaqueDetection); - - QMeeGoLivePixmap *livePixmap = new QMeeGoLivePixmap(pmd); - livePixmap->d_ptr->shm = shm; - livePixmap->d_ptr->owns = false; - livePixmap->d_ptr->shmSerial = handle; - - return livePixmap; + Q_D(QMeeGoLivePixmap); + return d->handle; } QMeeGoLivePixmap::~QMeeGoLivePixmap() { } -Qt::HANDLE QMeeGoLivePixmap::handle() +QImage* QMeeGoLivePixmap::lock() +{ + Q_D(QMeeGoLivePixmap); + + void *data = NULL; + int pitch = 0; + + if (! QMeeGoRuntime::lockLiveTexture(d->handle)) { + qWarning("Failed to lock a live texture!"); + return new QImage(); + } + + QMeeGoRuntime::queryLiveTexture(d->handle, &data, &pitch); + if (data == NULL || pitch == 0) { + qWarning("Failed to query the live texture!"); + return new QImage(); + } + + // FIXME Bug here! FIX FIX FIX FIX FIX FIX + return new QImage((uchar *) data, width(), height(), QImage::Format_RGB16); +} + +void QMeeGoLivePixmap::release(QImage *img) { Q_D(QMeeGoLivePixmap); - return d->shmSerial; + // FIXME Make sure we're locked! + QMeeGoRuntime::unlockLiveTexture(d->handle); + delete img; } diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h index 2fa9db2..12fe994 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.h @@ -43,7 +43,6 @@ #define QMEEGOLIVEPIXMAP_H #include -#include "qmeegoliveimage.h" class QMeeGoLivePixmapPrivate; class QSharedMemory; @@ -56,13 +55,17 @@ class QImage; class QMeeGoLivePixmap : public QPixmap { public: - //! Creates new pixmap from the given QMeeGoLiveImage. - /*! - The created QMeeGoLivePixmap will be attached to the given QMeeGoLiveImage. - Updates to the QMeeGoLiveImage will be represented on this newly created - QMeeGoLivePixmap. + enum Format { + Format_RGB16, //! 16bit, 5-6-5 RGB format. + Format_ARGB32_Premultiplied //! 32bit, AARRGGBB format. The typical Qt format. + }; + + //! Creates and returns a new live pixmap with the given parameters. + /*! + The new pixmap is created with the given width w and the given height h. + The format specifies the color format used by the pixmap. */ - static QMeeGoLivePixmap* fromLiveImage(QMeeGoLiveImage *liveImage); + static QMeeGoLivePixmap* livePixmapWithSize(int w, int h, Format format); //! Creates a new QMeeGoLivePixmap from the specified handle. /*! @@ -75,24 +78,30 @@ public: The handle can be used to share QMeeGoLivePixmap cross-process. */ Qt::HANDLE handle(); + + //! Locks the access to the pixmap. + /*! + The returned image can be used for direct access. + */ + QImage* lock(); + + //! Unlocks the access to the pixmap. + /*! + */ + void release(QImage *img); //! Destroys the QMeeGoLivePixmap. /*! - All QMeeGoLivePixmaps attached to a given QMeeGoLiveImage have to be destroyed - before the QMeeGoLiveImage itself is destroyed. */ virtual ~QMeeGoLivePixmap(); private: - QMeeGoLivePixmap(QPixmapData *p); + QMeeGoLivePixmap(QPixmapData *p, Qt::HANDLE h); Q_DISABLE_COPY(QMeeGoLivePixmap) Q_DECLARE_PRIVATE(QMeeGoLivePixmap) protected: QScopedPointer d_ptr; //! Private bits. - - friend class QMeeGoLiveImage; - friend class QMeeGoLiveImagePrivate; }; #endif diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h b/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h index c2591dc..22347d6 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap_p.h @@ -48,19 +48,12 @@ class QMeeGoLivePixmapPrivate { public: Q_DECLARE_PUBLIC(QMeeGoLivePixmap); - QMeeGoLivePixmapPrivate(); - void copyBackFrom(const void *raw); + QMeeGoLivePixmapPrivate(Qt::HANDLE handle); virtual ~QMeeGoLivePixmapPrivate(); - QSharedMemory *shm; - int shmSerial; - bool owns; - QMeeGoLiveImage *parentImage; + Qt::HANDLE handle; QMeeGoLivePixmap *q_ptr; - - friend class QMeeGoLiveImage; - friend class QMeeGoLiveImagePrivate; }; #endif diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp index 70b5dc1..44f9f58 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -51,21 +51,36 @@ bool QMeeGoRuntime::initialized = false; typedef int (*QMeeGoImageToEglSharedImageFunc) (const QImage&); typedef QPixmapData* (*QMeeGoPixmapDataFromEglSharedImageFunc) (Qt::HANDLE handle, const QImage&); +typedef QPixmapData* (*QMeeGoPixmapDataFromEglImageFunc) (Qt::HANDLE handle); typedef QPixmapData* (*QMeeGoPixmapDataWithGLTextureFunc) (int w, int h); typedef bool (*QMeeGoDestroyEGLSharedImageFunc) (Qt::HANDLE handle); typedef void (*QMeeGoUpdateEglSharedImagePixmapFunc) (QPixmap*); typedef void (*QMeeGoSetSurfaceFixedSizeFunc) (int w, int h); typedef void (*QMeeGoSetSurfaceScalingFunc) (int x, int y, int w, int h); typedef void (*QMeeGoSetTranslucentFunc) (bool translucent); +typedef Qt::HANDLE (*QMeeGoLiveTextureCreateFunc) (int w, int h, QImage::Format format); +typedef bool (*QMeeGoLiveTextureLockFunc) (Qt::HANDLE h); +typedef bool (*QMeeGoLiveTextureUnlockFunc) (Qt::HANDLE h); +typedef void (*QMeeGoLiveTextureDestroyFunc) (Qt::HANDLE h); +typedef void (*QMeeGoLiveTextureQueryFunc) (Qt::HANDLE h, void **data, int *pitch); +typedef Qt::HANDLE (*QMeeGoLiveTextureToEglImageFunc) (Qt::HANDLE h); static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL; static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL; +static QMeeGoPixmapDataFromEglImageFunc qt_meego_pixmapdata_from_egl_image = NULL; static QMeeGoPixmapDataWithGLTextureFunc qt_meego_pixmapdata_with_gl_texture = NULL; static QMeeGoDestroyEGLSharedImageFunc qt_meego_destroy_egl_shared_image = NULL; static QMeeGoUpdateEglSharedImagePixmapFunc qt_meego_update_egl_shared_image_pixmap = NULL; static QMeeGoSetSurfaceFixedSizeFunc qt_meego_set_surface_fixed_size = NULL; static QMeeGoSetSurfaceScalingFunc qt_meego_set_surface_scaling = NULL; static QMeeGoSetTranslucentFunc qt_meego_set_translucent = NULL; +static QMeeGoLiveTextureCreateFunc qt_meego_live_texture_create = NULL; +static QMeeGoLiveTextureLockFunc qt_meego_live_texture_lock = NULL; +static QMeeGoLiveTextureUnlockFunc qt_meego_live_texture_unlock = NULL; +static QMeeGoLiveTextureDestroyFunc qt_meego_live_texture_destroy = NULL; +static QMeeGoLiveTextureQueryFunc qt_meego_live_texture_query = NULL; +static QMeeGoLiveTextureToEglImageFunc qt_meego_live_texture_to_egl_image = NULL; + void QMeeGoRuntime::initialize() { @@ -80,17 +95,26 @@ void QMeeGoRuntime::initialize() if (success) { qt_meego_image_to_egl_shared_image = (QMeeGoImageToEglSharedImageFunc) library.resolve("qt_meego_image_to_egl_shared_image"); - qt_meego_pixmapdata_from_egl_shared_image = (QMeeGoPixmapDataFromEglSharedImageFunc) library.resolve("qt_meego_pixmapdata_from_egl_shared_image"); + qt_meego_pixmapdata_from_egl_shared_image = (QMeeGoPixmapDataFromEglSharedImageFunc) library.resolve("qt_meego_pixmapdata_from_egl_shared_image"); + qt_meego_pixmapdata_from_egl_image = (QMeeGoPixmapDataFromEglImageFunc) library.resolve("qt_meego_pixmapdata_from_egl_image"); qt_meego_pixmapdata_with_gl_texture = (QMeeGoPixmapDataWithGLTextureFunc) library.resolve("qt_meego_pixmapdata_with_gl_texture"); qt_meego_destroy_egl_shared_image = (QMeeGoDestroyEGLSharedImageFunc) library.resolve("qt_meego_destroy_egl_shared_image"); qt_meego_update_egl_shared_image_pixmap = (QMeeGoUpdateEglSharedImagePixmapFunc) library.resolve("qt_meego_update_egl_shared_image_pixmap"); qt_meego_set_surface_fixed_size = (QMeeGoSetSurfaceFixedSizeFunc) library.resolve("qt_meego_set_surface_fixed_size"); qt_meego_set_surface_scaling = (QMeeGoSetSurfaceScalingFunc) library.resolve("qt_meego_set_surface_scaling"); qt_meego_set_translucent = (QMeeGoSetTranslucentFunc) library.resolve("qt_meego_set_translucent"); - - if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image && qt_meego_pixmapdata_with_gl_texture - && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap && qt_meego_set_surface_fixed_size - && qt_meego_set_surface_scaling && qt_meego_set_translucent) + qt_meego_live_texture_create = (QMeeGoLiveTextureCreateFunc) library.resolve("qt_meego_live_texture_create"); + qt_meego_live_texture_lock = (QMeeGoLiveTextureLockFunc) library.resolve("qt_meego_live_texture_lock"); + qt_meego_live_texture_unlock = (QMeeGoLiveTextureUnlockFunc) library.resolve("qt_meego_live_texture_unlock"); + qt_meego_live_texture_destroy = (QMeeGoLiveTextureDestroyFunc) library.resolve("qt_meego_live_texture_destroy"); + qt_meego_live_texture_query = (QMeeGoLiveTextureQueryFunc) library.resolve("qt_meego_live_texture_query"); + qt_meego_live_texture_to_egl_image = (QMeeGoLiveTextureToEglImageFunc) library.resolve("qt_meego_live_texture_to_egl_image"); + + if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image && qt_meego_pixmapdata_from_egl_image && + qt_meego_pixmapdata_with_gl_texture && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap && + qt_meego_set_surface_fixed_size && qt_meego_set_surface_scaling && qt_meego_set_translucent && + qt_meego_live_texture_create && qt_meego_live_texture_lock && qt_meego_live_texture_unlock && + qt_meego_live_texture_destroy && qt_meego_live_texture_query && qt_meego_live_texture_to_egl_image) { qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion)); } @@ -108,18 +132,25 @@ Qt::HANDLE QMeeGoRuntime::imageToEGLSharedImage(const QImage &image) return qt_meego_image_to_egl_shared_image(image); } -QPixmap QMeeGoRuntime::pixmapFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) +QPixmapData* QMeeGoRuntime::pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage) { ENSURE_INITIALIZED; Q_ASSERT(qt_meego_pixmapdata_from_egl_shared_image); - return QPixmap(qt_meego_pixmapdata_from_egl_shared_image(handle, softImage)); + return qt_meego_pixmapdata_from_egl_shared_image(handle, softImage); +} + +QPixmapData* QMeeGoRuntime::pixmapDataFromEGLImage(Qt::HANDLE handle) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_pixmapdata_from_egl_image); + return qt_meego_pixmapdata_from_egl_image(handle); } -QPixmap QMeeGoRuntime::pixmapWithGLTexture(int w, int h) +QPixmapData* QMeeGoRuntime::pixmapDataWithGLTexture(int w, int h) { ENSURE_INITIALIZED; Q_ASSERT(qt_meego_pixmapdata_with_gl_texture); - return QPixmap(qt_meego_pixmapdata_with_gl_texture(w, h)); + return qt_meego_pixmapdata_with_gl_texture(w, h); } bool QMeeGoRuntime::destroyEGLSharedImage(Qt::HANDLE handle) @@ -156,3 +187,46 @@ void QMeeGoRuntime::setTranslucent(bool translucent) Q_ASSERT(qt_meego_set_translucent); qt_meego_set_translucent(translucent); } + +Qt::HANDLE QMeeGoRuntime::createLiveTexture(int w, int h, QImage::Format format) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_live_texture_create); + return qt_meego_live_texture_create(w, h, format); +} + +bool QMeeGoRuntime::lockLiveTexture(Qt::HANDLE h) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_live_texture_lock); + return qt_meego_live_texture_lock(h); +} + +bool QMeeGoRuntime::unlockLiveTexture(Qt::HANDLE h) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_live_texture_unlock); + return qt_meego_live_texture_unlock(h); +} + +void QMeeGoRuntime::destroyLiveTexture(Qt::HANDLE h) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_live_texture_destroy); + qt_meego_live_texture_destroy(h); +} + +void QMeeGoRuntime::queryLiveTexture(Qt::HANDLE h, void **data, int *pitch) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_live_texture_query); + qt_meego_live_texture_query(h, data, pitch); +} + +Qt::HANDLE QMeeGoRuntime::liveTextureToEGLImage(Qt::HANDLE handle) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_live_texture_to_egl_image); + return qt_meego_live_texture_to_egl_image(handle); +} + diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h index 82fdb52..048b9be 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.h +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h @@ -48,13 +48,20 @@ public: static void initialize(); static Qt::HANDLE imageToEGLSharedImage(const QImage &image); - static QPixmap pixmapFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage); - static QPixmap pixmapWithGLTexture(int w, int h); + static QPixmapData* pixmapDataFromEGLSharedImage(Qt::HANDLE handle, const QImage &softImage); + static QPixmapData* pixmapDataFromEGLImage(Qt::HANDLE handle); + static QPixmapData* pixmapDataWithGLTexture(int w, int h); static bool destroyEGLSharedImage(Qt::HANDLE handle); static void updateEGLSharedImagePixmap(QPixmap *p); static void setSurfaceFixedSize(int w, int h); static void setSurfaceScaling(int x, int y, int w, int h); static void setTranslucent(bool translucent); + static Qt::HANDLE createLiveTexture(int w, int h, QImage::Format format); + static bool lockLiveTexture(Qt::HANDLE h); + static bool unlockLiveTexture(Qt::HANDLE h); + static void destroyLiveTexture(Qt::HANDLE h); + static void queryLiveTexture(Qt::HANDLE h, void **data, int *pitch); + static Qt::HANDLE liveTextureToEGLImage(Qt::HANDLE); private: static bool initialized; -- cgit v0.12 From eca7559542584a5675d22d619a7710e0f17cfba0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 09:08:34 +1000 Subject: Fix dragging items within a PathView The test to determine whether the mouse had moved greater than startDragDistance() compared the starting point on the path to the current mouse position. Fix to compare nearest path position. Task-number: QTBUG-14220 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativepathview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index 31943b2..81c84f5 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -1112,16 +1112,16 @@ void QDeclarativePathViewPrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent if (!interactive || !lastPosTime.isValid()) return; + qreal newPc; + QPointF pathPoint = pointNear(event->pos(), &newPc); if (!stealMouse) { - QPointF delta = event->pos() - startPoint; + QPointF delta = pathPoint - startPoint; if (qAbs(delta.x()) > QApplication::startDragDistance() || qAbs(delta.y()) > QApplication::startDragDistance()) stealMouse = true; } if (stealMouse) { moveReason = QDeclarativePathViewPrivate::Mouse; - qreal newPc; - pointNear(event->pos(), &newPc); qreal diff = (newPc - startPc)*modelCount*mappedRange; if (diff) { setOffset(offset + diff); -- cgit v0.12 From 8480eb288990c44c9ab337f42898bc4ef6dc62f4 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 Oct 2010 11:06:34 +1000 Subject: Don't allow multiple values to be assigned to a singular property Task-number: QTBUG-14005 --- src/declarative/qml/qdeclarativecompiler.cpp | 3 +++ .../declarative/qdeclarativebehaviors/data/reassignedAnimation.qml | 7 ++++++- .../qdeclarativelanguage/data/singularProperty.2.errors.txt | 1 + .../declarative/qdeclarativelanguage/data/singularProperty.2.qml | 7 +++++++ .../qdeclarativelanguage/data/singularProperty.errors.txt | 1 + .../declarative/qdeclarativelanguage/data/singularProperty.qml | 6 ++++++ .../declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 2 ++ 7 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index dc28e22..7a29f24 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -1932,6 +1932,9 @@ bool QDeclarativeCompiler::buildPropertyAssignment(QDeclarativeParser::Property { obj->addValueProperty(prop); + if (prop->values.count() > 1) + COMPILE_EXCEPTION(prop->values.at(0), tr( "Cannot assign multiple values to a singular property") ); + for (int ii = 0; ii < prop->values.count(); ++ii) { Value *v = prop->values.at(ii); if (v->object) { diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml index 9fca5c3..56ac216 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml +++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml @@ -7,9 +7,9 @@ Rectangle { objectName: "MyRect" width: 100; height: 100; color: "green" Behavior on x { + id: myBehavior objectName: "MyBehavior" NumberAnimation {id: na1; duration: 200 } - NumberAnimation {id: na2; duration: 1000 } } } MouseArea { @@ -24,4 +24,9 @@ Rectangle { x: 200 } } + + NumberAnimation {id: na2; duration: 1000 } + Component.onCompleted: { + myBehavior.animation = na2; + } } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt new file mode 100644 index 0000000..beae562 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.errors.txt @@ -0,0 +1 @@ +5:10:Cannot assign multiple values to a singular property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml new file mode 100644 index 0000000..2fd7fd2 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.2.qml @@ -0,0 +1,7 @@ +import QtQuick 1.0 + +QtObject { + property QtObject a + a: [ QtObject {}, QtObject {} ] +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt new file mode 100644 index 0000000..beae562 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.errors.txt @@ -0,0 +1 @@ +5:10:Cannot assign multiple values to a singular property diff --git a/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml new file mode 100644 index 0000000..da56cb8 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/singularProperty.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +QtObject { + property variant a + a: [ QtObject {}, QtObject {} ] +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 9a8c944..bb1312b 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -380,6 +380,8 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidProperty") << "invalidProperty.qml" << "invalidProperty.errors.txt" << false; QTest::newRow("nonScriptableProperty") << "nonScriptableProperty.qml" << "nonScriptableProperty.errors.txt" << false; QTest::newRow("notAvailable") << "notAvailable.qml" << "notAvailable.errors.txt" << false; + QTest::newRow("singularProperty") << "singularProperty.qml" << "singularProperty.errors.txt" << false; + QTest::newRow("singularProperty.2") << "singularProperty.2.qml" << "singularProperty.2.errors.txt" << false; } -- cgit v0.12 From a5b0d58bbba508d708b2711124c61a74e3b4f310 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 11:26:57 +1000 Subject: Ensure Flickable.contentX and Flickable.contentY return correct values. The animation value was used previously, but this isn't the actual position of the contentItem. Task-number: QTBUG-13603 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 33c21b1..001abca 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -466,7 +466,7 @@ QDeclarativeFlickable::~QDeclarativeFlickable() qreal QDeclarativeFlickable::contentX() const { Q_D(const QDeclarativeFlickable); - return -d->hData.move.value(); + return -d->contentItem->x(); } void QDeclarativeFlickable::setContentX(qreal pos) @@ -484,7 +484,7 @@ void QDeclarativeFlickable::setContentX(qreal pos) qreal QDeclarativeFlickable::contentY() const { Q_D(const QDeclarativeFlickable); - return -d->vData.move.value(); + return -d->contentItem->y(); } void QDeclarativeFlickable::setContentY(qreal pos) -- cgit v0.12 From e38185424bda5b97bca4c381abbb6f4c577d55cf Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 Oct 2010 11:44:16 +1000 Subject: Remove some unnecessary includes in cpp files --- src/declarative/graphicsitems/qdeclarativeimagebase.cpp | 2 -- src/declarative/graphicsitems/qdeclarativeitem.cpp | 1 - src/declarative/graphicsitems/qdeclarativepainteditem.cpp | 1 - src/declarative/qml/qdeclarativecomponent.cpp | 1 - src/declarative/util/qdeclarativefontloader.cpp | 1 - 5 files changed, 6 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index 02b4807..b06e2f7 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -46,8 +46,6 @@ #include #include -#include - QT_BEGIN_NAMESPACE QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent) diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 250a43b..735698e 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -56,7 +56,6 @@ #include #include -#include #include #include #include diff --git a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp index a6db1fa..b470b3a 100644 --- a/src/declarative/graphicsitems/qdeclarativepainteditem.cpp +++ b/src/declarative/graphicsitems/qdeclarativepainteditem.cpp @@ -44,7 +44,6 @@ #include #include -#include #include #include #include diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index b532b0c..cfef9cf 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -57,7 +57,6 @@ #include #include -#include #include #include diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp index 3e4a81a..d2f65ef 100644 --- a/src/declarative/util/qdeclarativefontloader.cpp +++ b/src/declarative/util/qdeclarativefontloader.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include -- cgit v0.12 From 0bf05331d901ca27e358ec22569a07489a70b7a5 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 11:46:36 +1000 Subject: emit currentSectionChanged when section changes in ListView. Task-number: QTBUG-13981 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativelistview.cpp | 15 ++++++++++++--- .../qdeclarativelistview/tst_qdeclarativelistview.cpp | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 6b46bc5..4943aef 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1009,18 +1009,27 @@ void QDeclarativeListViewPrivate::updateSections() void QDeclarativeListViewPrivate::updateCurrentSection() { + Q_Q(QDeclarativeListView); if (!sectionCriteria || visibleItems.isEmpty()) { - currentSection.clear(); + if (!currentSection.isEmpty()) { + currentSection.clear(); + emit q->currentSectionChanged(); + } return; } int index = 0; while (index < visibleItems.count() && visibleItems.at(index)->endPosition() < position()) ++index; + QString newSection = currentSection; if (index < visibleItems.count()) - currentSection = visibleItems.at(index)->attached->section(); + newSection = visibleItems.at(index)->attached->section(); else - currentSection = visibleItems.first()->attached->section(); + newSection = visibleItems.first()->attached->section(); + if (newSection != currentSection) { + currentSection = newSection; + emit q->currentSectionChanged(); + } } void QDeclarativeListViewPrivate::updateCurrent(int modelIndex) diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 6452bae..65ff635 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -937,6 +937,8 @@ void tst_QDeclarativeListView::sections() QCOMPARE(next->text().toInt(), (i+1)/5); } + QSignalSpy currentSectionChangedSpy(listview, SIGNAL(currentSectionChanged())); + // Remove section boundary model.removeItem(5); @@ -972,9 +974,13 @@ void tst_QDeclarativeListView::sections() listview->setContentY(140); QTRY_COMPARE(listview->currentSection(), QString("1")); + QTRY_COMPARE(currentSectionChangedSpy.count(), 1); + listview->setContentY(20); QTRY_COMPARE(listview->currentSection(), QString("0")); + QTRY_COMPARE(currentSectionChangedSpy.count(), 2); + item = findItem(contentItem, "wrapper", 1); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); -- cgit v0.12 From 10f0cc708b8e7fc2206d1a141dfd4122e7a6f4b0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 12:55:21 +1000 Subject: Ensure that onRelease is called for doubleClick events. Also ensures that the pressed property is updated appropriately and the double click and hold is possible. Task-number: QTBUG-14279 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativemousearea.cpp | 12 ++++++------ src/declarative/graphicsitems/qdeclarativemousearea_p_p.h | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index a0208ef..1533d55 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -557,6 +557,7 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) ungrabMouse(); setKeepMouseGrab(false); } + d->doubleClick = false; } void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) @@ -565,14 +566,12 @@ void QDeclarativeMouseArea::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *even if (!d->absorb) { QDeclarativeItem::mouseDoubleClickEvent(event); } else { + d->doubleClick = true; d->saveEvent(event); QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, false); me.setAccepted(d->isDoubleClickConnected()); emit this->doubleClicked(&me); - if (!me.isAccepted()) { - // Only deliver the press event if we haven't accepted the double click. - QDeclarativeItem::mouseDoubleClickEvent(event); - } + QDeclarativeItem::mouseDoubleClickEvent(event); } } @@ -841,7 +840,8 @@ bool QDeclarativeMouseArea::setPressed(bool p) d->pressed = p; QDeclarativeMouseEvent me(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, isclick, d->longPress); if (d->pressed) { - emit pressed(&me); + if (!d->doubleClick) + emit pressed(&me); me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); emit mousePositionChanged(&me); @@ -849,7 +849,7 @@ bool QDeclarativeMouseArea::setPressed(bool p) emit released(&me); me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); - if (isclick && !d->longPress) + if (isclick && !d->longPress && !d->doubleClick) emit clicked(&me); } diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h index 48a56d9..06a01d3 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h @@ -68,7 +68,7 @@ class QDeclarativeMouseAreaPrivate : public QDeclarativeItemPrivate public: QDeclarativeMouseAreaPrivate() : absorb(true), hovered(false), pressed(false), longPress(false), - moved(false), stealMouse(false), drag(0) + moved(false), stealMouse(false), doubleClick(false), drag(0) { } @@ -109,6 +109,7 @@ public: bool dragX : 1; bool dragY : 1; bool stealMouse : 1; + bool doubleClick : 1; QDeclarativeDrag *drag; QPointF startScene; qreal startX; -- cgit v0.12 From 5447a9590dc0efa1a79fde6235fdcf76d3ae81fe Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 13:01:11 +1000 Subject: Add test for QTBUG-14279 Task-number: QTBUG-14279 --- tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml | 2 ++ .../declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml index 2348444..55b0812 100644 --- a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml +++ b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml @@ -4,11 +4,13 @@ Item { id: root property int clicked: 0 property int doubleClicked: 0 + property int released: 0 MouseArea { width: 200; height: 200 onClicked: { root.clicked++ } onDoubleClicked: { root.doubleClicked++ } + onReleased: { root.released++ } } } diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index 5e88450..5a50e0d 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -413,14 +413,19 @@ void tst_QDeclarativeMouseArea::doubleClick() releaseEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &releaseEvent); + QCOMPARE(canvas->rootObject()->property("released").toInt(), 1); + QGraphicsSceneMouseEvent dblClickEvent(QEvent::GraphicsSceneMouseDoubleClick); dblClickEvent.setScenePos(QPointF(100, 100)); dblClickEvent.setButton(Qt::LeftButton); dblClickEvent.setButtons(Qt::LeftButton); QApplication::sendEvent(scene, &dblClickEvent); + QApplication::sendEvent(scene, &releaseEvent); + QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1); QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1); + QCOMPARE(canvas->rootObject()->property("released").toInt(), 2); } QTEST_MAIN(tst_QDeclarativeMouseArea) -- cgit v0.12 From c4cbd04275906b1bfa1a55147a0a4bb626033a20 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 Oct 2010 13:47:17 +1000 Subject: Check plugin and QML file case on Mac and Windows This test should prevent the case where a QML app that is developed on a case insensitive filesystem (like on Mac or Windows) and then run on a case sensitive filesystem (like on Linux) fails to find module plugins, imports and QML files. Task-number: QTBUG-13517 --- src/declarative/qml/qdeclarativeengine.cpp | 26 +++++++ src/declarative/qml/qdeclarativeglobal_p.h | 13 ++++ src/declarative/qml/qdeclarativeimport.cpp | 11 ++- src/declarative/qml/qdeclarativetypeloader.cpp | 8 +++ .../data/importIncorrectCase.qml | 5 ++ .../data/incorrectCase.errors.insensitive.txt | 2 + .../data/incorrectCase.errors.sensitive.txt | 1 + .../qdeclarativelanguage/data/incorrectCase.qml | 4 ++ .../data/incorrectCaseType.qml | 4 ++ .../tst_qdeclarativelanguage.cpp | 24 +++++++ .../data/incorrectCase.qml | 4 ++ .../imports/com/nokia/WrongCase/qmldir | 1 + .../pluginWrongCase/plugin.cpp | 83 ++++++++++++++++++++++ .../pluginWrongCase/pluginWrongCase.pro | 10 +++ .../qdeclarativemoduleplugin.pro | 2 +- .../tst_qdeclarativemoduleplugin.cpp | 20 ++++++ 16 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml create mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml create mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir create mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp create mode 100644 tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 584c5ec..0749767 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -2159,4 +2159,30 @@ const QMetaObject *QDeclarativeEnginePrivate::metaObjectForType(int t) const } } +bool QDeclarative_isFileCaseCorrect(const QString &fileName) +{ +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) + QFileInfo info(fileName); + + QString absolute = info.absoluteFilePath(); + QString canonical = info.canonicalFilePath(); + + int absoluteLength = absolute.length(); + int canonicalLength = canonical.length(); + + int length = qMin(absoluteLength, canonicalLength); + for (int ii = 0; ii < length; ++ii) { + const QChar &a = absolute.at(absoluteLength - 1 - ii); + const QChar &c = canonical.at(canonicalLength - 1 - ii); + + if (a.toLower() != c.toLower()) + return true; + if (a != c) + return false; + } +#endif + + return true; +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeglobal_p.h b/src/declarative/qml/qdeclarativeglobal_p.h index 1041992..65d9b24 100644 --- a/src/declarative/qml/qdeclarativeglobal_p.h +++ b/src/declarative/qml/qdeclarativeglobal_p.h @@ -75,6 +75,19 @@ struct QDeclarativeGraphics_DerivedObject : public QObject }; /*! + Returns true if the case of \a fileName is equivalent to the file case of + \a fileName on disk, and false otherwise. + + This is used to ensure that the behavior of QML on a case-insensitive file + system is the same as on a case-sensitive file system. This function + performs a "best effort" attempt to determine the real case of the file. + It may have false positives (say the case is correct when it isn't), but it + should never have a false negative (say the case is incorrect when it is + correct). +*/ +bool QDeclarative_isFileCaseCorrect(const QString &fileName); + +/*! Makes the \a object a child of \a parent. Note that when using this method, neither \a parent nor the object's previous parent (if it had one) will receive ChildRemoved or ChildAdded events. diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index fe4ed48..6f5216a 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -351,7 +351,11 @@ bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath { QFile file(absoluteFilePath); QString filecontent; - if (file.open(QFile::ReadOnly)) { + if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) { + if (errorString) + *errorString = QDeclarativeImportDatabase::tr("cannot load module \"%1\": File name case mismatch for \"%2\"").arg(uri).arg(absoluteFilePath); + return false; + } else if (file.open(QFile::ReadOnly)) { filecontent = QString::fromUtf8(file.readAll()); if (qmlImportTrace()) qDebug().nospace() << "QDeclarativeImports(" << qPrintable(base.toString()) << "::importExtension: " @@ -913,6 +917,11 @@ bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QSt } if (!engineInitialized || !typesRegistered) { + if (!QDeclarative_isFileCaseCorrect(absoluteFilePath)) { + if (errorString) + *errorString = tr("File name case mismatch for \"%2\"").arg(absoluteFilePath); + return false; + } QPluginLoader loader(absoluteFilePath); if (!loader.load()) { diff --git a/src/declarative/qml/qdeclarativetypeloader.cpp b/src/declarative/qml/qdeclarativetypeloader.cpp index 061f309..c8e1a07 100644 --- a/src/declarative/qml/qdeclarativetypeloader.cpp +++ b/src/declarative/qml/qdeclarativetypeloader.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -493,6 +494,13 @@ void QDeclarativeDataLoader::load(QDeclarativeDataBlob *blob) QString lf = QDeclarativeEnginePrivate::urlToLocalFileOrQrc(blob->m_url); if (!lf.isEmpty()) { + if (!QDeclarative_isFileCaseCorrect(lf)) { + QDeclarativeError error; + error.setUrl(blob->m_url); + error.setDescription(QLatin1String("File name case mismatch")); + blob->setError(error); + return; + } QFile file(lf); if (file.open(QFile::ReadOnly)) { QByteArray data = file.readAll(); diff --git a/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml new file mode 100644 index 0000000..247f527 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/importIncorrectCase.qml @@ -0,0 +1,5 @@ +import QtQuick 1.0 +import com.Nokia.installedtest 1.0 + +QtObject { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt new file mode 100644 index 0000000..3813680 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.insensitive.txt @@ -0,0 +1,2 @@ +3:1:Type IncorrectCaseType unavailable +-1:-1:File name case mismatch diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt new file mode 100644 index 0000000..abed1a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.errors.sensitive.txt @@ -0,0 +1 @@ +3:1:IncorrectCaseType is not a type diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml new file mode 100644 index 0000000..d11000b --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCase.qml @@ -0,0 +1,4 @@ +import QtQuick 1.0 + +IncorrectCaseType { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml new file mode 100644 index 0000000..cf32b45 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/incorrectCaseType.qml @@ -0,0 +1,4 @@ +import QtQuick 1.0 + +QtObject { +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index bb1312b..2aac27e 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -144,6 +144,7 @@ private slots: void importsInstalled(); void importsOrder_data(); void importsOrder(); + void importIncorrectCase(); void qmlAttachedPropertiesObjectMethod(); void customOnProperty(); @@ -382,6 +383,13 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("notAvailable") << "notAvailable.qml" << "notAvailable.errors.txt" << false; QTest::newRow("singularProperty") << "singularProperty.qml" << "singularProperty.errors.txt" << false; QTest::newRow("singularProperty.2") << "singularProperty.2.qml" << "singularProperty.2.errors.txt" << false; + QTest::newRow("incorrectCase") << "incorrectCase.qml" +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) + << "incorrectCase.errors.insensitive.txt" +#else + << "incorrectCase.errors.sensitive.txt" +#endif + << false; } @@ -1724,6 +1732,22 @@ void tst_qdeclarativelanguage::importsOrder() testType(qml,type,error); } +void tst_qdeclarativelanguage::importIncorrectCase() +{ + QDeclarativeComponent component(&engine, TEST_FILE("importIncorrectCase.qml")); + + QList errors = component.errors(); + QCOMPARE(errors.count(), 1); + +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) + QString expectedError = QLatin1String("cannot load module \"com.Nokia.installedtest\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("data/lib/com/Nokia/installedtest/qmldir") + QLatin1String("\""); +#else + QString expectedError = QLatin1String("module \"com.Nokia.installedtest\" is not installed"); +#endif + + QCOMPARE(errors.at(0).description(), expectedError); +} + void tst_qdeclarativelanguage::qmlAttachedPropertiesObjectMethod() { QObject object; diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml b/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml new file mode 100644 index 0000000..a21ece7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/data/incorrectCase.qml @@ -0,0 +1,4 @@ +import com.nokia.WrongCase 1.0 + +MyPluginType { value: 123 } + diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir new file mode 100644 index 0000000..6c87874 --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/imports/com/nokia/WrongCase/qmldir @@ -0,0 +1 @@ +plugin PluGin diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp new file mode 100644 index 0000000..5e91f4e --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/plugin.cpp @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ +#include +#include +#include +#include + +class MyPluginType : public QObject +{ + Q_OBJECT + Q_PROPERTY(int value READ value WRITE setValue) + +public: + MyPluginType(QObject *parent=0) : QObject(parent) + { + qWarning("import worked"); + } + + int value() const { return v; } + void setValue(int i) { v = i; } + +private: + int v; +}; + + +class MyPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT +public: + MyPlugin() + { + qWarning("plugin created"); + } + + void registerTypes(const char *uri) + { + Q_ASSERT(QLatin1String(uri) == "com.nokia.WrongCase"); + qmlRegisterType(uri, 1, 0, "MyPluginType"); + } +}; + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(plugin, MyPlugin); diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro new file mode 100644 index 0000000..c7337ca --- /dev/null +++ b/tests/auto/declarative/qdeclarativemoduleplugin/pluginWrongCase/pluginWrongCase.pro @@ -0,0 +1,10 @@ +TEMPLATE = lib +CONFIG += plugin +SOURCES = plugin.cpp +QT = core declarative +TARGET = Plugin +DESTDIR = ../imports/com/nokia/WrongCase + +symbian: { + TARGET.EPOCALLOWDLLDATA=1 +} diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro index 824b402..221e465 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro @@ -1,6 +1,6 @@ QT = core TEMPLATE = subdirs -SUBDIRS = plugin +SUBDIRS = plugin pluginWrongCase tst_qdeclarativemoduleplugin_pro.depends += plugin SUBDIRS += tst_qdeclarativemoduleplugin.pro diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index e1022e0..587a86a 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -54,6 +54,7 @@ public: private slots: void importsPlugin(); + void incorrectPluginCase(); }; #ifdef Q_OS_SYMBIAN @@ -120,6 +121,25 @@ void tst_qdeclarativemoduleplugin::importsPlugin() delete object; } +void tst_qdeclarativemoduleplugin::incorrectPluginCase() +{ + QDeclarativeEngine engine; + engine.addImportPath(QLatin1String(SRCDIR) + QDir::separator() + QLatin1String("imports")); + + QDeclarativeComponent component(&engine, TEST_FILE("data/incorrectCase.qml")); + + QList errors = component.errors(); + QCOMPARE(errors.count(), 1); + +#if defined(Q_OS_MAC) || defined(Q_OS_WIN) + QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/libPluGin.dylib") + QLatin1String("\""); +#else + QString expectedError = QLatin1String("module \"com.nokia.WrongCase\" plugin \"PluGin\" not found"); +#endif + + QCOMPARE(errors.at(0).description(), expectedError); +} + QTEST_MAIN(tst_qdeclarativemoduleplugin) #include "tst_qdeclarativemoduleplugin.moc" -- cgit v0.12 From a139b9aff0d658758cc7a8063377824178a8ea92 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 Oct 2010 14:03:37 +1000 Subject: Disable Text {} image caching by default Task-number: QTBUG-14050 --- src/declarative/graphicsitems/qdeclarativetext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 65f1564..54cb062 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -82,7 +82,7 @@ private: static QSet errors; }; -DEFINE_BOOL_CONFIG_OPTION(disableImageCache, QML_DISABLE_IMAGE_CACHE); +DEFINE_BOOL_CONFIG_OPTION(enableImageCache, QML_ENABLE_TEXT_IMAGE_CACHE); QDeclarativeTextPrivate::QDeclarativeTextPrivate() : color((QRgb)0), style(QDeclarativeText::Normal), @@ -90,7 +90,7 @@ QDeclarativeTextPrivate::QDeclarativeTextPrivate() imgDirty(true), dirty(true), richText(false), singleline(false), cache(true), internalWidthUpdate(false), doc(0), format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap) { - cache = !disableImageCache(); + cache = enableImageCache(); QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton; QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; } -- cgit v0.12 From 762b03e1ae83ffd66965810e1d70326b364115f5 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 14:17:05 +1000 Subject: Don't forward keys to invisible items. Task-number: QTBUG-13685 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativeitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 735698e..51eb5f2 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -1180,7 +1180,7 @@ void QDeclarativeKeysAttached::keyPressed(QKeyEvent *event, bool post) d->inPress = true; for (int ii = 0; ii < d->targets.count(); ++ii) { QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii)); - if (i) { + if (i && i->isVisible()) { d->item->scene()->sendEvent(i, event); if (event->isAccepted()) { d->inPress = false; @@ -1222,7 +1222,7 @@ void QDeclarativeKeysAttached::keyReleased(QKeyEvent *event, bool post) d->inRelease = true; for (int ii = 0; ii < d->targets.count(); ++ii) { QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii)); - if (i) { + if (i && i->isVisible()) { d->item->scene()->sendEvent(i, event); if (event->isAccepted()) { d->inRelease = false; @@ -1247,7 +1247,7 @@ void QDeclarativeKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool p d->inIM = true; for (int ii = 0; ii < d->targets.count(); ++ii) { QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii)); - if (i && (i->flags() & QGraphicsItem::ItemAcceptsInputMethod)) { + if (i && i->isVisible() && (i->flags() & QGraphicsItem::ItemAcceptsInputMethod)) { d->item->scene()->sendEvent(i, event); if (event->isAccepted()) { d->imeItem = i; @@ -1275,7 +1275,7 @@ QVariant QDeclarativeKeysAttached::inputMethodQuery(Qt::InputMethodQuery query) if (d->item) { for (int ii = 0; ii < d->targets.count(); ++ii) { QGraphicsItem *i = d->finalFocusProxy(d->targets.at(ii)); - if (i && (i->flags() & QGraphicsItem::ItemAcceptsInputMethod) && i == d->imeItem) { //### how robust is i == d->imeItem check? + if (i && i->isVisible() && (i->flags() & QGraphicsItem::ItemAcceptsInputMethod) && i == d->imeItem) { //### how robust is i == d->imeItem check? QVariant v = static_cast(i)->doInputMethodQuery(query); if (v.userType() == QVariant::RectF) v = d->item->mapRectFromItem(i, v.toRectF()); //### cost? -- cgit v0.12 From fd2d104988955e4e94252abd8d90507aa33dc10d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 14:34:48 +1000 Subject: Test for QTBUG-13685 Task-number: QTBUG-13685 --- tests/auto/declarative/qdeclarativeitem/data/keystest.qml | 1 + .../declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml index 3927f42..9af6e9f 100644 --- a/tests/auto/declarative/qdeclarativeitem/data/keystest.qml +++ b/tests/auto/declarative/qdeclarativeitem/data/keystest.qml @@ -17,6 +17,7 @@ Item { Item { id: item2 + visible: forwardeeVisible Keys.onPressed: keysTestObject.forwardedKey(event.key) Keys.onReleased: keysTestObject.forwardedKey(event.key) } diff --git a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp index bbbf73e..b4903ae 100644 --- a/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp +++ b/tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp @@ -204,6 +204,7 @@ void tst_QDeclarativeItem::keys() canvas->rootContext()->setContextProperty("keysTestObject", testObject); canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(true)); + canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(true)); canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/keystest.qml")); canvas->show(); @@ -287,6 +288,17 @@ void tst_QDeclarativeItem::keys() testObject->reset(); + canvas->rootContext()->setContextProperty("forwardeeVisible", QVariant(false)); + key = QKeyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1); + QApplication::sendEvent(canvas, &key); + QCOMPARE(testObject->mKey, int(Qt::Key_A)); + QCOMPARE(testObject->mForwardedKey, 0); + QCOMPARE(testObject->mText, QLatin1String("A")); + QVERIFY(testObject->mModifiers == Qt::NoModifier); + QVERIFY(!key.isAccepted()); + + testObject->reset(); + canvas->rootContext()->setContextProperty("enableKeyHanding", QVariant(false)); QCOMPARE(canvas->rootObject()->property("isEnabled").toBool(), false); -- cgit v0.12 From e17a5398bf20b89834d4d6c7f4d9203f192b101f Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 8 Oct 2010 14:50:43 +1000 Subject: Image.sourceSize is incorrect after changing Image.source Task-number: QTBUG-14303 --- .../graphicsitems/qdeclarativeimagebase.cpp | 13 +++++---- .../graphicsitems/qdeclarativeimagebase_p_p.h | 2 ++ .../qdeclarativeimage/tst_qdeclarativeimage.cpp | 34 ++++++++++++++++++++-- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp index b06e2f7..c3bac2d 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp @@ -113,6 +113,7 @@ void QDeclarativeImageBase::setSourceSize(const QSize& size) return; d->sourcesize = size; + d->explicitSourceSize = true; emit sourceSizeChanged(); if (isComponentComplete()) load(); @@ -121,7 +122,10 @@ void QDeclarativeImageBase::setSourceSize(const QSize& size) QSize QDeclarativeImageBase::sourceSize() const { Q_D(const QDeclarativeImageBase); - return d->sourcesize.isValid() ? d->sourcesize : QSize(implicitWidth(),implicitHeight()); + + int width = d->sourcesize.width(); + int height = d->sourcesize.height(); + return QSize(width != -1 ? width : implicitWidth(), height != -1 ? height : implicitHeight()); } void QDeclarativeImageBase::load() @@ -139,7 +143,7 @@ void QDeclarativeImageBase::load() pixmapChange(); update(); } else { - d->pix.load(qmlEngine(this), d->url, d->sourcesize, d->async); + d->pix.load(qmlEngine(this), d->url, d->explicitSourceSize ? sourceSize() : QSize(), d->async); if (d->pix.isLoading()) { d->progress = 0.0; @@ -184,11 +188,8 @@ void QDeclarativeImageBase::requestFinished() setImplicitWidth(d->pix.width()); setImplicitHeight(d->pix.height()); - if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height()) { - d->sourcesize.setWidth(d->pix.width()); - d->sourcesize.setHeight(d->pix.height()); + if (d->sourcesize.width() != d->pix.width() || d->sourcesize.height() != d->pix.height()) emit sourceSizeChanged(); - } if (d->status != oldStatus) emit statusChanged(d->status); diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h index aee8b28..3d23ba9 100644 --- a/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativeimagebase_p_p.h @@ -69,6 +69,7 @@ public: QDeclarativeImageBasePrivate() : status(QDeclarativeImageBase::Null), progress(0.0), + explicitSourceSize(false), async(false) { QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; @@ -79,6 +80,7 @@ public: QUrl url; qreal progress; QSize sourcesize; + bool explicitSourceSize : 1; bool async : 1; }; diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 8f9b2ea..f1e026f 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -84,6 +84,7 @@ private slots: void tiling_QTBUG_6716(); void noLoading(); void paintedWidthHeight(); + void sourceSize_QTBUG_14303(); private: template @@ -377,7 +378,7 @@ void tst_qdeclarativeimage::noLoading() QTRY_COMPARE(statusSpy.count(), 0); // Loading remote file - ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/oldcolors.png"); + ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png"); QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading); QTRY_VERIFY(obj->progress() == 0.0); QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); @@ -388,7 +389,7 @@ void tst_qdeclarativeimage::noLoading() // Loading remote file again - should not go through 'Loading' state. ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); - ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/oldcolors.png"); + ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/heart200.png"); QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 4); @@ -436,6 +437,35 @@ void tst_qdeclarativeimage::paintedWidthHeight() } } +void tst_qdeclarativeimage::sourceSize_QTBUG_14303() +{ + QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }"; + QDeclarativeContext *ctxt = engine.rootContext(); + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png")); + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast(component.create()); + + QSignalSpy sourceSizeSpy(obj, SIGNAL(sourceSizeChanged())); + + QTRY_VERIFY(obj != 0); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); + + QTRY_COMPARE(obj->sourceSize().width(), 200); + QTRY_COMPARE(obj->sourceSize().height(), 200); + QTRY_COMPARE(sourceSizeSpy.count(), 0); + + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); + QTRY_COMPARE(obj->sourceSize().width(), 120); + QTRY_COMPARE(obj->sourceSize().height(), 120); + QTRY_COMPARE(sourceSizeSpy.count(), 1); + + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png")); + QTRY_COMPARE(obj->sourceSize().width(), 200); + QTRY_COMPARE(obj->sourceSize().height(), 200); + QTRY_COMPARE(sourceSizeSpy.count(), 2); +} + /* Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index -- cgit v0.12 From 63e6b999144dfbd4ab230973d7e682361e8fe182 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 8 Oct 2010 15:06:17 +1000 Subject: Allow aliases to value type properties Task-number: QTBUG-14254 --- src/declarative/qml/qdeclarativecompiler.cpp | 27 +++++++++++-- src/declarative/qml/qdeclarativevmemetaobject.cpp | 25 +++++++++--- src/declarative/qml/qdeclarativevmemetaobject_p.h | 19 ++++++++++ .../qdeclarativelanguage/data/alias.10.qml | 8 ++++ .../qdeclarativelanguage/data/alias.11.qml | 8 ++++ .../data/invalidAlias.10.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.10.qml | 6 +++ .../data/invalidAlias.3.errors.txt | 2 +- .../qdeclarativelanguage/data/invalidAlias.3.qml | 2 +- .../data/invalidAlias.4.errors.txt | 2 +- .../data/invalidAlias.8.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.8.qml | 7 ++++ .../data/invalidAlias.9.errors.txt | 1 + .../qdeclarativelanguage/data/invalidAlias.9.qml | 6 +++ .../tst_qdeclarativelanguage.cpp | 44 ++++++++++++++++++++++ 15 files changed, 147 insertions(+), 12 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt create mode 100644 tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 7a29f24..74bc5bd 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -2565,8 +2565,8 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder, QStringList alias = astNodeToStringList(node); - if (alias.count() != 1 && alias.count() != 2) - COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as or .")); + if (alias.count() < 1 || alias.count() > 3) + COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. An alias reference must be specified as , . or ..")); if (!compileState.ids.contains(alias.at(0))) COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias reference. Unable to find id \"%1\"").arg(alias.at(0))); @@ -2578,11 +2578,14 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder, int propIdx = -1; int flags = 0; bool writable = false; - if (alias.count() == 2) { + if (alias.count() == 2 || alias.count() == 3) { propIdx = idObject->metaObject()->indexOfProperty(alias.at(1).toUtf8().constData()); - if (-1 == propIdx) + if (-1 == propIdx) { COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location")); + } else if (propIdx > 0xFFFF) { + COMPILE_EXCEPTION(prop.defaultValue, tr("Alias property exceeds alias bounds")); + } QMetaProperty aliasProperty = idObject->metaObject()->property(propIdx); if (!aliasProperty.isScriptable()) @@ -2590,6 +2593,22 @@ bool QDeclarativeCompiler::compileAlias(QMetaObjectBuilder &builder, writable = aliasProperty.isWritable(); + if (alias.count() == 3) { + QDeclarativeValueType *valueType = enginePrivate->valueTypes[aliasProperty.type()]; + if (!valueType) + COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location")); + + propIdx |= ((unsigned int)aliasProperty.type()) << 24; + + int valueTypeIndex = valueType->metaObject()->indexOfProperty(alias.at(2).toUtf8().constData()); + if (valueTypeIndex == -1) + COMPILE_EXCEPTION(prop.defaultValue, tr("Invalid alias location")); + Q_ASSERT(valueTypeIndex <= 0xFF); + + aliasProperty = valueType->metaObject()->property(valueTypeIndex); + propIdx |= (valueTypeIndex << 16); + } + if (aliasProperty.isEnumType()) typeName = "int"; // Avoid introducing a dependency on the aliased metaobject else diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index 37f08fc..e28062b 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -459,7 +459,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) id -= propOffset; if (id < metaData->propertyCount) { - int t = (metaData->propertyData() + id)->propertyType; + int t = (metaData->propertyData() + id)->propertyType; bool needActivate = false; if (t == -1) { @@ -586,11 +586,26 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) connectAlias(id); - if (d->propertyIdx == -1) { + if (d->isObjectAlias()) { *reinterpret_cast(a[0]) = target; return -1; + } else if (d->isValueTypeAlias()) { + // Value type property + QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine); + + QDeclarativeValueType *valueType = ep->valueTypes[d->valueType()]; + Q_ASSERT(valueType); + + valueType->read(target, d->propertyIndex()); + int rv = QMetaObject::metacall(valueType, c, d->valueTypeIndex(), a); + + if (c == QMetaObject::WriteProperty) + valueType->write(target, d->propertyIndex(), 0x00); + + return rv; + } else { - return QMetaObject::metacall(target, c, d->propertyIdx, a); + return QMetaObject::metacall(target, c, d->propertyIndex(), a); } } @@ -823,8 +838,8 @@ void QDeclarativeVMEMetaObject::connectAlias(int aliasId) int sigIdx = methodOffset + aliasId + metaData->propertyCount; QMetaObject::connect(context, d->contextIdx + ctxtPriv->notifyIndex, object, sigIdx); - if (d->propertyIdx != -1) { - QMetaProperty prop = target->metaObject()->property(d->propertyIdx); + if (!d->isObjectAlias()) { + QMetaProperty prop = target->metaObject()->property(d->propertyIndex()); if (prop.hasNotifySignal()) QDeclarativePropertyPrivate::connect(target, prop.notifySignalIndex(), object, sigIdx); } diff --git a/src/declarative/qml/qdeclarativevmemetaobject_p.h b/src/declarative/qml/qdeclarativevmemetaobject_p.h index 4ccaa73..5134763 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject_p.h +++ b/src/declarative/qml/qdeclarativevmemetaobject_p.h @@ -84,6 +84,25 @@ struct QDeclarativeVMEMetaData int contextIdx; int propertyIdx; int flags; + + bool isObjectAlias() const { + return propertyIdx == -1; + } + bool isPropertyAlias() const { + return !isObjectAlias() && !(propertyIdx & 0xFF000000); + } + bool isValueTypeAlias() const { + return !isObjectAlias() && (propertyIdx & 0xFF000000); + } + int propertyIndex() const { + return propertyIdx & 0x0000FFFF; + } + int valueTypeIndex() const { + return (propertyIdx & 0x00FF0000) >> 16; + } + int valueType() const { + return ((unsigned int)propertyIdx) >> 24; + } }; struct PropertyData { diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml new file mode 100644 index 0000000..bf6352e --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.10.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias valueAlias: root.rectProperty + + rectProperty: "10,11,9x8" +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml b/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml new file mode 100644 index 0000000..fbd50d9 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/alias.11.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + id: root + + property alias aliasProperty: root.rectProperty.x + rectProperty: "19,13,100x120" +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml new file mode 100644 index 0000000..3ff7b16 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.10.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.rectProperty.blah +} diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt index 7260be4..fbf1b58 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.errors.txt @@ -1 +1 @@ -5:23:Invalid alias reference. An alias reference must be specified as or . +5:23:Invalid alias reference. An alias reference must be specified as , . or .. diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml index cc71753..a363373 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.3.qml @@ -2,5 +2,5 @@ import Test 1.0 MyTypeObject { id: root - property alias a: root.rectProperty.x + property alias a: root.rectProperty.x.y } diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt index 7260be4..fbf1b58 100644 --- a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.4.errors.txt @@ -1 +1 @@ -5:23:Invalid alias reference. An alias reference must be specified as or . +5:23:Invalid alias reference. An alias reference must be specified as , . or .. diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml new file mode 100644 index 0000000..4faa52d --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.8.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.imaginary.x +} + diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt new file mode 100644 index 0000000..93652a7 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.errors.txt @@ -0,0 +1 @@ +5:23:Invalid alias location diff --git a/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml new file mode 100644 index 0000000..f183912 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/data/invalidAlias.9.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + id: root + property alias a: root.floatProperty.x +} diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 2aac27e..6a45957 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -349,6 +349,9 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("invalidAlias.5") << "invalidAlias.5.qml" << "invalidAlias.5.errors.txt" << false; QTest::newRow("invalidAlias.6") << "invalidAlias.6.qml" << "invalidAlias.6.errors.txt" << false; QTest::newRow("invalidAlias.7") << "invalidAlias.7.qml" << "invalidAlias.7.errors.txt" << false; + QTest::newRow("invalidAlias.8") << "invalidAlias.8.qml" << "invalidAlias.8.errors.txt" << false; + QTest::newRow("invalidAlias.9") << "invalidAlias.9.qml" << "invalidAlias.9.errors.txt" << false; + QTest::newRow("invalidAlias.10") << "invalidAlias.10.qml" << "invalidAlias.10.errors.txt" << false; QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false; QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false; @@ -1064,6 +1067,47 @@ void tst_qdeclarativelanguage::aliasProperties() delete object; } + + // Valuetype alias + // Simple "int" alias + { + QDeclarativeComponent component(&engine, TEST_FILE("alias.10.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + // Read through alias + QCOMPARE(object->property("valueAlias").toRect(), QRect(10, 11, 9, 8)); + object->setProperty("rectProperty", QVariant(QRect(33, 12, 99, 100))); + QCOMPARE(object->property("valueAlias").toRect(), QRect(33, 12, 99, 100)); + + // Write throught alias + object->setProperty("valueAlias", QVariant(QRect(3, 3, 4, 9))); + QCOMPARE(object->property("valueAlias").toRect(), QRect(3, 3, 4, 9)); + QCOMPARE(object->property("rectProperty").toRect(), QRect(3, 3, 4, 9)); + + delete object; + } + + // Valuetype sub-alias + { + QDeclarativeComponent component(&engine, TEST_FILE("alias.11.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + // Read through alias + QCOMPARE(object->property("aliasProperty").toInt(), 19); + object->setProperty("rectProperty", QVariant(QRect(33, 8, 102, 111))); + QCOMPARE(object->property("aliasProperty").toInt(), 33); + + // Write throught alias + object->setProperty("aliasProperty", QVariant(4)); + QCOMPARE(object->property("aliasProperty").toInt(), 4); + QCOMPARE(object->property("rectProperty").toRect(), QRect(4, 8, 102, 111)); + + delete object; + } } // QTBUG-13374 Test that alias properties and signals can coexist -- cgit v0.12 From 11536f150887266b6a6f5cf00b22f9d1fcc1aaeb Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 8 Oct 2010 16:12:31 +1000 Subject: Ensure GridView header is visible at the top of the view. The view was scrolled to the top of the first item, rather than the top of the header. Task-number: QTBUG-13906 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativegridview.cpp | 9 +++++- .../qdeclarativegridview/data/header.qml | 32 ++++++++++++++++++++ .../tst_qdeclarativegridview.cpp | 35 ++++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 tests/auto/declarative/qdeclarativegridview/data/header.qml diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 8216ab7..6ee6b0d 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -218,7 +218,14 @@ public: return visibleItems.last()->rowPos() + rows * rowSize(); } } else { - return (modelIndex / columns) * rowSize(); + qreal pos = (modelIndex / columns) * rowSize(); + if (header) { + qreal headerSize = flow == QDeclarativeGridView::LeftToRight + ? header->item->height() + : header->item->width(); + pos += headerSize; + } + return pos; } return 0; } diff --git a/tests/auto/declarative/qdeclarativegridview/data/header.qml b/tests/auto/declarative/qdeclarativegridview/data/header.qml new file mode 100644 index 0000000..99baacd --- /dev/null +++ b/tests/auto/declarative/qdeclarativegridview/data/header.qml @@ -0,0 +1,32 @@ +import QtQuick 1.0 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + width: 80 + height: 60 + border.color: "blue" + Text { + text: index + } + color: GridView.isCurrentItem ? "lightsteelblue" : "white" + } + } + GridView { + id: grid + objectName: "grid" + width: 240 + height: 320 + cellWidth: 80 + cellHeight: 60 + model: testModel + delegate: myDelegate + header: Text { objectName: "header"; text: "Header"; height: 30 } + } +} diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index 975cf8f..f7acd87 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -82,6 +82,7 @@ private slots: void QTBUG_8456(); void manualHighlight(); void footer(); + void header(); private: QDeclarativeView *createView(); @@ -1214,6 +1215,40 @@ void tst_QDeclarativeGridView::footer() QTRY_COMPARE(footer->y(), 0.0); } +void tst_QDeclarativeGridView::header() +{ + QDeclarativeView *canvas = createView(); + + TestModel model; + for (int i = 0; i < 7; i++) + model.addItem("Item" + QString::number(i), ""); + + QDeclarativeContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml")); + qApp->processEvents(); + + QDeclarativeGridView *gridview = findItem(canvas->rootObject(), "grid"); + QTRY_VERIFY(gridview != 0); + + QDeclarativeItem *contentItem = gridview->contentItem(); + QTRY_VERIFY(contentItem != 0); + + QDeclarativeText *header = findItem(contentItem, "header"); + QVERIFY(header); + + QCOMPARE(header->y(), 0.0); + QCOMPARE(gridview->contentY(), 0.0); + + QDeclarativeItem *item = findItem(contentItem, "wrapper", 0); + QVERIFY(item); + QCOMPARE(item->y(), 30.0); + + model.clear(); + QTRY_COMPARE(header->y(), 0.0); +} + QDeclarativeView *tst_QDeclarativeGridView::createView() { -- cgit v0.12 From 69ae7469eebda30dbf430ca67d193a62969f516c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 7 Oct 2010 10:09:23 +0200 Subject: QGradientCache: Optimize choosing of which gradient to evict from cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use iterator arithmetic instead of QMultiHash::keys() to remove a random gradient color table from the cache. Reviewed-by: Samuel Rødal --- src/gui/painting/qpaintengine_raster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index dbf7b26..23be51b 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -4960,8 +4960,8 @@ protected: int size, int opacity) const; uint *addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) { if (cache.size() == maxCacheSize()) { - int elem_to_remove = qrand() % maxCacheSize(); - cache.remove(cache.keys()[elem_to_remove]); // may remove more than 1, but OK + // may remove more than 1, but OK + cache.erase(cache.begin() + (qrand() % maxCacheSize())); } CacheInfo cache_entry(gradient.stops(), opacity, gradient.interpolationMode()); generateGradientColorTable(gradient, cache_entry.buffer, paletteSize(), opacity); -- cgit v0.12 From fcf4b598a169b336344393958f67320f5f9652ce Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 28 Sep 2010 11:01:20 +0100 Subject: Progressive download in Phonon MMF backend: added download managers This patch adds a Download class which uses the RHttpDownloadMgr API to download a media clip over HTTP. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- src/3rdparty/phonon/mmf/download.cpp | 194 +++++++++++++++++++++++++++++++++++ src/3rdparty/phonon/mmf/download.h | 111 ++++++++++++++++++++ src/plugins/phonon/mmf/mmf.pro | 3 + 3 files changed, 308 insertions(+) create mode 100644 src/3rdparty/phonon/mmf/download.cpp create mode 100644 src/3rdparty/phonon/mmf/download.h diff --git a/src/3rdparty/phonon/mmf/download.cpp b/src/3rdparty/phonon/mmf/download.cpp new file mode 100644 index 0000000..7b80e4a --- /dev/null +++ b/src/3rdparty/phonon/mmf/download.cpp @@ -0,0 +1,194 @@ +/* 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 "download.h" +#include "utils.h" +#include +#include + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +static const TBool InheritDownloads = EFalse; + +DownloadPrivate::DownloadPrivate(Download *parent) + : QObject(parent) + , m_parent(parent) + , m_download(0) + , m_length(0) +{ + +} + +DownloadPrivate::~DownloadPrivate() +{ + m_downloadManager.Disconnect(); + m_downloadManager.Close(); +} + +bool DownloadPrivate::start() +{ + TRACE_CONTEXT(DownloadPrivate::start, EVideoApi); + Q_ASSERT(!m_download); + // Connect to download manager + RProcess process; + const TUid uid3 = process.SecureId(); + TRAPD(err, m_downloadManager.ConnectL(uid3, *this, InheritDownloads)); + TRACE("connect err %d", err); + if (KErrNone == err) { + // Start download + QHBufC url(m_parent->sourceUrl().toString()); + TPtr8 url8 = url->Des().Collapse(); + TRAP(err, m_download = &m_downloadManager.CreateDownloadL(url8)); + TRACE("start err %d", err); + if (KErrNone == err) + m_download->Start(); + } + return (KErrNone == err); +} + +void DownloadPrivate::resume() +{ + +} + +void DownloadPrivate::HandleDMgrEventL(RHttpDownload &aDownload, THttpDownloadEvent aEvent) +{ + TRACE_CONTEXT(DownloadPrivate::HandleDMgrEventL, EVideoApi); + Q_ASSERT(&aDownload == m_download); + switch (aEvent.iDownloadState) { + case EHttpDlPaused: + if (EHttpContentTypeReceived == aEvent.iProgressState) { + TRACE_0("paused, content type received"); + m_download->Start(); + } + break; + case EHttpDlInprogress: + switch (aEvent.iProgressState) { + case EHttpProgResponseHeaderReceived: + { + TFileName fileName; + m_download->GetStringAttribute(EDlAttrDestFilename, fileName); + TRACE("in progress, response header received, filename %S", &fileName); + const QString fileNameQt = QDir::fromNativeSeparators(qt_TDesC2QString(fileName)); + m_parent->downloadStarted(fileNameQt); + } + break; + case EHttpProgResponseBodyReceived: + { + TInt32 length = 0; + m_download->GetIntAttribute(EDlAttrDownloadedSize, length); + if (length != m_length) { + TRACE("in progress, length %d", length); + m_length = length; + emit lengthChanged(m_length); + } + } + break; + } + break; + case EHttpDlCompleted: + TRACE_0("complete"); + m_parent->complete(); + break; + case EHttpDlFailed: + TRACE_0("failed"); + m_parent->error(); + break; + } +} + +Download::Download(const QUrl &url, QObject *parent) + : QObject(parent) + , m_private(new DownloadPrivate(this)) + , m_sourceUrl(url) + , m_state(Idle) +{ + qRegisterMetaType(); + connect(m_private, SIGNAL(lengthChanged(qint64)), this, SIGNAL(lengthChanged(qint64))); +} + +Download::~Download() +{ + +} + +const QUrl &Download::sourceUrl() const +{ + return m_sourceUrl; +} + +const QString &Download::targetFileName() const +{ + return m_targetFileName; +} + +void Download::start() +{ + TRACE_CONTEXT(Download::start, EVideoApi); + TRACE_ENTRY_0(); + Q_ASSERT(Idle == m_state); + const bool ok = m_private->start(); + setState(ok ? Initializing : Error); + TRACE_EXIT_0(); +} + +void Download::resume() +{ + TRACE_CONTEXT(Download::resume, EVideoApi); + TRACE_ENTRY_0(); + m_private->resume(); + TRACE_EXIT_0(); +} + +void Download::setState(State state) +{ + TRACE_CONTEXT(Download::setState, EVideoApi); + TRACE("oldState %d newState %d", m_state, state); + const State oldState = m_state; + m_state = state; + if (oldState != m_state) + emit stateChanged(m_state); +} + +void Download::error() +{ + TRACE_CONTEXT(Download::error, EVideoApi); + TRACE_0(""); + setState(Error); +} + +void Download::downloadStarted(const QString &targetFileName) +{ + TRACE_CONTEXT(Download::downloadStarted, EVideoApi); + TRACE_0("downloadStarted"); + m_targetFileName = targetFileName; + setState(Downloading); +} + +void Download::complete() +{ + TRACE_CONTEXT(Download::complete, EVideoApi); + TRACE_0(""); + setState(Complete); +} + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/download.h b/src/3rdparty/phonon/mmf/download.h new file mode 100644 index 0000000..b57348b --- /dev/null +++ b/src/3rdparty/phonon/mmf/download.h @@ -0,0 +1,111 @@ +/* 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_MMF_DOWNLOAD_H +#define PHONON_MMF_DOWNLOAD_H + +#include +#include +#include +#include + +QT_FORWARD_DECLARE_CLASS(QByteArray) +QT_FORWARD_DECLARE_CLASS(QFile) + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ +namespace MMF +{ + +class Download; + +class DownloadPrivate : public QObject + , public MHttpDownloadMgrObserver +{ + Q_OBJECT +public: + DownloadPrivate(Download *parent); + ~DownloadPrivate(); + bool start(); + void resume(); +signals: + void error(); + void targetFileNameChanged(); + void lengthChanged(qint64 length); + void complete(); +private: + // MHttpDownloadMgrObserver + void HandleDMgrEventL(RHttpDownload &aDownload, THttpDownloadEvent aEvent); +private: + Download *m_parent; + RHttpDownloadMgr m_downloadManager; + RHttpDownload *m_download; + qint64 m_length; +}; + +class Download : public QObject +{ + Q_OBJECT + friend class DownloadPrivate; +public: + Download(const QUrl &url, QObject *parent = 0); + ~Download(); + const QUrl &sourceUrl() const; + const QString &targetFileName() const; + void start(); + + // Only has effect when QT_PHONON_MMF_DOWNLOAD_DUMMY is defined + void resume(); + + enum State { + Idle, + Initializing, + Downloading, + Complete, + Error + }; + +signals: + void lengthChanged(qint64 length); + void stateChanged(Download::State state); + +private: + void setState(State state); + + // Called by DownloadPrivate + void error(); + void downloadStarted(const QString &targetFileName); + void complete(); + +private: + DownloadPrivate *m_private; + QUrl m_sourceUrl; + QString m_targetFileName; + State m_state; +}; + +} +} + +QT_END_NAMESPACE + +Q_DECLARE_METATYPE(Phonon::MMF::Download::State) + +#endif diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 7a6fdf8..902354f 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,6 +36,7 @@ symbian { $$PHONON_MMF_DIR/backend.h \ $$PHONON_MMF_DIR/bassboost.h \ $$PHONON_MMF_DIR/defs.h \ + $$PHONON_MMF_DIR/download.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ @@ -61,6 +62,7 @@ symbian { $$PHONON_MMF_DIR/abstractvideoplayer.cpp \ $$PHONON_MMF_DIR/backend.cpp \ $$PHONON_MMF_DIR/bassboost.cpp \ + $$PHONON_MMF_DIR/download.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ @@ -111,6 +113,7 @@ symbian { LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream + LIBS += -ldownloadmgr # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From bb994a5e2a260911ed3c5603d3414c63a28faab4 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 28 Sep 2010 11:05:41 +0100 Subject: Progressive download in Phonon MMF backend: integrated with player This commit integrates the Download class with the media playback classes in the backend, to implement Progressive Download. Note that this PDL implementation has one drawback: when video playback is paused due to shortage of data (i.e. due to the download being temporarily stalled), the display goes black. This is because, when the end of the currently-downloaded data is reached, the playback session is closed. When more data becomes available, the clip is re-opened, a seek is done to reach the previous playback position, and playback is re-started. Closing the playback session closes the video stack's connection to the display, thereby causing the video widget to go black while more data is buffered. This is a consequence of the level in the native video stack at which the Phonon integration is done: managing a network stall without requiring the playback session to be closed would require integration below the MMF client API, specifically at the MMF controller level. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 148 +++++++++++++++++++++--- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 17 +++ src/3rdparty/phonon/mmf/abstractvideoplayer.cpp | 24 +++- src/3rdparty/phonon/mmf/abstractvideoplayer.h | 5 +- src/3rdparty/phonon/mmf/audioplayer.cpp | 18 ++- src/3rdparty/phonon/mmf/audioplayer.h | 5 +- src/3rdparty/phonon/mmf/mediaobject.cpp | 36 +++--- src/3rdparty/phonon/mmf/mediaobject.h | 1 + 8 files changed, 211 insertions(+), 43 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 3702560..a728423 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -51,10 +51,13 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer , m_parent(parent) , m_pending(NothingPending) , m_positionTimer(new QTimer(this)) + , m_position(0) , m_bufferStatusTimer(new QTimer(this)) , m_mmfMaxVolume(NullMaxVolume) , m_prefinishMarkSent(false) , m_aboutToFinishSent(false) + , m_download(0) + , m_downloadStalled(false) { connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick())); connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick())); @@ -183,6 +186,7 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms) } doSeek(ms); + m_position = ms; resetMarksIfRewound(); if(wasPlaying && state() != ErrorState) { @@ -207,6 +211,11 @@ bool MMF::AbstractMediaPlayer::isSeekable() const return true; } +qint64 MMF::AbstractMediaPlayer::currentTime() const +{ + return m_position; +} + void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval) { TRACE_CONTEXT(AbstractMediaPlayer::doSetTickInterval, EAudioApi); @@ -247,6 +256,14 @@ void MMF::AbstractMediaPlayer::open() symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); + } else if (url.scheme() == QLatin1String("http")) { + Q_ASSERT(!m_download); + m_download = new Download(url, this); + connect(m_download, SIGNAL(lengthChanged(qint64)), + this, SLOT(downloadLengthChanged(qint64))); + connect(m_download, SIGNAL(stateChanged(Download::State)), + this, SLOT(downloadStateChanged(Download::State))); + m_download->start(); } else { symbianErr = openUrl(url.toString()); if (KErrNone != symbianErr) @@ -288,6 +305,14 @@ void MMF::AbstractMediaPlayer::open() TRACE_EXIT_0(); } +void MMF::AbstractMediaPlayer::close() +{ + doClose(); + delete m_download; + m_download = 0; + m_position = 0; +} + void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) { TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); @@ -374,7 +399,8 @@ void MMF::AbstractMediaPlayer::bufferingComplete() { stopBufferStatusTimer(); emit MMF::AbstractPlayer::bufferStatus(100); - changeState(m_stateBeforeBuffering); + if (!progressiveDownloadStalled()) + changeState(m_stateBeforeBuffering); } void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) @@ -385,13 +411,28 @@ void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) void MMF::AbstractMediaPlayer::loadingComplete(int error) { - Q_ASSERT(Phonon::LoadingState == state()); - - if (KErrNone == error) { - updateMetaData(); - changeState(StoppedState); + TRACE_CONTEXT(AbstractMediaPlayer::loadingComplete, EAudioApi); + TRACE_ENTRY("state %d error %d", state(), error); + if (progressiveDownloadStalled()) { + Q_ASSERT(Phonon::BufferingState == state()); + if (KErrNone == error) { + bufferingComplete(); + doSeek(m_position); + startPlayback(); + m_downloadStalled = false; + } } else { - setError(tr("Loading clip failed"), error); + Q_ASSERT(Phonon::LoadingState == state()); + if (KErrNone == error) { + updateMetaData(); + changeState(StoppedState); + } else { + if (isProgressiveDownload() && KErrCorrupt == error) { + setProgressiveDownloadStalled(); + } else { + setError(tr("Loading clip failed"), error); + } + } } } @@ -415,8 +456,12 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error) QMetaObject::invokeMethod(m_parent, "switchToNextSource", Qt::QueuedConnection); } else { - setError(tr("Playback complete"), error); - emit finished(); + if (isProgressiveDownload() && KErrCorrupt == error) { + setProgressiveDownloadStalled(); + } else { + setError(tr("Playback complete"), error); + emit finished(); + } } } @@ -425,15 +470,28 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds return in.Int64() / 1000; } +bool MMF::AbstractMediaPlayer::isProgressiveDownload() const +{ + return (0 != m_download); +} + +bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const +{ + return m_downloadStalled; +} + //----------------------------------------------------------------------------- // Slots //----------------------------------------------------------------------------- void MMF::AbstractMediaPlayer::positionTick() { - const qint64 current = currentTime(); - emitMarksIfReached(current); - emit MMF::AbstractPlayer::tick(current); + const qint64 pos = getCurrentTime(); + if (pos > m_position) { + m_position = pos; + emitMarksIfReached(m_position); + emit MMF::AbstractPlayer::tick(m_position); + } } void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) @@ -458,7 +516,7 @@ void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current) void MMF::AbstractMediaPlayer::resetMarksIfRewound() { - const qint64 current = currentTime(); + const qint64 current = getCurrentTime(); const qint64 total = totalTime(); const qint64 remaining = total - current; @@ -487,9 +545,71 @@ void MMF::AbstractMediaPlayer::startPlayback() changeState(PlayingState); } +void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() +{ + TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi); + TRACE_ENTRY("state %d", state()); + Q_ASSERT(isProgressiveDownload()); + m_downloadStalled = true; + doClose(); + bufferingStarted(); + // Video player loses window handle when closed - need to reapply it here + videoOutputChanged(); +#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY + m_download->resume(); +#endif +} + void MMF::AbstractMediaPlayer::bufferStatusTick() { - emit MMF::AbstractPlayer::bufferStatus(bufferStatus()); + // During progressive download, there is no way to detect the buffering status. + // Phonon does not support a "buffering; amount unknown" signal, therefore we + // return a buffering status of zero. + const int status = progressiveDownloadStalled() ? 0 : bufferStatus(); + emit MMF::AbstractPlayer::bufferStatus(status); +} + +void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length) +{ + TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi); + TRACE_ENTRY("length %Ld", length); + Q_UNUSED(length) + if (m_downloadStalled) { + bufferingComplete(); + int err = m_parent->openFileHandle(m_download->targetFileName()); + if (KErrNone == err) + err = openFile(*m_parent->file()); + if (KErrNone != err) + setError(tr("Error opening file")); + } +} + +void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state) +{ + TRACE_CONTEXT(AbstractMediaPlayer::downloadStateChanged, EAudioApi); + TRACE_ENTRY("state %d", state); + switch (state) { + case Download::Idle: + case Download::Initializing: + break; + case Download::Downloading: + { + int err = m_parent->openFileHandle(m_download->targetFileName()); + if (KErrNone == err) + err = openFile(*m_parent->file()); + else if (KErrCorrupt == err) + // Insufficient data downloaded - enter Buffering state + setProgressiveDownloadStalled(); + if (KErrNone != err) + setError(tr("Error opening file")); + } + break; + case Download::Complete: + break; + case Download::Error: + setError(tr("Download error")); + break; + } } Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index e795ecb..99fc101 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -23,6 +23,7 @@ along with this library. If not, see . #include #include #include "abstractplayer.h" +#include "download.h" class RFile; @@ -48,6 +49,7 @@ protected: public: virtual void open(); + virtual void close(); // MediaObjectInterface virtual void play(); @@ -55,6 +57,7 @@ public: virtual void stop(); virtual void seek(qint64 milliseconds); virtual bool isSeekable() const; + virtual qint64 currentTime() const; virtual void volumeChanged(qreal volume); protected: @@ -68,12 +71,15 @@ protected: virtual void doStop() = 0; virtual void doSeek(qint64 pos) = 0; virtual int setDeviceVolume(int mmfVolume) = 0; + virtual int openFile(const QString &fileName) = 0; virtual int openFile(RFile& file) = 0; virtual int openUrl(const QString& url) = 0; virtual int openDescriptor(const TDesC8 &des) = 0; virtual int bufferStatus() const = 0; + virtual void doClose() = 0; void updateMetaData(); + virtual qint64 getCurrentTime() const = 0; virtual int numberOfMetaDataEntries() const = 0; virtual QPair metaDataEntry(int index) const = 0; @@ -86,6 +92,9 @@ protected: static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &); + bool isProgressiveDownload() const; + bool progressiveDownloadStalled() const; + private: void startPositionTimer(); void stopPositionTimer(); @@ -96,6 +105,7 @@ private: void emitMarksIfReached(qint64 position); void resetMarksIfRewound(); void startPlayback(); + void setProgressiveDownloadStalled(); enum Pending { NothingPending, @@ -108,6 +118,8 @@ private: private Q_SLOTS: void positionTick(); void bufferStatusTick(); + void downloadLengthChanged(qint64); + void downloadStateChanged(Download::State); private: MediaObject *const m_parent; @@ -115,6 +127,7 @@ private: Pending m_pending; QScopedPointer m_positionTimer; + qint64 m_position; QScopedPointer m_bufferStatusTimer; PrivateState m_stateBeforeBuffering; @@ -127,6 +140,10 @@ private: // Used for playback of resource files TPtrC8 m_buffer; + // Used for progressive download + Download *m_download; + bool m_downloadStalled; + QMultiMap m_metaData; }; diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp index fb20bea..1ab5bae 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see . */ +#include #include #include #include @@ -132,6 +133,13 @@ int MMF::AbstractVideoPlayer::setDeviceVolume(int mmfVolume) return err; } +int MMF::AbstractVideoPlayer::openFile(const QString &fileName) +{ + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRAPD(err, m_player->OpenFileL(*nativeFileName)); + return err; +} + int MMF::AbstractVideoPlayer::openFile(RFile &file) { TRAPD(err, m_player->OpenFileL(file)); @@ -157,7 +165,7 @@ int MMF::AbstractVideoPlayer::bufferStatus() const return result; } -void MMF::AbstractVideoPlayer::close() +void MMF::AbstractVideoPlayer::doClose() { m_player->Close(); } @@ -167,9 +175,9 @@ bool MMF::AbstractVideoPlayer::hasVideo() const return true; } -qint64 MMF::AbstractVideoPlayer::currentTime() const +qint64 MMF::AbstractVideoPlayer::getCurrentTime() const { - TRACE_CONTEXT(AbstractVideoPlayer::currentTime, EVideoApi); + TRACE_CONTEXT(AbstractVideoPlayer::getCurrentTime, EVideoApi); TTimeIntervalMicroSeconds us; TRAPD(err, us = m_player->PositionL()) @@ -246,7 +254,9 @@ void MMF::AbstractVideoPlayer::MvpuoOpenComplete(TInt aError) TRACE_CONTEXT(AbstractVideoPlayer::MvpuoOpenComplete, EVideoApi); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); if (KErrNone == aError) m_player->Prepare(); @@ -261,7 +271,9 @@ void MMF::AbstractVideoPlayer::MvpuoPrepareComplete(TInt aError) TRACE_CONTEXT(AbstractVideoPlayer::MvpuoPrepareComplete, EVideoApi); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); TRAPD(err, getVideoClipParametersL(aError)); @@ -470,7 +482,7 @@ void MMF::AbstractVideoPlayer::updateScaleFactors(const QSize &windowSize, bool void MMF::AbstractVideoPlayer::parametersChanged(VideoParameters parameters) { - if (state() == LoadingState) + if (state() == LoadingState || progressiveDownloadStalled() && BufferingState == state()) m_pendingChanges |= parameters; else handleParametersChanged(parameters); diff --git a/src/3rdparty/phonon/mmf/abstractvideoplayer.h b/src/3rdparty/phonon/mmf/abstractvideoplayer.h index 3ff3c75..3bc5c7c 100644 --- a/src/3rdparty/phonon/mmf/abstractvideoplayer.h +++ b/src/3rdparty/phonon/mmf/abstractvideoplayer.h @@ -64,21 +64,22 @@ public: virtual void doStop(); virtual void doSeek(qint64 milliseconds); virtual int setDeviceVolume(int mmfVolume); + virtual int openFile(const QString &fileName); virtual int openFile(RFile &file); virtual int openUrl(const QString &url); virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; - virtual void close(); + virtual void doClose(); // MediaObjectInterface virtual bool hasVideo() const; - virtual qint64 currentTime() const; virtual qint64 totalTime() const; // AbstractPlayer virtual void videoOutputChanged(); // AbstractMediaPlayer + virtual qint64 getCurrentTime() const; virtual int numberOfMetaDataEntries() const; virtual QPair metaDataEntry(int index) const; diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 7c8b9bd..dc5c800 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -16,6 +16,7 @@ along with this library. If not, see . */ +#include #include #include "audioplayer.h" @@ -109,6 +110,13 @@ int MMF::AudioPlayer::setDeviceVolume(int mmfVolume) #endif } +int MMF::AudioPlayer::openFile(const QString &fileName) +{ + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRAPD(err, m_player->OpenFileL(*nativeFileName)); + return err; +} + int MMF::AudioPlayer::openFile(RFile& file) { TRAPD(err, m_player->OpenFileL(file)); @@ -150,7 +158,7 @@ int MMF::AudioPlayer::bufferStatus() const return result; } -void MMF::AudioPlayer::close() +void MMF::AudioPlayer::doClose() { m_player->Close(); } @@ -160,9 +168,9 @@ bool MMF::AudioPlayer::hasVideo() const return false; } -qint64 MMF::AudioPlayer::currentTime() const +qint64 MMF::AudioPlayer::getCurrentTime() const { - TRACE_CONTEXT(AudioPlayer::currentTime, EAudioApi); + TRACE_CONTEXT(AudioPlayer::getCurrentTime, EAudioApi); TTimeIntervalMicroSeconds us; const TInt err = m_player->GetPosition(us); @@ -203,7 +211,9 @@ void MMF::AudioPlayer::MapcInitComplete(TInt aError, TRACE_CONTEXT(AudioPlayer::MapcInitComplete, EAudioInternal); TRACE_ENTRY("state %d error %d", state(), aError); - __ASSERT_ALWAYS(LoadingState == state(), Utils::panic(InvalidStatePanic)); + __ASSERT_ALWAYS(LoadingState == state() || + progressiveDownloadStalled() && BufferingState == state(), + Utils::panic(InvalidStatePanic)); if (KErrNone == aError) { maxVolumeChanged(m_player->MaxVolume()); diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h index e43cadd..cf4f6d5 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.h +++ b/src/3rdparty/phonon/mmf/audioplayer.h @@ -65,18 +65,19 @@ typedef CMdaAudioPlayerUtility NativePlayer; virtual void doStop(); virtual void doSeek(qint64 milliseconds); virtual int setDeviceVolume(int mmfVolume); + virtual int openFile(const QString &fileName); virtual int openFile(RFile& file); virtual int openUrl(const QString& url); virtual int openDescriptor(const TDesC8 &des); virtual int bufferStatus() const; - virtual void close(); + virtual void doClose(); // MediaObjectInterface virtual bool hasVideo() const; - virtual qint64 currentTime() const; virtual qint64 totalTime() const; // AbstractMediaPlayer + virtual qint64 getCurrentTime() const; virtual int numberOfMetaDataEntries() const; virtual QPair metaDataEntry(int index) const; diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 98326b8..2c7a7ef 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -61,6 +61,9 @@ MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(paren TRACE_CONTEXT(MediaObject::MediaObject, EAudioApi); TRACE_ENTRY_0(); + const int err = m_fileServer.Connect(); + QT_TRAP_THROWING(User::LeaveIfError(err)); + Q_UNUSED(parent); TRACE_EXIT_0(); @@ -99,12 +102,6 @@ bool MMF::MediaObject::openRecognizer() return false; } - err = m_fileServer.Connect(); - if (KErrNone != err) { - TRACE("RFs::Connect error %d", err); - return false; - } - // This must be called in order to be able to share file handles with // the recognizer server (see fileMediaType function). err = m_fileServer.ShareProtected(); @@ -127,13 +124,8 @@ MMF::MediaType MMF::MediaObject::fileMediaType MediaType result = MediaTypeUnknown; if (openRecognizer()) { - - const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName)); - - Q_ASSERT(!m_file); - m_file = new RFile; - TInt err = m_file->Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); - + TInt err = openFileHandle(fileName); + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); if (KErrNone == err) { TDataRecognitionResult recognizerResult; err = m_recognizer.RecognizeData(*m_file, recognizerResult); @@ -141,16 +133,30 @@ MMF::MediaType MMF::MediaObject::fileMediaType const TPtrC mimeType = recognizerResult.iDataType.Des(); result = Utils::mimeTypeToMediaType(mimeType); } else { - TRACE("RApaLsSession::RecognizeData filename %S error %d", fileNameSymbian.data(), err); + TRACE("RApaLsSession::RecognizeData filename %S error %d", nativeFileName.data(), err); } } else { - TRACE("RFile::Open filename %S error %d", fileNameSymbian.data(), err); + TRACE("RFile::Open filename %S error %d", nativeFileName.data(), err); } } return result; } +int MMF::MediaObject::openFileHandle(const QString &fileName) +{ + TRACE_CONTEXT(MediaObject::openFileHandle, EAudioInternal); + const QHBufC nativeFileName(QDir::toNativeSeparators(fileName)); + TRACE_ENTRY("filename %S", nativeFileName.data()); + if (m_file) + m_file->Close(); + delete m_file; + m_file = 0; + m_file = new RFile; + TInt err = m_file->Open(m_fileServer, *nativeFileName, EFileRead | EFileShareReadersOrWriters); + return err; +} + MMF::MediaType MMF::MediaObject::bufferMediaType(const uchar *data, qint64 size) { TRACE_CONTEXT(MediaObject::bufferMediaType, EAudioInternal); diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 5399e27..5d785fb 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -89,6 +89,7 @@ public: void setVideoOutput(AbstractVideoOutput* videoOutput); + int openFileHandle(const QString &fileName); RFile* file() const; QResource* resource() const; -- cgit v0.12 From d1b6c5d5e101c9ffdfdfb7b712ea69025150ab05 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Mon, 27 Sep 2010 18:07:35 +0100 Subject: qmediaplayer: show buffer status of 0% During progressive download, it is not possible for the Symbian MMF Phonon backend to determine the buffering status, so it returns a value of 0%. This change causes qmediaplayer to display this value in the UI, thereby giving a visible notification of buffering during progressive download. Task-number: QTBUG-10769 Reviewed-by: Derick Hawcroft --- demos/qmediaplayer/mediaplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index 3cb0616..97a8e35 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -716,7 +716,7 @@ void MediaPlayer::openFile() void MediaPlayer::bufferStatus(int percent) { - if (percent == 0 || percent == 100) + if (percent == 100) progressLabel->setText(QString()); else { QString str = QString::fromLatin1("(%1%)").arg(percent); -- cgit v0.12 From 71af72bc037db6bac023bf9a0bbf6032c06b2d29 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Sun, 3 Oct 2010 19:43:29 +0100 Subject: Added qmake check for presence of RHttpDownloadMgr header downloadmgrclient.h is not found on S^4 baselines, causing a build failure. This commit is a temporary workaround, which disables progressive download support if the header is not found. The correct solution is to determine whether the RHttpDownloadMgr definition has moved, and if so, to modify the .pro file to include the new path. Task-number: QTBUG-10769 Reviewed-by: TrustMe --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 26 ++++++++++-- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 9 ++++- src/3rdparty/phonon/mmf/download.h | 2 - src/plugins/phonon/mmf/mmf.pro | 53 +++++++++++++++---------- 4 files changed, 61 insertions(+), 29 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index a728423..dfc5840 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -56,8 +56,10 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer , m_mmfMaxVolume(NullMaxVolume) , m_prefinishMarkSent(false) , m_aboutToFinishSent(false) +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD , m_download(0) , m_downloadStalled(false) +#endif { connect(m_positionTimer.data(), SIGNAL(timeout()), this, SLOT(positionTick())); connect(m_bufferStatusTimer.data(), SIGNAL(timeout()), this, SLOT(bufferStatusTick())); @@ -256,7 +258,9 @@ void MMF::AbstractMediaPlayer::open() symbianErr = openFile(*file); if (KErrNone != symbianErr) errorMessage = tr("Error opening file"); - } else if (url.scheme() == QLatin1String("http")) { + } +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD + else if (url.scheme() == QLatin1String("http")) { Q_ASSERT(!m_download); m_download = new Download(url, this); connect(m_download, SIGNAL(lengthChanged(qint64)), @@ -264,7 +268,9 @@ void MMF::AbstractMediaPlayer::open() connect(m_download, SIGNAL(stateChanged(Download::State)), this, SLOT(downloadStateChanged(Download::State))); m_download->start(); - } else { + } +#endif + else { symbianErr = openUrl(url.toString()); if (KErrNone != symbianErr) errorMessage = tr("Error opening URL"); @@ -308,8 +314,10 @@ void MMF::AbstractMediaPlayer::open() void MMF::AbstractMediaPlayer::close() { doClose(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD delete m_download; m_download = 0; +#endif m_position = 0; } @@ -419,7 +427,9 @@ void MMF::AbstractMediaPlayer::loadingComplete(int error) bufferingComplete(); doSeek(m_position); startPlayback(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD m_downloadStalled = false; +#endif } } else { Q_ASSERT(Phonon::LoadingState == state()); @@ -472,12 +482,20 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds bool MMF::AbstractMediaPlayer::isProgressiveDownload() const { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD return (0 != m_download); +#else + return false; +#endif } bool MMF::AbstractMediaPlayer::progressiveDownloadStalled() const { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD return m_downloadStalled; +#else + return false; +#endif } //----------------------------------------------------------------------------- @@ -547,6 +565,7 @@ void MMF::AbstractMediaPlayer::startPlayback() void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() { +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD TRACE_CONTEXT(AbstractMediaPlayer::setProgressiveDownloadStalled, EAudioApi); TRACE_ENTRY("state %d", state()); Q_ASSERT(isProgressiveDownload()); @@ -555,7 +574,6 @@ void MMF::AbstractMediaPlayer::setProgressiveDownloadStalled() bufferingStarted(); // Video player loses window handle when closed - need to reapply it here videoOutputChanged(); -#ifdef QT_PHONON_MMF_DOWNLOAD_DUMMY m_download->resume(); #endif } @@ -569,6 +587,7 @@ void MMF::AbstractMediaPlayer::bufferStatusTick() emit MMF::AbstractPlayer::bufferStatus(status); } +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD void MMF::AbstractMediaPlayer::downloadLengthChanged(qint64 length) { TRACE_CONTEXT(AbstractMediaPlayer::downloadLengthChanged, EAudioApi); @@ -611,6 +630,7 @@ void MMF::AbstractMediaPlayer::downloadStateChanged(Download::State state) break; } } +#endif // PHONON_MMF_PROGRESSIVE_DOWNLOAD Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) const { diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 99fc101..c3b4528 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -23,7 +23,9 @@ along with this library. If not, see . #include #include #include "abstractplayer.h" -#include "download.h" +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD +# include "download.h" +#endif class RFile; @@ -118,8 +120,10 @@ private: private Q_SLOTS: void positionTick(); void bufferStatusTick(); +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD void downloadLengthChanged(qint64); void downloadStateChanged(Download::State); +#endif private: MediaObject *const m_parent; @@ -140,9 +144,10 @@ private: // Used for playback of resource files TPtrC8 m_buffer; - // Used for progressive download +#ifdef PHONON_MMF_PROGRESSIVE_DOWNLOAD Download *m_download; bool m_downloadStalled; +#endif QMultiMap m_metaData; diff --git a/src/3rdparty/phonon/mmf/download.h b/src/3rdparty/phonon/mmf/download.h index b57348b..bda7963 100644 --- a/src/3rdparty/phonon/mmf/download.h +++ b/src/3rdparty/phonon/mmf/download.h @@ -70,8 +70,6 @@ public: const QUrl &sourceUrl() const; const QString &targetFileName() const; void start(); - - // Only has effect when QT_PHONON_MMF_DOWNLOAD_DUMMY is defined void resume(); enum State { diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro index 902354f..ac11188 100644 --- a/src/plugins/phonon/mmf/mmf.pro +++ b/src/plugins/phonon/mmf/mmf.pro @@ -36,7 +36,6 @@ symbian { $$PHONON_MMF_DIR/backend.h \ $$PHONON_MMF_DIR/bassboost.h \ $$PHONON_MMF_DIR/defs.h \ - $$PHONON_MMF_DIR/download.h \ $$PHONON_MMF_DIR/dummyplayer.h \ $$PHONON_MMF_DIR/effectfactory.h \ $$PHONON_MMF_DIR/effectparameter.h \ @@ -62,7 +61,6 @@ symbian { $$PHONON_MMF_DIR/abstractvideoplayer.cpp \ $$PHONON_MMF_DIR/backend.cpp \ $$PHONON_MMF_DIR/bassboost.cpp \ - $$PHONON_MMF_DIR/download.cpp \ $$PHONON_MMF_DIR/dummyplayer.cpp \ $$PHONON_MMF_DIR/effectfactory.cpp \ $$PHONON_MMF_DIR/effectparameter.cpp \ @@ -77,25 +75,37 @@ symbian { $$PHONON_MMF_DIR/utils.cpp \ $$PHONON_MMF_DIR/videowidget.cpp - # Test for whether the build environment supports video rendering to graphics - # surfaces. - symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) { - HEADERS += \ - $$PHONON_MMF_DIR/videooutput_surface.h \ - $$PHONON_MMF_DIR/videoplayer_surface.h - SOURCES += \ - $$PHONON_MMF_DIR/videooutput_surface.cpp \ - $$PHONON_MMF_DIR/videoplayer_surface.cpp - DEFINES += PHONON_MMF_VIDEO_SURFACES - } else { - HEADERS += \ - $$PHONON_MMF_DIR/ancestormovemonitor.h \ - $$PHONON_MMF_DIR/videooutput_dsa.h \ - $$PHONON_MMF_DIR/videoplayer_dsa.h - SOURCES += \ - $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ - $$PHONON_MMF_DIR/videooutput_dsa.cpp \ - $$PHONON_MMF_DIR/videoplayer_dsa.cpp \ + symbian { + # Test for whether the build environment supports video rendering to graphics + # surfaces. + exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) { + HEADERS += \ + $$PHONON_MMF_DIR/videooutput_surface.h \ + $$PHONON_MMF_DIR/videoplayer_surface.h + SOURCES += \ + $$PHONON_MMF_DIR/videooutput_surface.cpp \ + $$PHONON_MMF_DIR/videoplayer_surface.cpp + DEFINES += PHONON_MMF_VIDEO_SURFACES + } else { + HEADERS += \ + $$PHONON_MMF_DIR/ancestormovemonitor.h \ + $$PHONON_MMF_DIR/videooutput_dsa.h \ + $$PHONON_MMF_DIR/videoplayer_dsa.h + SOURCES += \ + $$PHONON_MMF_DIR/ancestormovemonitor.cpp \ + $$PHONON_MMF_DIR/videooutput_dsa.cpp \ + $$PHONON_MMF_DIR/videoplayer_dsa.cpp \ + } + + # Test whether the build environment includes support for the Download Manager + # API, required for Progressive Download + exists($${EPOCROOT}epoc32/include/downloadmgrclient.h) | \ + exists($${EPOCROOT}epoc32/include/mw/downloadmgrclient.h) { + HEADERS += $$PHONON_MMF_DIR/download.h + SOURCES += $$PHONON_MMF_DIR/download.cpp + LIBS += -ldownloadmgr + DEFINES += PHONON_MMF_PROGRESSIVE_DOWNLOAD + } } LIBS += -lcone @@ -113,7 +123,6 @@ symbian { LIBS += -lapgrfx -lapmime # For recognizer LIBS += -lmmfcontrollerframework # For CMMFMetaDataEntry LIBS += -lmediaclientaudiostream # For CMdaAudioOutputStream - LIBS += -ldownloadmgr # These are for effects. LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect -- cgit v0.12 From 978416807b7e92d9317036cb4348ee172dde7d4e Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Fri, 8 Oct 2010 09:08:54 +0200 Subject: Fix memory leak in QPixmap::toSymbianRSgImage() when an error occurs. In the cases where an error occured while converting a QPixmap to a VGImage this function would return without deleting the RSgImage pointer that it created. Fix is to use a QScopedPointer instead. Also don't use q_check_ptr() since this isn't a CBase derived class. In case you are wondering why I didn't use a custom deleter here so that Close() was also called, we need to make sure that Close() is called on the RSgImage instance before calling Close() on the driver. Reviewed-by: mread --- src/openvg/qvg_symbian.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp index ef0160c..a9625b2 100644 --- a/src/openvg/qvg_symbian.cpp +++ b/src/openvg/qvg_symbian.cpp @@ -228,7 +228,7 @@ void* QVGPixmapData::toNativeType(NativeType type) sgInfo.iSizeInPixels.SetSize(w, h); sgInfo.iUsage = ESgUsageBitOpenVgImage | ESgUsageBitOpenVgSurface; - RSgImage *sgImage = q_check_ptr(new RSgImage()); + QScopedPointer sgImage(new RSgImage()); err = sgImage->Create(sgInfo, NULL, NULL); if (err != KErrNone) { driver.Close(); @@ -239,7 +239,7 @@ void* QVGPixmapData::toNativeType(NativeType type) EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, - (EGLClientBuffer)sgImage, + (EGLClientBuffer)sgImage.data(), (EGLint*)KEglImageAttribs); if (!eglImage || eglGetError() != EGL_SUCCESS) { sgImage->Close(); @@ -261,13 +261,14 @@ void* QVGPixmapData::toNativeType(NativeType type) if (vgGetError() != VG_NO_ERROR) { sgImage->Close(); - sgImage = 0; + sgImage.reset(); } + // release stuff vgDestroyImage(dstVgImage); QEgl::eglDestroyImageKHR(QEgl::display(), eglImage); driver.Close(); - return reinterpret_cast(sgImage); + return reinterpret_cast(sgImage.take()); #endif } else if (type == QPixmapData::FbsBitmap) { CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); -- cgit v0.12 From 4cff91c66207b870e12365421e63cd978e162e64 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 8 Oct 2010 10:55:54 +0200 Subject: Fix infinite loop when justifying undisplayable Arabic text If the Arabic text is for some reason undisplayable, e.g. because of QTBUG-13132, the font engine will be unable to find the tatweel character and the kashida width may be returned as 0. This would potentially cause an infinite loop, as "need" would remain >= minKashida forever because x - 0 is still >= 0. Task-number: QTBUG-13130 Reviewed-by: Lars --- src/gui/text/qtextengine.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 05de8f5..3bd6122 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1949,9 +1949,11 @@ void QTextEngine::justify(const QScriptLine &line) if (kashida_pos >= 0) { // qDebug("kashida position at %d in word", kashida_pos); set(&justificationPoints[nPoints], kashida_type, g.mid(kashida_pos), fontEngine(si)); - minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); - maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); - ++nPoints; + if (justificationPoints[nPoints].kashidaWidth > 0) { + minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); + maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); + ++nPoints; + } } kashida_pos = -1; kashida_type = HB_Arabic_Normal; @@ -1975,9 +1977,11 @@ void QTextEngine::justify(const QScriptLine &line) } if (kashida_pos >= 0) { set(&justificationPoints[nPoints], kashida_type, g.mid(kashida_pos), fontEngine(si)); - minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); - maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); - ++nPoints; + if (justificationPoints[nPoints].kashidaWidth > 0) { + minKashida = qMin(minKashida, justificationPoints[nPoints].kashidaWidth); + maxJustify = qMax(maxJustify, justificationPoints[nPoints].type); + ++nPoints; + } } } -- cgit v0.12 From 269821d9a1eda2893f84fdeff76edef576f9847d Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 8 Oct 2010 11:12:52 +0300 Subject: Inconsistency with deployment keyword .sources and .files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DEPLOYMENT instruction uses .sources, while INSTALLS uses .files. This is inconsistent, and we fix it in Qt 4 by adding .files as a supported alternative for DEPLOYMENT. This commit will be followed by a second, which aligns Qt build system. For Qt 5, this needs to be cleaned up by removing support for .sources. Task-number: QTBUG-3216 Reviewed-by: João Abecasis Cherry-picked from 730a5d562fcb7be6428458962456033054f99e4c by Frans Englich. Conflicts: qmake/generators/symbian/initprojectdeploy_symbian.cpp --- doc/src/snippets/code/doc_src_qmake-manual.qdoc | 16 ++++++++-------- qmake/generators/symbian/initprojectdeploy_symbian.cpp | 3 ++- qmake/generators/symbian/symbian_makefile.h | 4 +++- qmake/generators/symbian/symmake.cpp | 4 +++- qmake/generators/win32/msvc_vcproj.cpp | 3 ++- tools/qtestlib/wince/cetest/deployment.cpp | 10 +++++----- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 4f74e9c..1d2fbb4 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -193,15 +193,15 @@ DEFINES += USE_MY_STUFF QT_DLL //! [28] -myFiles.sources = path\*.png +myFiles.files = path\*.png DEPLOYMENT += myFiles //! [28] //! [29] -myFiles.sources = path\file1.ext1 path2\file2.ext1 path3\* +myFiles.files = path\file1.ext1 path2\file2.ext1 path3\* myFiles.path = \some\path\on\device -someother.sources = C:\additional\files\* +someother.files = C:\additional\files\* someother.path = \myFiles\path2 DEPLOYMENT += myFiles someother //! [29] @@ -849,12 +849,12 @@ CONFIG(debug, debug|release) { //! [127] //! [128] -customplugin.sources = customimageplugin.dll -customplugin.sources += c:\myplugins\othercustomimageplugin.dll +customplugin.files = customimageplugin.dll +customplugin.files += c:\myplugins\othercustomimageplugin.dll customplugin.path = imageformats -dynamiclibrary.sources = mylib.dll helper.exe +dynamiclibrary.files = mylib.dll helper.exe dynamiclibrary.path = \sys\bin -globalplugin.sources = someglobalimageplugin.dll +globalplugin.files = someglobalimageplugin.dll globalplugin.path = \resource\qt\plugins\imageformats DEPLOYMENT += customplugin dynamiclibrary globalplugin //! [128] @@ -923,7 +923,7 @@ MMP_RULES += myIfdefBlock //! [139] //! [140] -somelib.sources = somelib.dll +somelib.files = somelib.dll somelib.path = \sys\bin somelib.pkg_prerules = "(0x12345678), 2, 2, 0, {\"Some Package\"}" \ "(0x87654321), 1, *, * ~ 2, 2, 0, {\"Some Other Package\"}" diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 5a6f66f..cd51e42 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -250,7 +250,8 @@ void initProjectDeploySymbian(QMakeProject* project, QStringList flags = project->values(item + ".flags"); - foreach(QString source, project->values(item + ".sources")) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + foreach(QString source, project->values(item + ".sources") + project->values(item + ".files")) { source = Option::fixPathToLocalOS(source); QString nameFilter; QFileInfo info(source); diff --git a/qmake/generators/symbian/symbian_makefile.h b/qmake/generators/symbian/symbian_makefile.h index 94f0145..63cede2 100644 --- a/qmake/generators/symbian/symbian_makefile.h +++ b/qmake/generators/symbian/symbian_makefile.h @@ -72,7 +72,9 @@ public: } else { const QStringList deployments = this->project->values("DEPLOYMENT"); for (int i = 0; i < deployments.count(); ++i) { - if (!this->project->values(deployments.at(i) + ".sources").isEmpty()) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + if (!this->project->values(deployments.at(i) + ".sources").isEmpty() || + !this->project->values(deployments.at(i) + ".files").isEmpty()) { generatePkg = true; break; } diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 09a3fc8..0d63cdf 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -197,7 +197,9 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) generatePkg = true; } else { foreach(QString item, project->values("DEPLOYMENT")) { - if (!project->values(item + ".sources").isEmpty()) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + if (!project->values(item + ".sources").isEmpty() || + !project->values(item + ".files").isEmpty()) { generatePkg = true; break; } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 06b726f..8582ce1 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1174,7 +1174,8 @@ void VcprojGenerator::initDeploymentTool() devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('\\') + devicePath)); } // foreach d in item.sources - foreach(QString source, project->values(item + ".sources")) { + // ### Qt 5: remove .sources, inconsistent with INSTALLS + foreach(QString source, project->values(item + ".sources") + project->values(item + ".files")) { QString itemDevicePath = devicePath; source = Option::fixPathToLocalOS(source); QString nameFilter; diff --git a/tools/qtestlib/wince/cetest/deployment.cpp b/tools/qtestlib/wince/cetest/deployment.cpp index 95768f9..e74c72b 100644 --- a/tools/qtestlib/wince/cetest/deployment.cpp +++ b/tools/qtestlib/wince/cetest/deployment.cpp @@ -227,9 +227,9 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList return; for (int it = 0; it < list.size(); ++it) { - QString argSource = list.at(it) + QString(".sources"); + QString argSource = list.at(it); QString argPath = list.at(it) + QString(".path"); - if ((project->values(argSource).isEmpty() || project->values(argPath).isEmpty()) && list.at(it) != "deploy") { + if (((project->values(argSource + QString(".files")).isEmpty() && project->values(argSource + QString(".sources")).isEmpty()) || project->values(argPath).isEmpty()) && list.at(it) != "deploy") { debugOutput(QString::fromLatin1("cannot deploy \"%1\" because of missing data.").arg(list.at(it)), 0); continue; } @@ -240,7 +240,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList if (!addPath.startsWith("/") && !addPath.startsWith(QLatin1String("\\"))) addPath = targetPath + "/" + addPath; - QStringList addSources = project->values(argSource); + QStringList addSources = project->values(argSource + QString(".files")) + project->values(argSource + QString(".sources")); addSources.replaceInStrings(QLatin1String("/"), QLatin1String("\\")); for(int index=0; index < addSources.size(); ++index) { QString dirstr = qmake_getpwd(); @@ -264,7 +264,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList continue; } QString appendedQmakeDeploy = QString::fromLatin1("_q_make_additional_deploy_%1").arg(addQMakeDeployCounter++); - project->parse(appendedQmakeDeploy + QLatin1String(".sources = \"") + wildInfo.absoluteFilePath()); + project->parse(appendedQmakeDeploy + QLatin1String(".files = \"") + wildInfo.absoluteFilePath()); project->parse(appendedQmakeDeploy + QLatin1String(".path = \"") + addPath); list.append(appendedQmakeDeploy); } @@ -276,7 +276,7 @@ void DeploymentHandler::initProjectDeploy(QMakeProject* project, DeploymentList QStringList additionalEntries = additionalDir.entryList(QDir::NoDotAndDotDot | QDir::AllEntries | QDir::NoSymLinks); foreach(QString item, additionalEntries) { QString appendedDeploy = QString::fromLatin1("_q_make_additional_deploy_%1").arg(addQMakeDeployCounter++); - project->parse(appendedDeploy + QLatin1String(".sources = \"") + Option::fixPathToLocalOS(additionalDir.absoluteFilePath(item)) + QLatin1String("\"")); + project->parse(appendedDeploy + QLatin1String(".files = \"") + Option::fixPathToLocalOS(additionalDir.absoluteFilePath(item)) + QLatin1String("\"")); QString appendTargetPath = project->values(argPath).join(QLatin1String(" ")); if (appendTargetPath == QLatin1String(".")) appendTargetPath = filestr; -- cgit v0.12 From f8596b2269631b9522e51bb0a68d86588d4696c7 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 8 Oct 2010 12:58:41 +0300 Subject: Align .pro with qmake: s/\.sources/.files/. Complement previous commit by aligning Qt itself to use .files consistently for DEPLOYMENT as well as INSTALLS. This excludes changes to webkit. Task-number: QTBUG-3216 Reviewed-by: axis --- demos/books/books.pro | 4 +- demos/declarative/minehunt/minehunt.pro | 2 +- demos/embedded/desktopservices/desktopservices.pro | 4 +- demos/embedded/fluidlauncher/fluidlauncher.pro | 80 +++++++++++----------- demos/embedded/qmlcalculator/deployment.pri | 2 +- demos/embedded/qmlclocks/deployment.pri | 2 +- demos/embedded/qmldialcontrol/deployment.pri | 2 +- demos/embedded/qmleasing/deployment.pri | 2 +- demos/embedded/qmlflickr/deployment.pri | 2 +- demos/embedded/qmlphotoviewer/deployment.pri | 2 +- demos/embedded/qmltwitter/deployment.pri | 2 +- demos/qmediaplayer/qmediaplayer.pro | 2 +- demos/spectrum/app/app.pro | 2 +- doc/src/snippets/code/doc_src_qmake-manual.qdoc | 2 +- .../cppextensions/imageprovider/imageprovider.pro | 2 +- .../cppextensions/qwidgets/qwidgets.pro | 2 +- examples/desktop/systray/systray.pro | 4 +- examples/draganddrop/puzzle/puzzle.pro | 4 +- examples/painting/svgviewer/svgviewer.pro | 4 +- .../syntaxhighlighter/syntaxhighlighter.pro | 2 +- examples/richtext/textobject/textobject.pro | 2 +- examples/script/context2d/context2d.pro | 2 +- examples/widgets/icons/icons.pro | 2 +- examples/widgets/movie/movie.pro | 2 +- examples/xml/dombookmarks/dombookmarks.pro | 2 +- examples/xml/htmlinfo/htmlinfo.pro | 2 +- examples/xml/saxbookmarks/saxbookmarks.pro | 4 +- mkspecs/features/qt.prf | 4 +- mkspecs/features/symbian/application_icon.prf | 6 +- mkspecs/features/symbian/data_caging_paths.prf | 4 +- mkspecs/features/symbian/default_post.prf | 2 +- mkspecs/features/symbian/run_on_phone.prf | 3 +- mkspecs/features/symbian/sis_targets.prf | 3 +- src/imports/folderlistmodel/folderlistmodel.pro | 4 +- src/imports/gestures/gestures.pro | 4 +- src/imports/particles/particles.pro | 4 +- src/qbase.pri | 2 +- src/s60installs/s60installs.pro | 56 +++++++-------- tests/arthur/lance/lance.pro | 2 +- tests/auto/checkxmlfiles/checkxmlfiles.pro | 2 +- tests/auto/declarative/examples/examples.pro | 2 +- tests/auto/declarative/moduleqt47/moduleqt47.pro | 2 +- .../auto/declarative/parserstress/parserstress.pro | 2 +- .../qdeclarativeanchors/qdeclarativeanchors.pro | 2 +- .../qdeclarativeanimatedimage.pro | 2 +- .../qdeclarativeanimations.pro | 2 +- .../qdeclarativebehaviors.pro | 2 +- .../qdeclarativebinding/qdeclarativebinding.pro | 2 +- .../qdeclarativeborderimage.pro | 2 +- .../qdeclarativeconnection.pro | 2 +- .../qdeclarativedom/qdeclarativedom.pro | 2 +- .../qdeclarativeecmascript.pro | 2 +- .../qdeclarativeflickable.pro | 2 +- .../qdeclarativeflipable/qdeclarativeflipable.pro | 2 +- .../qdeclarativefocusscope.pro | 2 +- .../qdeclarativefolderlistmodel.pro | 2 +- .../qdeclarativefontloader.pro | 2 +- .../qdeclarativegridview/qdeclarativegridview.pro | 2 +- .../qdeclarativeimage/qdeclarativeimage.pro | 2 +- .../qdeclarativeinfo/qdeclarativeinfo.pro | 2 +- .../qdeclarativeitem/qdeclarativeitem.pro | 2 +- .../qdeclarativelanguage/qdeclarativelanguage.pro | 2 +- .../qdeclarativelayoutitem.pro | 2 +- .../qdeclarativelistmodel.pro | 2 +- .../qdeclarativelistview/qdeclarativelistview.pro | 2 +- .../qdeclarativeloader/qdeclarativeloader.pro | 2 +- .../tst_qdeclarativemoduleplugin.pro | 2 +- .../qdeclarativemousearea.pro | 2 +- .../qdeclarativeparticles.pro | 2 +- .../qdeclarativepathview/qdeclarativepathview.pro | 2 +- .../qdeclarativepixmapcache.pro | 2 +- .../qdeclarativepositioners.pro | 2 +- .../qdeclarativeproperty/qdeclarativeproperty.pro | 2 +- .../declarative/qdeclarativeqt/qdeclarativeqt.pro | 2 +- .../qdeclarativerepeater/qdeclarativerepeater.pro | 2 +- .../qdeclarativescriptdebugging.pro | 2 +- .../qdeclarativesmoothedanimation.pro | 2 +- .../qdeclarativespringanimation.pro | 2 +- .../qdeclarativesqldatabase.pro | 2 +- .../qdeclarativestates/qdeclarativestates.pro | 2 +- .../qdeclarativetext/qdeclarativetext.pro | 2 +- .../qdeclarativetextedit/qdeclarativetextedit.pro | 2 +- .../qdeclarativetextinput.pro | 2 +- .../qdeclarativevaluetypes.pro | 2 +- .../qdeclarativeview/qdeclarativeview.pro | 2 +- .../qdeclarativeviewer/qdeclarativeviewer.pro | 2 +- .../qdeclarativevisualdatamodel.pro | 2 +- .../qdeclarativewebview/qdeclarativewebview.pro | 2 +- .../qdeclarativeworkerscript.pro | 2 +- .../qdeclarativexmlhttprequest.pro | 2 +- .../qdeclarativexmllistmodel.pro | 2 +- tests/auto/declarative/qmlvisual/qmlvisual.pro | 2 +- tests/auto/mediaobject/mediaobject.pro | 2 +- tests/auto/networkselftest/networkselftest.pro | 4 +- .../auto/patternistexamples/patternistexamples.pro | 12 ++-- .../qabstractnetworkcache.pro | 2 +- .../qabstractxmlnodemodel.pro | 2 +- tests/auto/qaccessibility/qaccessibility.pro | 2 +- tests/auto/qapplication/test/test.pro | 10 +-- tests/auto/qaudioinput/qaudioinput.pro | 2 +- tests/auto/qaudiooutput/qaudiooutput.pro | 2 +- tests/auto/qbytearray/qbytearray.pro | 2 +- tests/auto/qchar/qchar.pro | 2 +- tests/auto/qclipboard/test/test.pro | 12 ++-- tests/auto/qcssparser/qcssparser.pro | 4 +- tests/auto/qdatastream/qdatastream.pro | 4 +- tests/auto/qdesktopservices/qdesktopservices.pro | 12 ++-- tests/auto/qdir/qdir.pro | 2 +- tests/auto/qdiriterator/qdiriterator.pro | 2 +- tests/auto/qdirmodel/qdirmodel.pro | 6 +- tests/auto/qdom/qdom.pro | 2 +- tests/auto/qfile/test/test.pro | 4 +- tests/auto/qfiledialog/qfiledialog.pro | 4 +- tests/auto/qfiledialog2/qfiledialog2.pro | 4 +- tests/auto/qfileinfo/qfileinfo.pro | 4 +- tests/auto/qfilesystemmodel/qfilesystemmodel.pro | 2 +- tests/auto/qfontdatabase/qfontdatabase.pro | 2 +- tests/auto/qftp/qftp.pro | 4 +- tests/auto/qgraphicsscene/qgraphicsscene.pro | 4 +- tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro | 4 +- tests/auto/qhelpenginecore/qhelpenginecore.pro | 4 +- tests/auto/qhttp/qhttp.pro | 12 ++-- tests/auto/qicoimageformat/qicoimageformat.pro | 10 +-- tests/auto/qicon/qicon.pro | 12 ++-- tests/auto/qimage/qimage.pro | 6 +- tests/auto/qimagereader/qimagereader.pro | 8 +-- tests/auto/qimagewriter/qimagewriter.pro | 6 +- tests/auto/qiodevice/qiodevice.pro | 4 +- tests/auto/qitemmodel/qitemmodel.pro | 4 +- tests/auto/qlabel/qlabel.pro | 2 +- tests/auto/qlayout/qlayout.pro | 2 +- tests/auto/qlibrary/tst/tst.pro | 6 +- tests/auto/qlocale/test/test.pro | 2 +- tests/auto/qlocalsocket/test/test.pro | 6 +- tests/auto/qmovie/qmovie.pro | 6 +- tests/auto/qnetworkreply/test/test.pro | 6 +- tests/auto/qobject/tst_qobject.pro | 4 +- tests/auto/qpainter/qpainter.pro | 2 +- tests/auto/qpixmap/qpixmap.pro | 8 +-- tests/auto/qpixmapfilter/qpixmapfilter.pro | 2 +- tests/auto/qplugin/tst_qplugin.pro | 4 +- tests/auto/qpluginloader/tst/tst.pro | 6 +- tests/auto/qprocess/test/test.pro | 40 +++++------ tests/auto/qresourceengine/qresourceengine.pro | 18 ++--- tests/auto/qscriptengine/qscriptengine.pro | 2 +- .../auto/qscriptjstestsuite/qscriptjstestsuite.pro | 2 +- .../auto/qscriptv8testsuite/qscriptv8testsuite.pro | 2 +- tests/auto/qsound/qsound.pro | 2 +- tests/auto/qsplitter/qsplitter.pro | 2 +- tests/auto/qsql/qsql.pro | 2 +- tests/auto/qsqldatabase/qsqldatabase.pro | 4 +- tests/auto/qsqldriver/qsqldriver.pro | 4 +- tests/auto/qsqlerror/qsqlerror.pro | 2 +- tests/auto/qsqlfield/qsqlfield.pro | 2 +- tests/auto/qsqlquery/qsqlquery.pro | 4 +- tests/auto/qsqlquerymodel/qsqlquerymodel.pro | 2 +- tests/auto/qsqlrecord/qsqlrecord.pro | 2 +- .../qsqlrelationaltablemodel.pro | 4 +- tests/auto/qsqltablemodel/qsqltablemodel.pro | 4 +- tests/auto/qsqlthread/qsqlthread.pro | 4 +- tests/auto/qsslcertificate/qsslcertificate.pro | 2 +- tests/auto/qsslkey/qsslkey.pro | 4 +- tests/auto/qsslsocket/qsslsocket.pro | 4 +- tests/auto/qstyle/qstyle.pro | 2 +- tests/auto/qsvggenerator/qsvggenerator.pro | 2 +- tests/auto/qsvgrenderer/qsvgrenderer.pro | 2 +- tests/auto/qtcpserver/test/test.pro | 4 +- tests/auto/qtemporaryfile/qtemporaryfile.pro | 2 +- .../qtextboundaryfinder/qtextboundaryfinder.pro | 2 +- tests/auto/qtextbrowser/qtextbrowser.pro | 4 +- tests/auto/qtextcodec/test/test.pro | 2 +- tests/auto/qtextedit/qtextedit.pro | 2 +- tests/auto/qtextstream/test/test.pro | 6 +- tests/auto/qtipc/qsharedmemory/test/test.pro | 6 +- .../qtipc/qsystemsemaphore/qsystemsemaphore.pro | 4 +- tests/auto/qtranslator/qtranslator.pro | 2 +- tests/auto/qudpsocket/test/test.pro | 2 +- tests/auto/quuid/test/test.pro | 4 +- tests/auto/qxml/qxml.pro | 2 +- tests/auto/qxmlformatter/qxmlformatter.pro | 2 +- tests/auto/qxmlquery/qxmlquery.pro | 4 +- tests/auto/qxmlsimplereader/qxmlsimplereader.pro | 2 +- tests/auto/qxmlstream/qxmlstream.pro | 2 +- tests/auto/qzip/qzip.pro | 2 +- tests/auto/uiloader/uiloader/uiloader.pro | 4 +- tests/auto/windowsmobile/test/test.pro | 2 +- tests/auto/xmlpatterns.pri | 4 +- .../xmlpatternsdiagnosticsts.pro | 2 +- tests/auto/xmlpatternsview/xmlpatternsview.pro | 2 +- tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro | 2 +- .../corelib/codecs/qtextcodec/qtextcodec.pro | 2 +- .../corelib/io/qdiriterator/qdiriterator.pro | 2 +- tests/benchmarks/corelib/tools/qstring/qstring.pro | 2 +- tests/benchmarks/declarative/binding/binding.pro | 2 +- .../declarative/compilation/compilation.pro | 2 +- tests/benchmarks/declarative/creation/creation.pro | 2 +- .../qdeclarativecomponent.pro | 2 +- .../qdeclarativeimage/qdeclarativeimage.pro | 2 +- .../qdeclarativemetaproperty.pro | 2 +- tests/benchmarks/declarative/qmltime/qmltime.pro | 2 +- tests/benchmarks/declarative/script/script.pro | 2 +- .../declarative/typeimports/typeimports.pro | 2 +- .../graphicsview/qgraphicsview/qgraphicsview.pro | 2 +- .../gui/image/qimagereader/qimagereader.pro | 6 +- tests/benchmarks/gui/text/qtext/qtext.pro | 2 +- .../textrendering/glyphshaping/glyphshaping.pro | 2 +- 206 files changed, 405 insertions(+), 403 deletions(-) diff --git a/demos/books/books.pro b/demos/books/books.pro index a5e44e5..06718d1 100644 --- a/demos/books/books.pro +++ b/demos/books/books.pro @@ -16,8 +16,8 @@ INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) wince*: { - CONFIG(debug, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll - CONFIG(release, debug|release):sqlPlugins.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll + CONFIG(debug, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll + CONFIG(release, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll sqlPlugins.path = sqldrivers DEPLOYMENT += sqlPlugins } diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index 753ca4e..7984315 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -18,7 +18,7 @@ symbian:{ TARGET.EPOCALLOWDLLDATA = 1 TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - qmlminehuntfiles.sources = MinehuntCore minehunt.qml + qmlminehuntfiles.files = MinehuntCore minehunt.qml DEPLOYMENT = qmlminehuntfiles } \ No newline at end of file diff --git a/demos/embedded/desktopservices/desktopservices.pro b/demos/embedded/desktopservices/desktopservices.pro index 94ddedd..e66db1c 100644 --- a/demos/embedded/desktopservices/desktopservices.pro +++ b/demos/embedded/desktopservices/desktopservices.pro @@ -7,8 +7,8 @@ SOURCES += desktopwidget.cpp contenttab.cpp linktab.cpp main.cpp RESOURCES += desktopservices.qrc -music.sources = data/*.mp3 data/*.wav -image.sources = data/*.png +music.files = data/*.mp3 data/*.wav +image.files = data/*.png target.path = $$[QT_INSTALL_DEMOS]/embedded/desktopservices sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index ca74c38..0799ed9 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -33,7 +33,7 @@ wince*{ BUILD_DIR = debug } - executables.sources = \ + executables.files = \ $$QT_BUILD_TREE/demos/embedded/embeddedsvgviewer/$${BUILD_DIR}/embeddedsvgviewer.exe \ $$QT_BUILD_TREE/demos/embedded/styledemo/$${BUILD_DIR}/styledemo.exe \ $$QT_BUILD_TREE/demos/deform/$${BUILD_DIR}/deform.exe \ @@ -45,10 +45,10 @@ wince*{ executables.path = . - files.sources = $$PWD/screenshots $$PWD/slides $$PWD/../embeddedsvgviewer/shapes.svg + files.files = $$PWD/screenshots $$PWD/slides $$PWD/../embeddedsvgviewer/shapes.svg files.path = . - config.sources = $$PWD/config_wince/config.xml + config.files = $$PWD/config_wince/config.xml config.path = . DEPLOYMENT += config files executables @@ -79,7 +79,7 @@ symbian { } } - executables.sources = \ + executables.files = \ $$QT_BUILD_TREE/demos/embedded/styledemo/styledemo.exe \ $$QT_BUILD_TREE/demos/deform/deform.exe \ $$QT_BUILD_TREE/demos/pathstroke/pathstroke.exe \ @@ -97,7 +97,7 @@ symbian { executables.path = /sys/bin - reg_resource.sources = \ + reg_resource.files = \ $$regResourceDir(demos/embedded/styledemo/styledemo_reg.rsc) \ $$regResourceDir(demos/deform/deform_reg.rsc) \ $$regResourceDir(demos/pathstroke/pathstroke_reg.rsc) \ @@ -114,17 +114,17 @@ symbian { $$regResourceDir(demos/embedded/flightinfo/flightinfo_reg.rsc) contains(QT_CONFIG, phonon) { - reg_resource.sources += $$regResourceDir(demos/qmediaplayer/qmediaplayer_reg.rsc) + reg_resource.files += $$regResourceDir(demos/qmediaplayer/qmediaplayer_reg.rsc) } contains(QT_CONFIG, multimedia) { - reg_resource.sources += $$regResourceDir(demos/spectrum/app/spectrum_reg.rsc) + reg_resource.files += $$regResourceDir(demos/spectrum/app/spectrum_reg.rsc) } reg_resource.path = $$REG_RESOURCE_IMPORT_DIR - resource.sources = \ + resource.files = \ $$appResourceDir(demos/embedded/styledemo/styledemo.rsc) \ $$appResourceDir(demos/deform/deform.rsc) \ $$appResourceDir(demos/pathstroke/pathstroke.rsc) \ @@ -143,7 +143,7 @@ symbian { resource.path = $$APP_RESOURCE_DIR - mifs.sources = \ + mifs.files = \ $$appResourceDir(demos/embedded/fluidlauncher/fluidlauncher.mif) \ $$appResourceDir(demos/embedded/styledemo/styledemo.mif) \ $$appResourceDir(demos/deform/deform.mif) \ @@ -162,28 +162,28 @@ symbian { mifs.path = $$APP_RESOURCE_DIR contains(QT_CONFIG, svg) { - executables.sources += \ + executables.files += \ $$QT_BUILD_TREE/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.exe \ $$QT_BUILD_TREE/demos/embedded/weatherinfo/weatherinfo.exe - reg_resource.sources += \ + reg_resource.files += \ $$regResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer_reg.rsc) \ $$regResourceDir(demos/embedded/weatherinfo/weatherinfo_reg.rsc) - resource.sources += \ + resource.files += \ $$appResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer.rsc) \ $$appResourceDir(demos/embedded/weatherinfo/weatherinfo.rsc) - mifs.sources += \ + mifs.files += \ $$appResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer.mif) \ $$appResourceDir(demos/embedded/weatherinfo/weatherinfo.mif) } contains(QT_CONFIG, webkit) { - executables.sources += $$QT_BUILD_TREE/demos/embedded/anomaly/anomaly.exe - reg_resource.sources += $$regResourceDir(demos/embedded/anomaly/anomaly_reg.rsc) - resource.sources += $$appResourceDir(demos/embedded/anomaly/anomaly.rsc) - mifs.sources += \ + executables.files += $$QT_BUILD_TREE/demos/embedded/anomaly/anomaly.exe + reg_resource.files += $$regResourceDir(demos/embedded/anomaly/anomaly_reg.rsc) + resource.files += $$appResourceDir(demos/embedded/anomaly/anomaly.rsc) + mifs.files += \ $$appResourceDir(demos/embedded/anomaly/anomaly.mif) isEmpty(QT_LIBINFIX) { @@ -195,61 +195,61 @@ symbian { } contains(QT_CONFIG, phonon) { - executables.sources += $$QT_BUILD_TREE/demos/qmediaplayer/qmediaplayer.exe - resource.sources += $$appResourceDir(demos/qmediaplayer/qmediaplayer.rsc) - mifs.sources += \ + executables.files += $$QT_BUILD_TREE/demos/qmediaplayer/qmediaplayer.exe + resource.files += $$appResourceDir(demos/qmediaplayer/qmediaplayer.rsc) + mifs.files += \ $$appResourceDir(demos/qmediaplayer/qmediaplayer.mif) } contains(QT_CONFIG, multimedia) { - executables.sources += $$QT_BUILD_TREE/demos/spectrum/app/spectrum.exe - executables.sources += $$QT_BUILD_TREE/demos/spectrum/3rdparty/fftreal/fftreal.dll - resource.sources += $$appResourceDir(demos/spectrum/app/spectrum.rsc) - mifs.sources += \ + executables.files += $$QT_BUILD_TREE/demos/spectrum/app/spectrum.exe + executables.files += $$QT_BUILD_TREE/demos/spectrum/3rdparty/fftreal/fftreal.dll + resource.files += $$appResourceDir(demos/spectrum/app/spectrum.rsc) + mifs.files += \ $$appResourceDir(demos/spectrum/app/spectrum.mif) } contains(QT_CONFIG, script) { - executables.sources += $$QT_BUILD_TREE/examples/script/context2d/context2d.exe - reg_resource.sources += $$regResourceDir(examples/script/context2d/context2d_reg.rsc) - resource.sources += $$appResourceDir(examples/script/context2d/context2d.rsc) - mifs.sources += \ + executables.files += $$QT_BUILD_TREE/examples/script/context2d/context2d.exe + reg_resource.files += $$regResourceDir(examples/script/context2d/context2d_reg.rsc) + resource.files += $$appResourceDir(examples/script/context2d/context2d.rsc) + mifs.files += \ $$appResourceDir(examples/script/context2d/context2d.mif) } qmldemos = qmlcalculator qmlclocks qmldialcontrol qmleasing qmlflickr qmlphotoviewer qmltwitter contains(QT_CONFIG, declarative) { for(qmldemo, qmldemos) { - executables.sources += $$QT_BUILD_TREE/demos/embedded/$${qmldemo}/$${qmldemo}.exe - reg_resource.sources += $$regResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}_reg.rsc) - resource.sources += $$appResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}.rsc) - mifs.sources += $$appResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}.mif) + executables.files += $$QT_BUILD_TREE/demos/embedded/$${qmldemo}/$${qmldemo}.exe + reg_resource.files += $$regResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}_reg.rsc) + resource.files += $$appResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}.rsc) + mifs.files += $$appResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}.mif) } } - files.sources = $$PWD/screenshots $$PWD/slides + files.files = $$PWD/screenshots $$PWD/slides files.path = . - config.sources = $$PWD/config_s60/config.xml + config.files = $$PWD/config_s60/config.xml config.path = . - viewerimages.sources = $$PWD/../embeddedsvgviewer/shapes.svg + viewerimages.files = $$PWD/../embeddedsvgviewer/shapes.svg viewerimages.path = /data/images/qt/demos/embeddedsvgviewer # demos/mediaplayer make also use of these files. - desktopservices_music.sources = \ + desktopservices_music.files = \ $$PWD/../desktopservices/data/*.mp3 \ $$PWD/../desktopservices/data/*.wav desktopservices_music.path = /data/sounds - desktopservices_images.sources = $$PWD/../desktopservices/data/*.png + desktopservices_images.files = $$PWD/../desktopservices/data/*.png desktopservices_images.path = /data/images - saxbookmarks.sources = $$PWD/../../../examples/xml/saxbookmarks/frank.xbel - saxbookmarks.sources += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel + saxbookmarks.files = $$PWD/../../../examples/xml/saxbookmarks/frank.xbel + saxbookmarks.files += $$PWD/../../../examples/xml/saxbookmarks/jennifer.xbel saxbookmarks.path = /data/qt/saxbookmarks - fluidbackup.sources = backup_registration.xml + fluidbackup.files = backup_registration.xml fluidbackup.path = /private/$$replace(TARGET.UID3, 0x,) DEPLOYMENT += config files executables viewerimages saxbookmarks reg_resource resource \ diff --git a/demos/embedded/qmlcalculator/deployment.pri b/demos/embedded/qmlcalculator/deployment.pri index a31303d..a97498e 100644 --- a/demos/embedded/qmlcalculator/deployment.pri +++ b/demos/embedded/qmlcalculator/deployment.pri @@ -4,5 +4,5 @@ symbian { qmlcalculator_uid3 = A000E3FB qmlcalculator_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlcalculator_uid3 } -qmlcalculator_files.sources = $$qmlcalculator_src/calculator.qml $$qmlcalculator_src/Core +qmlcalculator_files.files = $$qmlcalculator_src/calculator.qml $$qmlcalculator_src/Core DEPLOYMENT += qmlcalculator_files diff --git a/demos/embedded/qmlclocks/deployment.pri b/demos/embedded/qmlclocks/deployment.pri index 0946733..6c6704c 100644 --- a/demos/embedded/qmlclocks/deployment.pri +++ b/demos/embedded/qmlclocks/deployment.pri @@ -4,5 +4,5 @@ symbian { qmlclocks_uid3 = A000E3FC qmlclocks_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlclocks_uid3 } -qmlclocks_files.sources = $$qmlclocks_src/clocks.qml $$qmlclocks_src/content +qmlclocks_files.files = $$qmlclocks_src/clocks.qml $$qmlclocks_src/content DEPLOYMENT += qmlclocks_files diff --git a/demos/embedded/qmldialcontrol/deployment.pri b/demos/embedded/qmldialcontrol/deployment.pri index e0e72e6..a978443 100644 --- a/demos/embedded/qmldialcontrol/deployment.pri +++ b/demos/embedded/qmldialcontrol/deployment.pri @@ -4,5 +4,5 @@ symbian { qmldialcontrol_uid3 = A000E3FD qmldialcontrol_files.path = $$APP_PRIVATE_DIR_BASE/$$qmldialcontrol_uid3 } -qmldialcontrol_files.sources = $$qmldialcontrol_src/dialcontrol.qml $$qmldialcontrol_src/content +qmldialcontrol_files.files = $$qmldialcontrol_src/dialcontrol.qml $$qmldialcontrol_src/content DEPLOYMENT += qmldialcontrol_files diff --git a/demos/embedded/qmleasing/deployment.pri b/demos/embedded/qmleasing/deployment.pri index d3621cb..946fcd9 100644 --- a/demos/embedded/qmleasing/deployment.pri +++ b/demos/embedded/qmleasing/deployment.pri @@ -4,5 +4,5 @@ symbian { qmleasing_uid3 = A000E3FE qmleasing_files.path = $$APP_PRIVATE_DIR_BASE/$$qmleasing_uid3 } -qmleasing_files.sources = $$qmleasing_src/easing.qml $$qmleasing_src/content +qmleasing_files.files = $$qmleasing_src/easing.qml $$qmleasing_src/content DEPLOYMENT += qmleasing_files diff --git a/demos/embedded/qmlflickr/deployment.pri b/demos/embedded/qmlflickr/deployment.pri index b508292..a38dc95 100644 --- a/demos/embedded/qmlflickr/deployment.pri +++ b/demos/embedded/qmlflickr/deployment.pri @@ -4,5 +4,5 @@ symbian { qmlflickr_uid3 = A000E3FF qmlflickr_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlflickr_uid3 } -qmlflickr_files.sources = $$qmlflickr_src/flickr.qml $$qmlflickr_src/common $$qmlflickr_src/mobile +qmlflickr_files.files = $$qmlflickr_src/flickr.qml $$qmlflickr_src/common $$qmlflickr_src/mobile DEPLOYMENT += qmlflickr_files diff --git a/demos/embedded/qmlphotoviewer/deployment.pri b/demos/embedded/qmlphotoviewer/deployment.pri index 35937a8..23882e3 100644 --- a/demos/embedded/qmlphotoviewer/deployment.pri +++ b/demos/embedded/qmlphotoviewer/deployment.pri @@ -4,5 +4,5 @@ symbian { qmlphotoviewer_uid3 = A000E400 qmlphotoviewer_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlphotoviewer_uid3 } -qmlphotoviewer_files.sources = $$qmlphotoviewer_src/photoviewer.qml $$qmlphotoviewer_src/PhotoViewerCore +qmlphotoviewer_files.files = $$qmlphotoviewer_src/photoviewer.qml $$qmlphotoviewer_src/PhotoViewerCore DEPLOYMENT += qmlphotoviewer_files diff --git a/demos/embedded/qmltwitter/deployment.pri b/demos/embedded/qmltwitter/deployment.pri index 4404e33..3edc0e5 100644 --- a/demos/embedded/qmltwitter/deployment.pri +++ b/demos/embedded/qmltwitter/deployment.pri @@ -4,5 +4,5 @@ symbian { qmltwitter_uid3 = A000E401 qmltwitter_files.path = $$APP_PRIVATE_DIR_BASE/$$qmltwitter_uid3 } -qmltwitter_files.sources = $$qmltwitter_src/twitter.qml $$qmltwitter_src/TwitterCore +qmltwitter_files.files = $$qmltwitter_src/twitter.qml $$qmltwitter_src/TwitterCore DEPLOYMENT += qmltwitter_files diff --git a/demos/qmediaplayer/qmediaplayer.pro b/demos/qmediaplayer/qmediaplayer.pro index 9407a81..8803d2e 100644 --- a/demos/qmediaplayer/qmediaplayer.pro +++ b/demos/qmediaplayer/qmediaplayer.pro @@ -27,7 +27,7 @@ DEPLOYMENT_PLUGIN += phonon_ds9 phonon_waveout symbian { TARGET.UID3 = 0xA000C613 - addFiles.sources = ../embedded/desktopservices/data/sax.mp3 + addFiles.files = ../embedded/desktopservices/data/sax.mp3 addFiles.path = /data/sounds/ DEPLOYMENT += addFiles diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro index 4fe8b6d..1ae16e9 100644 --- a/demos/spectrum/app/app.pro +++ b/demos/spectrum/app/app.pro @@ -86,7 +86,7 @@ symbian { !contains(DEFINES, DISABLE_FFT) { # Include FFTReal DLL in the SIS file - fftreal.sources = ../fftreal.dll + fftreal.files = ../fftreal.dll fftreal.path = !:/sys/bin DEPLOYMENT += fftreal } diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 1d2fbb4..ab67a3d 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -1021,7 +1021,7 @@ DEPLOYMENT -= default_bin_deployment default_resource_deployment default_reg_dep //! [155] default_bin_deployment.flags += FILERUN RUNINSTALL -dep_note.sources = install_note.txt +dep_note.files = install_note.txt dep_note.flags = FILETEXT TEXTEXIT DEPLOYMENT += dep_note //! [155] diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro index 7149986..f6e09a2 100644 --- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro +++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro @@ -22,7 +22,7 @@ symbian:{ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) TARGET.EPOCALLOWDLLDATA = 1 - importFiles.sources = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir + importFiles.files = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir importFiles.path = ImageProviderCore DEPLOYMENT = importFiles } diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro index 2e610f9..0f5398b 100644 --- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro +++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro @@ -17,7 +17,7 @@ symbian:{ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) TARGET.EPOCALLOWDLLDATA = 1 - importFiles.sources = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir + importFiles.files = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir importFiles.path = QWidgets DEPLOYMENT = importFiles diff --git a/examples/desktop/systray/systray.pro b/examples/desktop/systray/systray.pro index 9b25916..710452b 100644 --- a/examples/desktop/systray/systray.pro +++ b/examples/desktop/systray/systray.pro @@ -14,10 +14,10 @@ symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) wince* { CONFIG(debug, release|debug) { - addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll + addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qsvgd4.dll } CONFIG(release, release|debug) { - addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qsvg4.dll + addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qsvg4.dll } addPlugins.path = imageformats DEPLOYMENT += addPlugins diff --git a/examples/draganddrop/puzzle/puzzle.pro b/examples/draganddrop/puzzle/puzzle.pro index ec88f7a..c0400d8 100644 --- a/examples/draganddrop/puzzle/puzzle.pro +++ b/examples/draganddrop/puzzle/puzzle.pro @@ -18,12 +18,12 @@ INSTALLS += target sources symbian:{ TARGET.UID3 = 0xA000CF65 include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - addFile.sources = example.jpg + addFile.files = example.jpg addFile.path = . DEPLOYMENT += addFile } wince*: { - addFile.sources = example.jpg + addFile.files = example.jpg addFile.path = . DEPLOYMENT += addFile } diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro index 4809b91..6417849 100644 --- a/examples/painting/svgviewer/svgviewer.pro +++ b/examples/painting/svgviewer/svgviewer.pro @@ -17,7 +17,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/painting/svgviewer INSTALLS += target sources wince*: { - addFiles.sources = files\\*.svg + addFiles.files = files\\*.svg addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } @@ -25,7 +25,7 @@ wince*: { symbian: { TARGET.UID3 = 0xA000A64E include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - addFiles.sources = files\\*.svg + addFiles.files = files\\*.svg addFiles.path = . DEPLOYMENT += addFiles } diff --git a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro index 0574b2d..67aa1ff 100644 --- a/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro +++ b/examples/richtext/syntaxhighlighter/syntaxhighlighter.pro @@ -13,7 +13,7 @@ INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) wince*: { - addFiles.sources = main.cpp mainwindow.cpp + addFiles.files = main.cpp mainwindow.cpp addFiles.path = . DEPLOYMENT += addFiles } diff --git a/examples/richtext/textobject/textobject.pro b/examples/richtext/textobject/textobject.pro index 4fa9cb0..222b0fe 100644 --- a/examples/richtext/textobject/textobject.pro +++ b/examples/richtext/textobject/textobject.pro @@ -12,7 +12,7 @@ sources.files = $$SOURCES $$HEADERS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/richtext/textobject INSTALLS += target sources -filesToDeploy.sources = files/*.svg +filesToDeploy.files = files/*.svg filesToDeploy.path = files DEPLOYMENT += filesToDeploy diff --git a/examples/script/context2d/context2d.pro b/examples/script/context2d/context2d.pro index 54f5c31..6a0e397 100644 --- a/examples/script/context2d/context2d.pro +++ b/examples/script/context2d/context2d.pro @@ -27,6 +27,6 @@ symbian:{ include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) TARGET.EPOCHEAPSIZE = 0x200000 0xA00000 contextScripts.path = . - contextScripts.sources = scripts + contextScripts.files = scripts DEPLOYMENT += contextScripts } diff --git a/examples/widgets/icons/icons.pro b/examples/widgets/icons/icons.pro index 39c7ab2..48b2da9 100644 --- a/examples/widgets/icons/icons.pro +++ b/examples/widgets/icons/icons.pro @@ -17,7 +17,7 @@ INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) wince*: { - imageFiles.sources = images/* + imageFiles.files = images/* wincewm*: { imageFiles.path = "/My Documents/My Pictures" } else { diff --git a/examples/widgets/movie/movie.pro b/examples/widgets/movie/movie.pro index 517fec7..d59bf2e 100644 --- a/examples/widgets/movie/movie.pro +++ b/examples/widgets/movie/movie.pro @@ -11,7 +11,7 @@ INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) wince*: { - addFiles.sources += *.mng + addFiles.files += *.mng addFiles.path = . DEPLOYMENT += addFiles DEPLOYMENT_PLUGIN += qmng diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro index f906d2f..80bbec4 100644 --- a/examples/xml/dombookmarks/dombookmarks.pro +++ b/examples/xml/dombookmarks/dombookmarks.pro @@ -14,7 +14,7 @@ INSTALLS += target sources symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) wince*: { - addFiles.sources = frank.xbel jennifer.xbel + addFiles.files = frank.xbel jennifer.xbel addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro index 5e9c8ca..94b3a07 100644 --- a/examples/xml/htmlinfo/htmlinfo.pro +++ b/examples/xml/htmlinfo/htmlinfo.pro @@ -2,7 +2,7 @@ SOURCES += main.cpp QT -= gui wince*|symbian:{ - htmlfiles.sources = *.html + htmlfiles.files = *.html htmlfiles.path = . DEPLOYMENT += htmlfiles } diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro index 7293bd1..d4b09b6 100644 --- a/examples/xml/saxbookmarks/saxbookmarks.pro +++ b/examples/xml/saxbookmarks/saxbookmarks.pro @@ -14,7 +14,7 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/xml/saxbookmarks INSTALLS += target sources wince*: { - addFiles.sources = frank.xbel jennifer.xbel + addFiles.files = frank.xbel jennifer.xbel addFiles.path = "\\My Documents" DEPLOYMENT += addFiles } @@ -22,7 +22,7 @@ wince*: { symbian: { TARGET.UID3 = 0xA000C60A include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - addFiles.sources = frank.xbel jennifer.xbel + addFiles.files = frank.xbel jennifer.xbel addFiles.path = /data/qt/saxbookmarks DEPLOYMENT += addFiles } diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index e59319f..191a449 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -113,7 +113,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { CONFIG(debug, debug|release): QT_ITEM = $${QTPLUG}d4.dll else: QT_ITEM = $${QTPLUG}4.dll - eval(qt_additional_plugin_$${QTPLUG}.sources = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM}) + eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS]/$${QT_PLUGINPATH}/$${QT_ITEM}) eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}) DEPLOYMENT *= qt_additional_plugin_$${QTPLUG} @@ -121,7 +121,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) { isEqual(QT_CURRENT_VERIFY, DEPLOYMENT_PLUGIN):shared:symbian: { QT_ITEM = $${QTPLUG}.dll - eval(qt_additional_plugin_$${QTPLUG}.sources = $${QT_ITEM}) + eval(qt_additional_plugin_$${QTPLUG}.files = $${QT_ITEM}) eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}) DEPLOYMENT *= qt_additional_plugin_$${QTPLUG} diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 2948811..f43ec3d 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -23,9 +23,9 @@ contains(CONFIG, no_icon) { regZDir = $$resourceZDir } - default_resource_deployment.sources += $$resourceZDir/$${baseTarget}.rsc + default_resource_deployment.files += $$resourceZDir/$${baseTarget}.rsc default_resource_deployment.path = $$APP_RESOURCE_DIR - default_reg_deployment.sources += $$regZDir/$${baseTarget}_reg.rsc + default_reg_deployment.files += $$regZDir/$${baseTarget}_reg.rsc default_reg_deployment.path = $$REG_RESOURCE_IMPORT_DIR !isEmpty(ICON) { @@ -70,7 +70,7 @@ contains(CONFIG, no_icon) { RSS_RULES.number_of_icons = $$size(ICON_backslashed) RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif - default_resource_deployment.sources += $$resourceZDir/$${baseTarget}.mif + default_resource_deployment.files += $$resourceZDir/$${baseTarget}.mif } } diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf index 2f03128..7f5420c 100644 --- a/mkspecs/features/symbian/data_caging_paths.prf +++ b/mkspecs/features/symbian/data_caging_paths.prf @@ -13,7 +13,7 @@ # # # These variables are mostly useful when specifying deployment # -# myLib.sources = myLib.dll +# myLib.files = myLib.dll # myLib.path = $$SHARED_LIB_DIR # DEPLOYMENT += myLib # @@ -21,7 +21,7 @@ # # $$QT_PUBLIC_PLUGINS_BASE specifies the public base directory for Qt # # plugin stubs: # -# myPublicImageFormatPlugin.sources = myImageFormat.dll +# myPublicImageFormatPlugin.files = myImageFormat.dll # myPublicImageFormatPlugin.path = $$QT_PLUGINS_BASE_DIR/imageformats # DEPLOYMENT += myPublicImageFormatPlugin # diff --git a/mkspecs/features/symbian/default_post.prf b/mkspecs/features/symbian/default_post.prf index a9b6d0e..548fd51 100644 --- a/mkspecs/features/symbian/default_post.prf +++ b/mkspecs/features/symbian/default_post.prf @@ -10,7 +10,7 @@ contains(TEMPLATE, ".*app") { QMAKE_LIBS += $$QMAKE_LIBS_QT_ENTRY } - default_bin_deployment.sources += $$symbianRemoveSpecialCharacters($$basename(TARGET)).exe + default_bin_deployment.files += $$symbianRemoveSpecialCharacters($$basename(TARGET)).exe default_bin_deployment.path += /sys/bin load(application_icon.prf) diff --git a/mkspecs/features/symbian/run_on_phone.prf b/mkspecs/features/symbian/run_on_phone.prf index d845277..ba88a66 100644 --- a/mkspecs/features/symbian/run_on_phone.prf +++ b/mkspecs/features/symbian/run_on_phone.prf @@ -5,7 +5,8 @@ GENERATE_RUN_TARGETS = false contains(TEMPLATE, app): GENERATE_RUN_TARGETS = true else:!equals(DEPLOYMENT, default_deployment) { for(dep_item, $$list($$DEPLOYMENT)) { - dep_item_sources = $$eval($${dep_item}.sources) + ### Qt 5: remove .sources, inconsistent with INSTALLS + dep_item_sources = $$eval($${dep_item}.files) $$eval($${dep_item}.sources) !isEmpty(dep_item_sources): GENERATE_RUN_TARGETS = true } } diff --git a/mkspecs/features/symbian/sis_targets.prf b/mkspecs/features/symbian/sis_targets.prf index e838e10..e5a33cb 100644 --- a/mkspecs/features/symbian/sis_targets.prf +++ b/mkspecs/features/symbian/sis_targets.prf @@ -4,7 +4,8 @@ GENERATE_SIS_TARGETS = false contains(TEMPLATE, app): GENERATE_SIS_TARGETS = true else:!equals(DEPLOYMENT, default_deployment) { for(dep_item, $$list($$DEPLOYMENT)) { - dep_item_sources = $$eval($${dep_item}.sources) + ### Qt 5: remove .sources, inconsistent with INSTALLS + dep_item_sources = $$eval($${dep_item}.files) $$eval($${dep_item}.sources) !isEmpty(dep_item_sources): GENERATE_SIS_TARGETS = true } } diff --git a/src/imports/folderlistmodel/folderlistmodel.pro b/src/imports/folderlistmodel/folderlistmodel.pro index b2e5360..ef58226 100644 --- a/src/imports/folderlistmodel/folderlistmodel.pro +++ b/src/imports/folderlistmodel/folderlistmodel.pro @@ -17,8 +17,8 @@ symbian:{ TARGET.UID3 = 0x20021320 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - isEmpty(DESTDIR):importFiles.sources = qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir - else:importFiles.sources = $$DESTDIR/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir + isEmpty(DESTDIR):importFiles.files = qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir + else:importFiles.files = $$DESTDIR/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/imports/gestures/gestures.pro b/src/imports/gestures/gestures.pro index 18ffcb9..5722b68 100644 --- a/src/imports/gestures/gestures.pro +++ b/src/imports/gestures/gestures.pro @@ -17,8 +17,8 @@ symbian:{ TARGET.UID3 = 0x2002131F include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - isEmpty(DESTDIR):importFiles.sources = qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir - else:importFiles.sources = $$DESTDIR/qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir + isEmpty(DESTDIR):importFiles.files = qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir + else:importFiles.files = $$DESTDIR/qmlgesturesplugin$${QT_LIBINFIX}.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro index a3eb0d1..fd6f0f6 100644 --- a/src/imports/particles/particles.pro +++ b/src/imports/particles/particles.pro @@ -21,8 +21,8 @@ symbian:{ TARGET.UID3 = 0x2002131E include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) - isEmpty(DESTDIR):importFiles.sources = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir - else:importFiles.sources = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir + isEmpty(DESTDIR):importFiles.files = qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir + else:importFiles.files = $$DESTDIR/qmlparticlesplugin$${QT_LIBINFIX}.dll qmldir importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH DEPLOYMENT = importFiles diff --git a/src/qbase.pri b/src/qbase.pri index 1e13149..30f3337 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -198,7 +198,7 @@ symbian { pu_header = "; Partial upgrade package for testing $${TARGET} changes without reinstalling everything" \ "$${LITERAL_HASH}{\"$${TARGET}\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" partial_upgrade.pkg_prerules = pu_header vendorinfo - partial_upgrade.sources = $$QMAKE_LIBDIR_QT/$${TARGET}.dll + partial_upgrade.files = $$QMAKE_LIBDIR_QT/$${TARGET}.dll partial_upgrade.path = c:/sys/bin DEPLOYMENT += partial_upgrade } diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index c73ed06..bc9d98b 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -35,7 +35,7 @@ symbian: { } VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} - qtlibraries.sources = \ + qtlibraries.files = \ $$QMAKE_LIBDIR_QT/QtCore$${QT_LIBINFIX}.dll \ $$QMAKE_LIBDIR_QT/QtXml$${QT_LIBINFIX}.dll \ $$QMAKE_LIBDIR_QT/QtGui$${QT_LIBINFIX}.dll \ @@ -80,7 +80,7 @@ symbian: { qts60plugindeployment = \ " \"$$pluginLocations/qts60plugin_5_0$${QT_LIBINFIX}.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0$${QT_LIBINFIX}.dll\"" - bearer_plugin.sources = $$QT_BUILD_TREE/plugins/bearer/qsymbianbearer$${QT_LIBINFIX}.dll + bearer_plugin.files = $$QT_BUILD_TREE/plugins/bearer/qsymbianbearer$${QT_LIBINFIX}.dll bearer_plugin.path = c:$$QT_PLUGINS_BASE_DIR/bearer DEPLOYMENT += bearer_plugin } @@ -113,25 +113,25 @@ symbian: { } qtlibraries.pkg_prerules += "(0x2002af5f), 0, 5, 0, {\"sqlite3\"}" - !contains(QT_CONFIG, no-jpeg): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qjpeg$${QT_LIBINFIX}.dll - !contains(QT_CONFIG, no-gif): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qgif$${QT_LIBINFIX}.dll - !contains(QT_CONFIG, no-mng): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qmng$${QT_LIBINFIX}.dll - !contains(QT_CONFIG, no-tiff): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qtiff$${QT_LIBINFIX}.dll - !contains(QT_CONFIG, no-ico): imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qico$${QT_LIBINFIX}.dll + !contains(QT_CONFIG, no-jpeg): imageformats_plugins.files += $$QT_BUILD_TREE/plugins/imageformats/qjpeg$${QT_LIBINFIX}.dll + !contains(QT_CONFIG, no-gif): imageformats_plugins.files += $$QT_BUILD_TREE/plugins/imageformats/qgif$${QT_LIBINFIX}.dll + !contains(QT_CONFIG, no-mng): imageformats_plugins.files += $$QT_BUILD_TREE/plugins/imageformats/qmng$${QT_LIBINFIX}.dll + !contains(QT_CONFIG, no-tiff): imageformats_plugins.files += $$QT_BUILD_TREE/plugins/imageformats/qtiff$${QT_LIBINFIX}.dll + !contains(QT_CONFIG, no-ico): imageformats_plugins.files += $$QT_BUILD_TREE/plugins/imageformats/qico$${QT_LIBINFIX}.dll imageformats_plugins.path = c:$$QT_PLUGINS_BASE_DIR/imageformats - codecs_plugins.sources = $$QT_BUILD_TREE/plugins/codecs/qcncodecs$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/codecs/qjpcodecs$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/codecs/qtwcodecs$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/codecs/qkrcodecs$${QT_LIBINFIX}.dll + codecs_plugins.files = $$QT_BUILD_TREE/plugins/codecs/qcncodecs$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/codecs/qjpcodecs$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/codecs/qtwcodecs$${QT_LIBINFIX}.dll $$QT_BUILD_TREE/plugins/codecs/qkrcodecs$${QT_LIBINFIX}.dll codecs_plugins.path = c:$$QT_PLUGINS_BASE_DIR/codecs contains(QT_CONFIG, phonon-backend) { - phonon_backend_plugins.sources += $$QMAKE_LIBDIR_QT/phonon_mmf$${QT_LIBINFIX}.dll + phonon_backend_plugins.files += $$QMAKE_LIBDIR_QT/phonon_mmf$${QT_LIBINFIX}.dll phonon_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/phonon_backend DEPLOYMENT += phonon_backend_plugins } # Support backup & restore for Qt libraries - qtbackup.sources = backup_registration.xml + qtbackup.files = backup_registration.xml qtbackup.path = c:/private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) DEPLOYMENT += qtlibraries \ @@ -141,35 +141,35 @@ symbian: { graphicssystems_plugins contains(QT_CONFIG, svg): { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtSvg$${QT_LIBINFIX}.dll - imageformats_plugins.sources += $$QT_BUILD_TREE/plugins/imageformats/qsvg$${QT_LIBINFIX}.dll - iconengines_plugins.sources = $$QT_BUILD_TREE/plugins/iconengines/qsvgicon$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtSvg$${QT_LIBINFIX}.dll + imageformats_plugins.files += $$QT_BUILD_TREE/plugins/imageformats/qsvg$${QT_LIBINFIX}.dll + iconengines_plugins.files = $$QT_BUILD_TREE/plugins/iconengines/qsvgicon$${QT_LIBINFIX}.dll iconengines_plugins.path = c:$$QT_PLUGINS_BASE_DIR/iconengines DEPLOYMENT += iconengines_plugins } contains(QT_CONFIG, phonon): { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/phonon$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/phonon$${QT_LIBINFIX}.dll } contains(QT_CONFIG, script): { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtScript$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtScript$${QT_LIBINFIX}.dll } contains(QT_CONFIG, xmlpatterns): { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtXmlPatterns$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtXmlPatterns$${QT_LIBINFIX}.dll } contains(QT_CONFIG, declarative): { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtDeclarative$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtDeclarative$${QT_LIBINFIX}.dll - folderlistmodelImport.sources = $$QT_BUILD_TREE/imports/Qt/labs/folderlistmodel/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll - gesturesImport.sources = $$QT_BUILD_TREE/imports/Qt/labs/gestures/qmlgesturesplugin$${QT_LIBINFIX}.dll - particlesImport.sources = $$QT_BUILD_TREE/imports/Qt/labs/particles/qmlparticlesplugin$${QT_LIBINFIX}.dll + folderlistmodelImport.files = $$QT_BUILD_TREE/imports/Qt/labs/folderlistmodel/qmlfolderlistmodelplugin$${QT_LIBINFIX}.dll + gesturesImport.files = $$QT_BUILD_TREE/imports/Qt/labs/gestures/qmlgesturesplugin$${QT_LIBINFIX}.dll + particlesImport.files = $$QT_BUILD_TREE/imports/Qt/labs/particles/qmlparticlesplugin$${QT_LIBINFIX}.dll - folderlistmodelImport.sources += $$QT_SOURCE_TREE/src/imports/folderlistmodel/qmldir - gesturesImport.sources += $$QT_SOURCE_TREE/src/imports/gestures/qmldir - particlesImport.sources += $$QT_SOURCE_TREE/src/imports/particles/qmldir + folderlistmodelImport.files += $$QT_SOURCE_TREE/src/imports/folderlistmodel/qmldir + gesturesImport.files += $$QT_SOURCE_TREE/src/imports/gestures/qmldir + particlesImport.files += $$QT_SOURCE_TREE/src/imports/particles/qmldir folderlistmodelImport.path = c:$$QT_IMPORTS_BASE_DIR/Qt/labs/folderlistmodel gesturesImport.path = c:$$QT_IMPORTS_BASE_DIR/Qt/labs/gestures @@ -180,8 +180,8 @@ symbian: { graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems contains(QT_CONFIG, openvg) { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtOpenVG$${QT_LIBINFIX}.dll - graphicssystems_plugins.sources += $$QT_BUILD_TREE/plugins/graphicssystems/qvggraphicssystem$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtOpenVG$${QT_LIBINFIX}.dll + graphicssystems_plugins.files += $$QT_BUILD_TREE/plugins/graphicssystems/qvggraphicssystem$${QT_LIBINFIX}.dll # OpenVG requires Symbian^3 or later pkg_platform_dependencies -= \ "[0x101F7961],0,0,0,{\"S60ProductID\"}" \ @@ -191,12 +191,12 @@ symbian: { } contains(QT_CONFIG, opengl) { - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtOpenGL$${QT_LIBINFIX}.dll - graphicssystems_plugins.sources += $$QT_BUILD_TREE/plugins/graphicssystems/qglgraphicssystem$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtOpenGL$${QT_LIBINFIX}.dll + graphicssystems_plugins.files += $$QT_BUILD_TREE/plugins/graphicssystems/qglgraphicssystem$${QT_LIBINFIX}.dll } contains(QT_CONFIG, multimedia){ - qtlibraries.sources += $$QMAKE_LIBDIR_QT/QtMultimedia$${QT_LIBINFIX}.dll + qtlibraries.files += $$QMAKE_LIBDIR_QT/QtMultimedia$${QT_LIBINFIX}.dll } BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro index 3692f21..56b7f25 100644 --- a/tests/arthur/lance/lance.pro +++ b/tests/arthur/lance/lance.pro @@ -13,7 +13,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, o contains(QT_CONFIG, qt3support):QT += qt3support symbian*: { - testData.sources = $$QT_BUILD_TREE/tests/arthur/data/qps + testData.files = $$QT_BUILD_TREE/tests/arthur/data/qps testData.path = . DEPLOYMENT += testData } diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro index 319ba9b..ab932f5 100644 --- a/tests/auto/checkxmlfiles/checkxmlfiles.pro +++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro @@ -8,7 +8,7 @@ include (../xmlpatterns.pri) wince*|symbian: { QT += network -addFiles.sources = \ +addFiles.files = \ $$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \ $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/globals.gccxml \ $$QT_SOURCE_TREE/doc/src/diagrams/stylesheet/treeview.svg \ diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro index 2e243b4..8ed33da 100644 --- a/tests/auto/declarative/examples/examples.pro +++ b/tests/auto/declarative/examples/examples.pro @@ -7,7 +7,7 @@ SOURCES += tst_examples.cpp include(../../../../tools/qml/qml.pri) symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/declarative/moduleqt47/moduleqt47.pro index 4ee634e..808f263 100644 --- a/tests/auto/declarative/moduleqt47/moduleqt47.pro +++ b/tests/auto/declarative/moduleqt47/moduleqt47.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_moduleqt47.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro index bb1d69f..1e323f7 100644 --- a/tests/auto/declarative/parserstress/parserstress.pro +++ b/tests/auto/declarative/parserstress/parserstress.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_parserstress.cpp symbian: { - importFiles.sources = ..\\..\\qscriptjstestsuite\\tests + importFiles.files = ..\\..\\qscriptjstestsuite\\tests importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro index 9798bb6..141e25d 100644 --- a/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro +++ b/tests/auto/declarative/qdeclarativeanchors/qdeclarativeanchors.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativeanchors.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro index 0a2f0f2..ad9509a 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro +++ b/tests/auto/declarative/qdeclarativeanimatedimage/qdeclarativeanimatedimage.pro @@ -5,7 +5,7 @@ SOURCES += tst_qdeclarativeanimatedimage.cpp ../shared/testhttpserver.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro index ed47dca..84cd498 100644 --- a/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro +++ b/tests/auto/declarative/qdeclarativeanimations/qdeclarativeanimations.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativeanimations.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro index cfb59ef..e4125fd 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro +++ b/tests/auto/declarative/qdeclarativebehaviors/qdeclarativebehaviors.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativebehaviors.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro index a7ba2a8..25bdbec 100644 --- a/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro +++ b/tests/auto/declarative/qdeclarativebinding/qdeclarativebinding.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativebinding.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro index a21761b..05d4cac 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro +++ b/tests/auto/declarative/qdeclarativeborderimage/qdeclarativeborderimage.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativeborderimage.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro index d06ce4f..c614571 100644 --- a/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro +++ b/tests/auto/declarative/qdeclarativeconnection/qdeclarativeconnection.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeconnection.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro index 415d4e2..e8f24a5 100644 --- a/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro +++ b/tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativedom.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro index 58cad34..e7f8636 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro +++ b/tests/auto/declarative/qdeclarativeecmascript/qdeclarativeecmascript.pro @@ -13,7 +13,7 @@ INCLUDEPATH += ../shared # LIBS += -lgcov symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro index be0ba6c..1fb99d0 100644 --- a/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro +++ b/tests/auto/declarative/qdeclarativeflickable/qdeclarativeflickable.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeflickable.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro index 759e80b..eddd053 100644 --- a/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro +++ b/tests/auto/declarative/qdeclarativeflipable/qdeclarativeflipable.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeflipable.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro index 24749c6..fd7f6b8 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro +++ b/tests/auto/declarative/qdeclarativefocusscope/qdeclarativefocusscope.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativefocusscope.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro index 91bf4a7..50c7ca0 100644 --- a/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro +++ b/tests/auto/declarative/qdeclarativefolderlistmodel/qdeclarativefolderlistmodel.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativefolderlistmodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro index 01dca26..f245a0d 100644 --- a/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro +++ b/tests/auto/declarative/qdeclarativefontloader/qdeclarativefontloader.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativefontloader.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro index a99a1b9..b775b3d 100644 --- a/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro +++ b/tests/auto/declarative/qdeclarativegridview/qdeclarativegridview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativegridview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro index 244a1e1..c87c1d9 100644 --- a/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro +++ b/tests/auto/declarative/qdeclarativeimage/qdeclarativeimage.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativeimage.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro index 2c20e7e..888596f 100644 --- a/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro +++ b/tests/auto/declarative/qdeclarativeinfo/qdeclarativeinfo.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeinfo.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro index f4901c4..0fd871e 100644 --- a/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro +++ b/tests/auto/declarative/qdeclarativeitem/qdeclarativeitem.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeitem.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro index 43c451f..aa69337 100644 --- a/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro +++ b/tests/auto/declarative/qdeclarativelanguage/qdeclarativelanguage.pro @@ -12,7 +12,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro index 5076e51..42d9a80 100644 --- a/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro +++ b/tests/auto/declarative/qdeclarativelayoutitem/qdeclarativelayoutitem.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelayoutitem.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro index e90db49..8a39555 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro +++ b/tests/auto/declarative/qdeclarativelistmodel/qdeclarativelistmodel.pro @@ -6,7 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelistmodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro index 2c5a859..99eba67 100644 --- a/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro +++ b/tests/auto/declarative/qdeclarativelistview/qdeclarativelistview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativelistview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro index b07bf9e..1e7808a 100644 --- a/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro +++ b/tests/auto/declarative/qdeclarativeloader/qdeclarativeloader.pro @@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativeloader.cpp \ ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro index fb3630f..ec2d25e 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.pro @@ -4,7 +4,7 @@ QT += declarative CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro index 3d39aa8..a93f7af 100644 --- a/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro +++ b/tests/auto/declarative/qdeclarativemousearea/qdeclarativemousearea.pro @@ -6,7 +6,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += tst_qdeclarativemousearea.cpp ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro index f9ca90f..8f13573 100644 --- a/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro +++ b/tests/auto/declarative/qdeclarativeparticles/qdeclarativeparticles.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeparticles.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro index 04fd26b..4f70a6f 100644 --- a/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro +++ b/tests/auto/declarative/qdeclarativepathview/qdeclarativepathview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativepathview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro index 3130364..47b1b7b 100644 --- a/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro +++ b/tests/auto/declarative/qdeclarativepixmapcache/qdeclarativepixmapcache.pro @@ -10,7 +10,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro index 5dc7bb8..e98aa5c 100644 --- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro +++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativepositioners.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro index 4121a33..9dd727c 100644 --- a/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro +++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeproperty.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro index 6af6500..a12c439 100644 --- a/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro +++ b/tests/auto/declarative/qdeclarativeqt/qdeclarativeqt.pro @@ -4,7 +4,7 @@ SOURCES += tst_qdeclarativeqt.cpp macx:CONFIG -= app_bundle symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro index f3ff9ed..385b8da 100644 --- a/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro +++ b/tests/auto/declarative/qdeclarativerepeater/qdeclarativerepeater.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativerepeater.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro index c2d30a0..dedb263 100644 --- a/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro +++ b/tests/auto/declarative/qdeclarativescriptdebugging/qdeclarativescriptdebugging.pro @@ -9,7 +9,7 @@ INCLUDEPATH += ../shared # LIBS += -lgcov symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro index 872aeb9..69f331b 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/qdeclarativesmoothedanimation.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativesmoothedanimation.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro index 213b262..a59522b 100644 --- a/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro +++ b/tests/auto/declarative/qdeclarativespringanimation/qdeclarativespringanimation.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativespringanimation.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro index 1462c9a..d938692 100644 --- a/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro +++ b/tests/auto/declarative/qdeclarativesqldatabase/qdeclarativesqldatabase.pro @@ -6,7 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativesqldatabase.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro index 2bae041..2f32178 100644 --- a/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro +++ b/tests/auto/declarative/qdeclarativestates/qdeclarativestates.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativestates.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro index c1a36fd..362886e 100644 --- a/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro +++ b/tests/auto/declarative/qdeclarativetext/qdeclarativetext.pro @@ -10,7 +10,7 @@ HEADERS += ../shared/testhttpserver.h SOURCES += ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro index 4b6bd49..cf706ba 100644 --- a/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro +++ b/tests/auto/declarative/qdeclarativetextedit/qdeclarativetextedit.pro @@ -6,7 +6,7 @@ SOURCES += tst_qdeclarativetextedit.cpp ../shared/testhttpserver.cpp HEADERS += ../shared/testhttpserver.h symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro index 8f42448..5c45f57 100644 --- a/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro +++ b/tests/auto/declarative/qdeclarativetextinput/qdeclarativetextinput.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativetextinput.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro index 90e46d3..a208254 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro +++ b/tests/auto/declarative/qdeclarativevaluetypes/qdeclarativevaluetypes.pro @@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativevaluetypes.cpp \ testtypes.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro index 21a9195..4436d54 100644 --- a/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro +++ b/tests/auto/declarative/qdeclarativeview/qdeclarativeview.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro index 6189916..5ba416e 100644 --- a/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro +++ b/tests/auto/declarative/qdeclarativeviewer/qdeclarativeviewer.pro @@ -7,7 +7,7 @@ include(../../../../tools/qml/qml.pri) SOURCES += tst_qdeclarativeviewer.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro index 92e5f60..16154f3 100644 --- a/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro +++ b/tests/auto/declarative/qdeclarativevisualdatamodel/qdeclarativevisualdatamodel.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativevisualdatamodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro index 562a9fb..cc7fa43 100644 --- a/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro +++ b/tests/auto/declarative/qdeclarativewebview/qdeclarativewebview.pro @@ -6,7 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativewebview.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro index 2f8f23d..eca8a68 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro +++ b/tests/auto/declarative/qdeclarativeworkerscript/qdeclarativeworkerscript.pro @@ -5,7 +5,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativeworkerscript.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro index 619b239..fbcc597 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/qdeclarativexmlhttprequest.pro @@ -9,7 +9,7 @@ SOURCES += tst_qdeclarativexmlhttprequest.cpp \ ../shared/testhttpserver.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro index 472cffb..23173f3 100644 --- a/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro +++ b/tests/auto/declarative/qdeclarativexmllistmodel/qdeclarativexmllistmodel.pro @@ -9,7 +9,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativexmllistmodel.cpp symbian: { - importFiles.sources = data + importFiles.files = data importFiles.path = . DEPLOYMENT = importFiles } else { diff --git a/tests/auto/declarative/qmlvisual/qmlvisual.pro b/tests/auto/declarative/qmlvisual/qmlvisual.pro index cb7e5d7..a424b8f 100644 --- a/tests/auto/declarative/qmlvisual/qmlvisual.pro +++ b/tests/auto/declarative/qmlvisual/qmlvisual.pro @@ -6,7 +6,7 @@ SOURCES += tst_qmlvisual.cpp symbian: { importFiles.path = . - importFiles.sources = animation \ + importFiles.files = animation \ fillmode \ focusscope \ ListView \ diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro index e887df4..ea78e63 100755 --- a/tests/auto/mediaobject/mediaobject.pro +++ b/tests/auto/mediaobject/mediaobject.pro @@ -15,7 +15,7 @@ wince*{ } symbian:{ - addFiles.sources = media/test.sdp + addFiles.files = media/test.sdp addFiles.path = media DEPLOYMENT += addFiles } diff --git a/tests/auto/networkselftest/networkselftest.pro b/tests/auto/networkselftest/networkselftest.pro index d7cb7f3..b7c70a1 100644 --- a/tests/auto/networkselftest/networkselftest.pro +++ b/tests/auto/networkselftest/networkselftest.pro @@ -4,12 +4,12 @@ SOURCES += tst_networkselftest.cpp QT = core network wince*: { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT = addFiles DEFINES += SRCDIR=\\\"\\\" } else:symbian { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT = addFiles } else:vxworks*: { diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro index f83e0aa..098b0fe 100644 --- a/tests/auto/patternistexamples/patternistexamples.pro +++ b/tests/auto/patternistexamples/patternistexamples.pro @@ -2,17 +2,17 @@ load(qttest_p4) SOURCES += tst_patternistexamples.cpp CONFIG += qtestlib wince*|symbian: { - snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/* + snippets.files = $$QT_SOURCE_TREE/doc/src/snippets/patternist/* snippets.path = patternist - widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/* + widgetRen.files = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/* widgetRen.path = widgetRenderer - globVar.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/* + globVar.files = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/* globVar.path = globalVariables - filetree.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/filetree/* + filetree.files = $$QT_SOURCE_TREE/examples/xmlpatterns/filetree/* filetree.path = filetree - recipes.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/* + recipes.files = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/* recipes.path = recipes - files.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/* + files.files = $$QT_SOURCE_TREE/examples/xmlpatterns/recipes/files/* files.path = recipes\\files DEPLOYMENT += snippets widgetRen globVar filetree recipes files diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro index 2e2577d..6f5044f 100644 --- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro @@ -4,7 +4,7 @@ QT -= gui SOURCES += tst_qabstractnetworkcache.cpp wince*|symbian: { - testFiles.sources = tests + testFiles.files = tests testFiles.path = . DEPLOYMENT += testFiles } diff --git a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro index a18f4ca..b8f509d 100644 --- a/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro +++ b/tests/auto/qabstractxmlnodemodel/qabstractxmlnodemodel.pro @@ -7,7 +7,7 @@ HEADERS += TestNodeModel.h LoadingModel.h include (../xmlpatterns.pri) wince*: { - addFiles.sources = tree.xml + addFiles.files = tree.xml addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro index 1b30beb..a4f606c 100644 --- a/tests/auto/qaccessibility/qaccessibility.pro +++ b/tests/auto/qaccessibility/qaccessibility.pro @@ -5,7 +5,7 @@ unix:!mac:LIBS+=-lm contains(QT_CONFIG, qt3support): QT += qt3support wince*: { - accessneeded.sources = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll + accessneeded.files = $$QT_BUILD_TREE\\plugins\\accessible\\*.dll accessneeded.path = accessible DEPLOYMENT += accessneeded } \ No newline at end of file diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro index 2c54c37..4c8e9b0 100644 --- a/tests/auto/qapplication/test/test.pro +++ b/tests/auto/qapplication/test/test.pro @@ -4,19 +4,19 @@ SOURCES += ../tst_qapplication.cpp TARGET = ../tst_qapplication wince* { - additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe + additional.files = ../desktopsettingsaware/desktopsettingsaware.exe additional.path = desktopsettingsaware - someTest.sources = test.pro + someTest.files = test.pro someTest.path = test DEPLOYMENT = additional deploy someTest } symbian: { - additional.sources = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe + additional.files = $$OUT_PWD/../desktopsettingsaware/desktopsettingsaware.exe additional.path = desktopsettingsaware - someTest.sources = test.pro + someTest.files = test.pro someTest.path = test - windowIcon.sources = ../heart.svg + windowIcon.files = ../heart.svg DEPLOYMENT = additional deploy someTest windowIcon LIBS += -lcone -lavkon } diff --git a/tests/auto/qaudioinput/qaudioinput.pro b/tests/auto/qaudioinput/qaudioinput.pro index 5eb1613..922c3e4 100644 --- a/tests/auto/qaudioinput/qaudioinput.pro +++ b/tests/auto/qaudioinput/qaudioinput.pro @@ -5,7 +5,7 @@ SOURCES += tst_qaudioinput.cpp QT = core multimedia wince* { - deploy.sources += 4.wav + deploy.files += 4.wav DEPLOYMENT = deploy DEFINES += SRCDIR=\\\"\\\" QT += gui diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro index e1734e0..0bd0151 100644 --- a/tests/auto/qaudiooutput/qaudiooutput.pro +++ b/tests/auto/qaudiooutput/qaudiooutput.pro @@ -5,7 +5,7 @@ SOURCES += tst_qaudiooutput.cpp QT = core multimedia wince*|symbian: { - deploy.sources += 4.wav + deploy.files += 4.wav DEPLOYMENT = deploy !symbian { DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qbytearray/qbytearray.pro b/tests/auto/qbytearray/qbytearray.pro index a0c143e..35e48ad 100644 --- a/tests/auto/qbytearray/qbytearray.pro +++ b/tests/auto/qbytearray/qbytearray.pro @@ -5,7 +5,7 @@ SOURCES += tst_qbytearray.cpp QT = core wince*|symbian { - addFile.sources = rfc3252.txt + addFile.files = rfc3252.txt addFile.path = . DEPLOYMENT += addFile } diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro index 3813e4e..9cfccc2 100644 --- a/tests/auto/qchar/qchar.pro +++ b/tests/auto/qchar/qchar.pro @@ -4,7 +4,7 @@ SOURCES += tst_qchar.cpp QT = core wince*|symbian: { -deploy.sources += NormalizationTest.txt +deploy.files += NormalizationTest.txt DEPLOYMENT = deploy } diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro index 0f8cad1..7d5c2f3 100644 --- a/tests/auto/qclipboard/test/test.pro +++ b/tests/auto/qclipboard/test/test.pro @@ -11,18 +11,18 @@ win32 { } wince*|symbian: { - copier.sources = ../copier/copier.exe + copier.files = ../copier/copier.exe copier.path = copier - paster.sources = ../paster/paster.exe + paster.files = ../paster/paster.exe paster.path = paster symbian: { load(data_caging_paths) - rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc - rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc + rsc.files = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc + rsc.files += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc rsc.path = $$APP_RESOURCE_DIR - reg_resource.sources = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc - reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc + reg_resource.files = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc + reg_resource.files += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc reg_resource.path = $$REG_RESOURCE_IMPORT_DIR } diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index 674064f..f696f19 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -8,9 +8,9 @@ requires(contains(QT_CONFIG,private_tests)) } wince*|symbian: { - addFiles.sources = testdata + addFiles.files = testdata addFiles.path = . - timesFont.sources = C:/Windows/Fonts/times.ttf + timesFont.files = C:/Windows/Fonts/times.ttf timesFont.path = . DEPLOYMENT += addFiles timesFont } diff --git a/tests/auto/qdatastream/qdatastream.pro b/tests/auto/qdatastream/qdatastream.pro index c132073..eba7c00 100644 --- a/tests/auto/qdatastream/qdatastream.pro +++ b/tests/auto/qdatastream/qdatastream.pro @@ -12,13 +12,13 @@ QT += svg wince*: { - addFiles.sources = datastream.q42 tests2.svg + addFiles.files = datastream.q42 tests2.svg addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" } else:symbian { # SRCDIR and SVGFILE defined in code in symbian - addFiles.sources = datastream.q42 tests2.svg + addFiles.files = datastream.q42 tests2.svg addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE = 1000000 10000000 diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro index d32ed4c..43f6cba 100644 --- a/tests/auto/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/qdesktopservices/qdesktopservices.pro @@ -3,22 +3,22 @@ CONFIG += qttest_p4 SOURCES += tst_qdesktopservices.cpp TARGET = tst_qdesktopservices symbian: { - dummy.sources = text\\testfile.txt + dummy.files = text\\testfile.txt dummy.path = . - text.sources = text\\* + text.files = text\\* text.path = \\data\\others - image.sources = image\\* + image.files = image\\* image.path = \\data\\images - audio.sources = audio\\* + audio.files = audio\\* audio.path = \\data\\sounds - video.sources = video\\* + video.files = video\\* video.path = \\data\\videos - install.sources = install\\* + install.files = install\\* install.path = \\data\\installs DEPLOYMENT += image audio video install diff --git a/tests/auto/qdir/qdir.pro b/tests/auto/qdir/qdir.pro index cf612f1..818f52c 100644 --- a/tests/auto/qdir/qdir.pro +++ b/tests/auto/qdir/qdir.pro @@ -4,7 +4,7 @@ RESOURCES += qdir.qrc QT = core wince*|symbian { - DirFiles.sources = testdir testdata searchdir resources entrylist types tst_qdir.cpp + DirFiles.files = testdir testdata searchdir resources entrylist types tst_qdir.cpp DirFiles.path = . DEPLOYMENT += DirFiles } diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro index d60b52d..020b229 100644 --- a/tests/auto/qdiriterator/qdiriterator.pro +++ b/tests/auto/qdiriterator/qdiriterator.pro @@ -4,7 +4,7 @@ RESOURCES += qdiriterator.qrc QT = core wince*|symbian: { - addFiles.sources = entrylist recursiveDirs foo + addFiles.files = entrylist recursiveDirs foo addFiles.path = . DEPLOYMENT += addFiles wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1 diff --git a/tests/auto/qdirmodel/qdirmodel.pro b/tests/auto/qdirmodel/qdirmodel.pro index 36929b9..7037a79 100644 --- a/tests/auto/qdirmodel/qdirmodel.pro +++ b/tests/auto/qdirmodel/qdirmodel.pro @@ -2,11 +2,11 @@ load(qttest_p4) SOURCES += tst_qdirmodel.cpp wince*|symbian { - addit.sources = dirtest\\test1\\* + addit.files = dirtest\\test1\\* addit.path = dirtest\\test1 - tests.sources = test\\* + tests.files = test\\* tests.path = test - sourceFile.sources = tst_qdirmodel.cpp + sourceFile.files = tst_qdirmodel.cpp sourceFile.path = . DEPLOYMENT += addit tests sourceFile } diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro index 9040b91..0a3c167 100644 --- a/tests/auto/qdom/qdom.pro +++ b/tests/auto/qdom/qdom.pro @@ -5,7 +5,7 @@ QT = core xml QT -= gui wince*|symbian: { - addFiles.sources = testdata doubleNamespaces.xml umlaut.xml + addFiles.files = testdata doubleNamespaces.xml umlaut.xml addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qfile/test/test.pro b/tests/auto/qfile/test/test.pro index 70c93ce..c657e9a 100644 --- a/tests/auto/qfile/test/test.pro +++ b/tests/auto/qfile/test/test.pro @@ -3,11 +3,11 @@ SOURCES += ../tst_qfile.cpp wince*|symbian { QT = core gui - files.sources += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \ + files.files += ..\\dosfile.txt ..\\noendofline.txt ..\\testfile.txt \ ..\\testlog.txt ..\\two.dots.file ..\\tst_qfile.cpp \ ..\\Makefile ..\\forCopying.txt ..\\forRenaming.txt files.path = . - resour.sources += ..\\resources\\file1.ext1 + resour.files += ..\\resources\\file1.ext1 resour.path = resources DEPLOYMENT = files resour diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro index 2b87cf1..68f2e3c 100644 --- a/tests/auto/qfiledialog/qfiledialog.pro +++ b/tests/auto/qfiledialog/qfiledialog.pro @@ -7,9 +7,9 @@ load(qttest_p4) SOURCES += tst_qfiledialog.cpp wince*|symbian { - addFiles.sources = *.cpp + addFiles.files = *.cpp addFiles.path = . - filesInDir.sources = *.pro + filesInDir.files = *.pro filesInDir.path = someDir DEPLOYMENT += addFiles filesInDir } diff --git a/tests/auto/qfiledialog2/qfiledialog2.pro b/tests/auto/qfiledialog2/qfiledialog2.pro index 4ebf977..b8924c1 100644 --- a/tests/auto/qfiledialog2/qfiledialog2.pro +++ b/tests/auto/qfiledialog2/qfiledialog2.pro @@ -7,9 +7,9 @@ load(qttest_p4) SOURCES += tst_qfiledialog2.cpp wince*|symbian { - addFiles.sources = *.cpp + addFiles.files = *.cpp addFiles.path = . - filesInDir.sources = *.pro + filesInDir.files = *.pro filesInDir.path = someDir DEPLOYMENT += addFiles filesInDir } diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro index 30656e2..3141db6 100644 --- a/tests/auto/qfileinfo/qfileinfo.pro +++ b/tests/auto/qfileinfo/qfileinfo.pro @@ -7,8 +7,8 @@ QT = core RESOURCES += qfileinfo.qrc wince*:|symbian: { - deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp - res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2 + deploy.files += qfileinfo.qrc tst_qfileinfo.cpp + res.files = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2 res.path = resources DEPLOYMENT = deploy res } diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index 070eb6a..04cea48 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -9,7 +9,7 @@ symbian: { HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h # need to deploy something to create the private directory - dummyDeploy.sources = tst_qfilesystemmodel.cpp + dummyDeploy.files = tst_qfilesystemmodel.cpp dummyDeploy.path = . DEPLOYMENT += dummyDeploy LIBS += -lefsrv diff --git a/tests/auto/qfontdatabase/qfontdatabase.pro b/tests/auto/qfontdatabase/qfontdatabase.pro index 35811f1..e7dfc3c 100644 --- a/tests/auto/qfontdatabase/qfontdatabase.pro +++ b/tests/auto/qfontdatabase/qfontdatabase.pro @@ -3,7 +3,7 @@ SOURCES += tst_qfontdatabase.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian { - additionalFiles.sources = FreeMono.ttf + additionalFiles.files = FreeMono.ttf additionalFiles.path = . DEPLOYMENT += additionalFiles } diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro index 9618962..ac1702e 100644 --- a/tests/auto/qftp/qftp.pro +++ b/tests/auto/qftp/qftp.pro @@ -5,12 +5,12 @@ SOURCES += tst_qftp.cpp QT = core network wince*: { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" } else:symbian { - addFiles.sources = rfc3252.txt + addFiles.files = rfc3252.txt addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro index cc6f585..82fa423 100644 --- a/tests/auto/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro @@ -7,9 +7,9 @@ win32:!wince*: LIBS += -lUser32 DEFINES += QT_NO_CAST_TO_ASCII wince*|symbian: { - rootFiles.sources = Ash_European.jpg graphicsScene_selection.data + rootFiles.files = Ash_European.jpg graphicsScene_selection.data rootFiles.path = . - renderFiles.sources = testData\\render\\* + renderFiles.files = testData\\render\\* renderFiles.path = testData\\render DEPLOYMENT += rootFiles renderFiles } diff --git a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro index 889aac9..a9a8ed9 100644 --- a/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro +++ b/tests/auto/qhelpcontentmodel/qhelpcontentmodel.pro @@ -9,9 +9,9 @@ DEFINES += QT_USE_USING_NAMESPACE wince*: { DEFINES += SRCDIR=\\\"./\\\" QT += network - addFiles.sources = $$PWD/data/*.* + addFiles.files = $$PWD/data/*.* addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + clucene.files = $$QT_BUILD_TREE/lib/QtCLucene*.dll DEPLOYMENT += addFiles DEPLOYMENT += clucene diff --git a/tests/auto/qhelpenginecore/qhelpenginecore.pro b/tests/auto/qhelpenginecore/qhelpenginecore.pro index 27ebd0f..4166fe2 100644 --- a/tests/auto/qhelpenginecore/qhelpenginecore.pro +++ b/tests/auto/qhelpenginecore/qhelpenginecore.pro @@ -10,9 +10,9 @@ DEFINES += QT_USE_USING_NAMESPACE wince*: { DEFINES += SRCDIR=\\\"./\\\" QT += network - addFiles.sources = $$PWD/data/*.* + addFiles.files = $$PWD/data/*.* addFiles.path = data - clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll + clucene.files = $$QT_BUILD_TREE/lib/QtCLucene*.dll DEPLOYMENT += addFiles DEPLOYMENT += clucene diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro index c0be518..5b102ce 100644 --- a/tests/auto/qhttp/qhttp.pro +++ b/tests/auto/qhttp/qhttp.pro @@ -5,20 +5,20 @@ SOURCES += tst_qhttp.cpp QT = core network wince*: { - webFiles.sources = webserver/* + webFiles.files = webserver/* webFiles.path = webserver - cgi.sources = webserver/cgi-bin/* + cgi.files = webserver/cgi-bin/* cgi.path = webserver/cgi-bin - addFiles.sources = rfc3252.txt trolltech + addFiles.files = rfc3252.txt trolltech addFiles.path = . DEPLOYMENT = addFiles webFiles cgi DEFINES += SRCDIR=\\\"\\\" } else:symbian { - webFiles.sources = webserver/* + webFiles.files = webserver/* webFiles.path = webserver - cgi.sources = webserver/cgi-bin/* + cgi.files = webserver/cgi-bin/* cgi.path = webserver/cgi-bin - addFiles.sources = rfc3252.txt trolltech + addFiles.files = rfc3252.txt trolltech addFiles.path = . DEPLOYMENT = addFiles webFiles cgi TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro index cabab3f..c150c9a 100644 --- a/tests/auto/qicoimageformat/qicoimageformat.pro +++ b/tests/auto/qicoimageformat/qicoimageformat.pro @@ -3,21 +3,21 @@ SOURCES+= tst_qicoimageformat.cpp wince*: { DEFINES += SRCDIR=\\\".\\\" - addFiles.sources = icons + addFiles.files = icons addFiles.path = . CONFIG(debug, debug|release):{ - addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll + addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4d.dll } else { - addPlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll + addPlugins.files = $$QT_BUILD_TREE/plugins/imageformats/qico4.dll } addPlugins.path = imageformats DEPLOYMENT += addFiles addPlugins } else:symbian { - addFiles.sources = icons + addFiles.files = icons addFiles.path = . DEPLOYMENT += addFiles qt_not_deployed { - addPlugins.sources = qico.dll + addPlugins.files = qico.dll addPlugins.path = imageformats DEPLOYMENT += addPlugins } diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro index 68b888d..975aaf2 100644 --- a/tests/auto/qicon/qicon.pro +++ b/tests/auto/qicon/qicon.pro @@ -5,10 +5,10 @@ RESOURCES = tst_qicon.qrc wince* { QT += xml svg - addFiles.sources += $$_PRO_FILE_PWD_/*.png - addFiles.sources += $$_PRO_FILE_PWD_/*.svg - addFiles.sources += $$_PRO_FILE_PWD_/*.svgz - addFiles.sources += $$_PRO_FILE_PWD_/tst_qicon.cpp + addFiles.files += $$_PRO_FILE_PWD_/*.png + addFiles.files += $$_PRO_FILE_PWD_/*.svg + addFiles.files += $$_PRO_FILE_PWD_/*.svgz + addFiles.files += $$_PRO_FILE_PWD_/tst_qicon.cpp addFiles.path = . DEPLOYMENT += addFiles @@ -16,11 +16,11 @@ wince* { DEFINES += SRCDIR=\\\".\\\" } else:symbian { QT += xml svg - addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz + addFiles.files = *.png tst_qicon.cpp *.svg *.svgz addFiles.path = . DEPLOYMENT += addFiles qt_not_deployed { - plugins.sources = qsvgicon.dll + plugins.files = qsvgicon.dll plugins.path = iconengines DEPLOYMENT += plugins } diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro index 6469211..798c82e 100644 --- a/tests/auto/qimage/qimage.pro +++ b/tests/auto/qimage/qimage.pro @@ -2,17 +2,17 @@ load(qttest_p4) SOURCES += tst_qimage.cpp wince*: { - addImages.sources = images/* + addImages.files = images/* addImages.path = images DEPLOYMENT += addImages DEFINES += SRCDIR=\\\".\\\" } else:symbian { TARGET.EPOCHEAPSIZE = 0x200000 0x800000 - addImages.sources = images/* + addImages.files = images/* addImages.path = images DEPLOYMENT += addImages qt_not_deployed { - imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll + imagePlugins.files = qjpeg.dll qgif.dll qmng.dll qtiff.dll qico.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins } diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index f8fc7fa..827819d 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -17,10 +17,10 @@ win32-msvc.net:QMAKE_CXXFLAGS -= -Zm300 win32-msvc.net:QMAKE_CXXFLAGS += -Zm1100 wince*: { - images.sources = images + images.files = images images.path = . - imagePlugins.sources = $$QT_BUILD_TREE/plugins/imageformats/*.dll + imagePlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*.dll imagePlugins.path = imageformats DEPLOYMENT += images imagePlugins @@ -28,13 +28,13 @@ wince*: { } symbian: { - images.sources = images + images.files = images images.path = . DEPLOYMENT += images qt_not_deployed { - imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll + imagePlugins.files = qjpeg.dll qgif.dll qmng.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro index f25472f..bab2419 100644 --- a/tests/auto/qimagewriter/qimagewriter.pro +++ b/tests/auto/qimagewriter/qimagewriter.pro @@ -6,16 +6,16 @@ win32-msvc:QMAKE_CXXFLAGS -= -Zm200 win32-msvc:QMAKE_CXXFLAGS += -Zm800 wince*: { - addFiles.sources = images\\*.* + addFiles.files = images\\*.* addFiles.path = images DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\".\\\" } else:symbian { - addFiles.sources = images\\*.* + addFiles.files = images\\*.* addFiles.path = images DEPLOYMENT += addFiles qt_not_deployed { - imagePlugins.sources = qjpeg.dll qtiff.dll + imagePlugins.files = qjpeg.dll qtiff.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins } diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro index 716cdce..29b0a05 100644 --- a/tests/auto/qiodevice/qiodevice.pro +++ b/tests/auto/qiodevice/qiodevice.pro @@ -4,14 +4,14 @@ SOURCES += tst_qiodevice.cpp QT = core network wince*: { - addFiles.sources = tst_qiodevice.cpp + addFiles.files = tst_qiodevice.cpp addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" !wince50standard-x86-msvc2005: DEFINES += WINCE_EMULATOR_TEST=1 } else:symbian { # SRCDIR defined in code in symbian - addFiles.sources = tst_qiodevice.cpp + addFiles.files = tst_qiodevice.cpp addFiles.path = . DEPLOYMENT += addFiles TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro index 92709fe..b348a18 100644 --- a/tests/auto/qitemmodel/qitemmodel.pro +++ b/tests/auto/qitemmodel/qitemmodel.pro @@ -9,7 +9,7 @@ QT += sql # memory on Windows Mobile 5. #wince*: { -# plugFiles.sources = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll +# plugFiles.files = $$QT_BUILD_TREE/plugins/sqldrivers/*.dll # plugFiles.path = sqldrivers # DEPLOYMENT += plugFiles #} @@ -19,7 +19,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro index 297f868..057a6f1 100644 --- a/tests/auto/qlabel/qlabel.pro +++ b/tests/auto/qlabel/qlabel.pro @@ -3,7 +3,7 @@ SOURCES += tst_qlabel.cpp wince*::DEFINES += SRCDIR=\\\"\\\" else:!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" wince*|symbian { - addFiles.sources = *.png \ + addFiles.files = *.png \ testdata addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro index c99f1d9..dfa8584 100644 --- a/tests/auto/qlayout/qlayout.pro +++ b/tests/auto/qlayout/qlayout.pro @@ -7,7 +7,7 @@ load(qttest_p4) SOURCES += tst_qlayout.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - addFiles.sources = baseline + addFiles.files = baseline addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro index 4c647c0..28c40b0 100644 --- a/tests/auto/qlibrary/tst/tst.pro +++ b/tests/auto/qlibrary/tst/tst.pro @@ -12,18 +12,18 @@ win32 { } wince*: { - addFiles.sources = ../*.dll ../*.dl2 ../mylib_noextension + addFiles.files = ../*.dll ../*.dl2 ../mylib_noextension addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" }else:symbian { - binDep.sources = \ + binDep.files = \ mylib.dll \ system.trolltech.test.mylib.dll binDep.path = /sys/bin #mylib.dl2 nonstandard binary deployment will cause warning in emulator, #but it can be safely ignored. - custBinDep.sources = mylib.dl2 + custBinDep.files = mylib.dl2 custBinDep.path = /sys/bin DEPLOYMENT += binDep custBinDep diff --git a/tests/auto/qlocale/test/test.pro b/tests/auto/qlocale/test/test.pro index 6512e19..8117708 100644 --- a/tests/auto/qlocale/test/test.pro +++ b/tests/auto/qlocale/test/test.pro @@ -22,7 +22,7 @@ QT += network embedded: QT += gui wince*: { - addFiles.sources = \ + addFiles.files = \ ../syslocaleapp addFiles.path = "\\Program Files\\tst_qlocale" diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index 687aae2..f91fe58 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -28,19 +28,19 @@ CONFIG(debug_and_release) { } wince* { - additionalFiles.sources = ../lackey/lackey.exe + additionalFiles.files = ../lackey/lackey.exe additionalFiles.path = lackey } symbian { - additionalFiles.sources = lackey.exe + additionalFiles.files = lackey.exe additionalFiles.path = \\sys\\bin TARGET.UID3 = 0xE0340005 DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x","")) } wince*|symbian { - scriptFiles.sources = ../lackey/scripts/*.js + scriptFiles.files = ../lackey/scripts/*.js scriptFiles.path = lackey/scripts DEPLOYMENT = additionalFiles scriptFiles QT += script # for easy deployment of QtScript diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro index 510a70e..6973955 100644 --- a/tests/auto/qmovie/qmovie.pro +++ b/tests/auto/qmovie/qmovie.pro @@ -7,19 +7,19 @@ MOC_DIR=tmp !contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG wince*: { - addFiles.sources = animations\\* + addFiles.files = animations\\* addFiles.path = animations DEPLOYMENT += addFiles } symbian: { - addFiles.sources = animations\\* + addFiles.files = animations\\* addFiles.path = animations DEPLOYMENT += addFiles qt_not_deployed { - imagePlugins.sources = qjpeg.dll qgif.dll qmng.dll + imagePlugins.files = qjpeg.dll qgif.dll qmng.dll imagePlugins.path = imageformats DEPLOYMENT += imagePlugins } diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index 6e1b1e3..7efc2fb 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -16,17 +16,17 @@ QT = core network RESOURCES += ../qnetworkreply.qrc wince*: { - addFiles.sources = ../empty ../rfc3252.txt ../resource + addFiles.files = ../empty ../rfc3252.txt ../resource addFiles.path = . DEPLOYMENT += addFiles } symbian:{ - addFiles.sources = ../empty ../rfc3252.txt ../resource ../bigfile + addFiles.files = ../empty ../rfc3252.txt ../resource ../bigfile addFiles.path = . DEPLOYMENT += addFiles - certFiles.sources = ../certs + certFiles.files = ../certs certFiles.path = . DEPLOYMENT += certFiles diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index 1d6993a..5745e67 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -10,12 +10,12 @@ QT = core \ gui contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT wince*: { - addFiles.sources = signalbug.exe + addFiles.files = signalbug.exe addFiles.path = . DEPLOYMENT += addFiles } symbian: { - addFiles.sources = signalbug.exe + addFiles.files = signalbug.exe addFiles.path = \\sys\\bin DEPLOYMENT += addFiles } diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro index 69dc98d..ee624e1 100644 --- a/tests/auto/qpainter/qpainter.pro +++ b/tests/auto/qpainter/qpainter.pro @@ -2,7 +2,7 @@ load(qttest_p4) contains(QT_CONFIG, qt3support): QT += qt3support SOURCES += tst_qpainter.cpp wince*|symbian: { - addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png + addFiles.files = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index ff8258f..185ec1a 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -3,16 +3,16 @@ SOURCES += tst_qpixmap.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - task31722_0.sources = convertFromImage/task31722_0/*.png + task31722_0.files = convertFromImage/task31722_0/*.png task31722_0.path = convertFromImage/task31722_0 - task31722_1.sources = convertFromImage/task31722_1/*.png + task31722_1.files = convertFromImage/task31722_1/*.png task31722_1.path = convertFromImage/task31722_1 - icons.sources = convertFromToHICON/* + icons.files = convertFromToHICON/* icons.path = convertFromToHICON - loadFromData.sources = loadFromData/* + loadFromData.files = loadFromData/* loadFromData.path = loadFromData DEPLOYMENT += task31722_0 task31722_1 icons loadFromData diff --git a/tests/auto/qpixmapfilter/qpixmapfilter.pro b/tests/auto/qpixmapfilter/qpixmapfilter.pro index e64d68d..964e56d 100644 --- a/tests/auto/qpixmapfilter/qpixmapfilter.pro +++ b/tests/auto/qpixmapfilter/qpixmapfilter.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qpixmapfilter.cpp wince*: { - addFiles.sources = noise.png + addFiles.files = noise.png addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qplugin/tst_qplugin.pro b/tests/auto/qplugin/tst_qplugin.pro index 0d9d809..3629fb3 100644 --- a/tests/auto/qplugin/tst_qplugin.pro +++ b/tests/auto/qplugin/tst_qplugin.pro @@ -4,13 +4,13 @@ SOURCES = tst_qplugin.cpp QT = core wince*: { - plugins.sources = plugins/* + plugins.files = plugins/* plugins.path = plugins DEPLOYMENT += plugins } symbian: { - rpDep.sources = releaseplugin.dll debugplugin.dll + rpDep.files = releaseplugin.dll debugplugin.dll rpDep.path = plugins DEPLOYMENT += rpDep dpDep } diff --git a/tests/auto/qpluginloader/tst/tst.pro b/tests/auto/qpluginloader/tst/tst.pro index e270120..be243b8 100644 --- a/tests/auto/qpluginloader/tst/tst.pro +++ b/tests/auto/qpluginloader/tst/tst.pro @@ -14,15 +14,15 @@ win32 { wince*: { - addFiles.sources = $$OUT_PWD/../bin/*.dll + addFiles.files = $$OUT_PWD/../bin/*.dll addFiles.path = bin DEPLOYMENT += addFiles } symbian: { - libDep.sources = tst_qpluginloaderlib.dll + libDep.files = tst_qpluginloaderlib.dll libDep.path = /sys/bin - pluginDep.sources = theplugin.dll + pluginDep.files = theplugin.dll pluginDep.path = bin DEPLOYMENT += libDep pluginDep diff --git a/tests/auto/qprocess/test/test.pro b/tests/auto/qprocess/test/test.pro index d555067..a91cadd 100644 --- a/tests/auto/qprocess/test/test.pro +++ b/tests/auto/qprocess/test/test.pro @@ -27,61 +27,61 @@ embedded: QT += gui wince*: { - addFile_fileWriterProcess.sources = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe + addFile_fileWriterProcess.files = $$OUT_PWD/../fileWriterProcess/fileWriterProcess.exe addFile_fileWriterProcess.path = fileWriterProcess - addFile_testBatFiles.sources = $$PWD/../testBatFiles/* + addFile_testBatFiles.files = $$PWD/../testBatFiles/* addFile_testBatFiles.path = testBatFiles - addFile_testDetached.sources = $$OUT_PWD/../testDetached/testDetached.exe + addFile_testDetached.files = $$OUT_PWD/../testDetached/testDetached.exe addFile_testDetached.path = testDetached - addFile_testExitCodes.sources = $$OUT_PWD/../testExitCodes/testExitCodes.exe + addFile_testExitCodes.files = $$OUT_PWD/../testExitCodes/testExitCodes.exe addFile_testExitCodes.path = testExitCodes - addFile_testGuiProcess.sources = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe + addFile_testGuiProcess.files = $$OUT_PWD/../testGuiProcess/testGuiProcess.exe addFile_testGuiProcess.path = testGuiProcess - addFile_testProcessCrash.sources = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe + addFile_testProcessCrash.files = $$OUT_PWD/../testProcessCrash/testProcessCrash.exe addFile_testProcessCrash.path = testProcessCrash - addFile_testProcessDeadWhileReading.sources = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe + addFile_testProcessDeadWhileReading.files = $$OUT_PWD/../testProcessDeadWhileReading/testProcessDeadWhileReading.exe addFile_testProcessDeadWhileReading.path = testProcessDeadWhileReading - addFile_testProcessEcho.sources = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe + addFile_testProcessEcho.files = $$OUT_PWD/../testProcessEcho/testProcessEcho.exe addFile_testProcessEcho.path = testProcessEcho - addFile_testProcessEcho2.sources = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe + addFile_testProcessEcho2.files = $$OUT_PWD/../testProcessEcho2/testProcessEcho2.exe addFile_testProcessEcho2.path = testProcessEcho2 - addFile_testProcessEcho3.sources = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe + addFile_testProcessEcho3.files = $$OUT_PWD/../testProcessEcho3/testProcessEcho3.exe addFile_testProcessEcho3.path = testProcessEcho3 - addFile_testProcessEOF.sources = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe + addFile_testProcessEOF.files = $$OUT_PWD/../testProcessEOF/testProcessEOF.exe addFile_testProcessEOF.path = testProcessEOF - addFile_testProcessLoopback.sources = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe + addFile_testProcessLoopback.files = $$OUT_PWD/../testProcessLoopback/testProcessLoopback.exe addFile_testProcessLoopback.path = testProcessLoopback - addFile_testProcessNormal.sources = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe + addFile_testProcessNormal.files = $$OUT_PWD/../testProcessNormal/testProcessNormal.exe addFile_testProcessNormal.path = testProcessNormal - addFile_testProcessOutput.sources = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe + addFile_testProcessOutput.files = $$OUT_PWD/../testProcessOutput/testProcessOutput.exe addFile_testProcessOutput.path = testProcessOutput - addFile_testProcessNoSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe + addFile_testProcessNoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/nospace.exe addFile_testProcessNoSpacesArgs.path = testProcessSpacesArgs - addFile_testProcessOneSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe + addFile_testProcessOneSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"one space".exe addFile_testProcessOneSpacesArgs.path = testProcessSpacesArgs - addFile_testProcessTwoSpacesArgs.sources = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe + addFile_testProcessTwoSpacesArgs.files = $$OUT_PWD/../testProcessSpacesArgs/"two space s".exe addFile_testProcessTwoSpacesArgs.path = testProcessSpacesArgs - addFile_testSoftExit.sources = $$OUT_PWD/../testSoftExit/testSoftExit.exe + addFile_testSoftExit.files = $$OUT_PWD/../testSoftExit/testSoftExit.exe addFile_testSoftExit.path = testSoftExit - addFile_testSpaceInName.sources = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe + addFile_testSpaceInName.files = $$OUT_PWD/../"test Space In Name"/testSpaceInName.exe addFile_testSpaceInName.path = "test Space In Name" @@ -108,7 +108,7 @@ wince*: { } symbian: { - binDep.sources = \ + binDep.files = \ fileWriterProcess.exe \ testDetached.exe \ testExitCodes.exe \ diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index 17e36af..6bdeb1e 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -21,22 +21,22 @@ PRE_TARGETDEPS += $${runtime_resource.target} QT = core wince*|symbian:{ - deploy.sources += runtime_resource.rcc parentdir.txt - test.sources = testqrc/* + deploy.files += runtime_resource.rcc parentdir.txt + test.files = testqrc/* test.path = testqrc - alias.sources = testqrc/aliasdir/* + alias.files = testqrc/aliasdir/* alias.path = testqrc/aliasdir - other.sources = testqrc/otherdir/* + other.files = testqrc/otherdir/* other.path = testqrc/otherdir - search1.sources = testqrc/searchpath1/* + search1.files = testqrc/searchpath1/* search1.path = testqrc/searchpath1 - search2.sources = testqrc/searchpath2/* + search2.files = testqrc/searchpath2/* search2.path = testqrc/searchpath2 - sub.sources = testqrc/subdir/* + sub.files = testqrc/subdir/* sub.path = testqrc/subdir - testsub.sources = testqrc/test/* + testsub.files = testqrc/test/* testsub.path = testqrc/test - testsub2.sources = testqrc/test/test/* + testsub2.files = testqrc/test/test/* testsub2.path = testqrc/test/test DEPLOYMENT = deploy test alias other search1 search2 sub testsub testsub2 !symbian:DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro index fc35f66..c5c2861 100644 --- a/tests/auto/qscriptengine/qscriptengine.pro +++ b/tests/auto/qscriptengine/qscriptengine.pro @@ -10,7 +10,7 @@ wince* { } wince*|symbian: { - addFiles.sources = script + addFiles.files = script addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro index 07a4672..b1ddd64 100644 --- a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro +++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro @@ -5,7 +5,7 @@ SOURCES += tst_qscriptjstestsuite.cpp !symbian: DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian: { -testFiles.sources = tests +testFiles.files = tests testFiles.path = . DEPLOYMENT += testFiles } diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro index 03e26bd..5d8e5af4 100644 --- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro +++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro @@ -4,7 +4,7 @@ SOURCES += tst_qscriptv8testsuite.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian: { -testFiles.sources = tests +testFiles.files = tests testFiles.path = . DEPLOYMENT += testFiles } diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro index bb1981c..a1760f8 100644 --- a/tests/auto/qsound/qsound.pro +++ b/tests/auto/qsound/qsound.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qsound.cpp wince*|symbian: { - deploy.sources += 4.wav + deploy.files += 4.wav DEPLOYMENT = deploy !symbian:DEFINES += SRCDIR=\\\"\\\" } else { diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro index b11e408..5422fae 100644 --- a/tests/auto/qsplitter/qsplitter.pro +++ b/tests/auto/qsplitter/qsplitter.pro @@ -5,7 +5,7 @@ SOURCES += tst_qsplitter.cpp contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - addFiles.sources = extradata.txt setSizes3.dat + addFiles.files = extradata.txt setSizes3.dat addFiles.path = . DEPLOYMENT += addFiles !symbian:DEFINES += SRCDIR=\\\"./\\\" diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro index 0ec581d..9bf30f8 100644 --- a/tests/auto/qsql/qsql.pro +++ b/tests/auto/qsql/qsql.pro @@ -13,7 +13,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro index 6381219..066c24f 100644 --- a/tests/auto/qsqldatabase/qsqldatabase.pro +++ b/tests/auto/qsqldatabase/qsqldatabase.pro @@ -13,7 +13,7 @@ win32: { wince*: { DEPLOYMENT_PLUGIN += qsqlite - testData.sources = testdata + testData.files = testdata testData.path = . DEPLOYMENT += testData @@ -26,7 +26,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro index 2e9ed67..c02d74a 100644 --- a/tests/auto/qsqldriver/qsqldriver.pro +++ b/tests/auto/qsqldriver/qsqldriver.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqldriver.cpp QT += sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -20,7 +20,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro index 456f585..ebf6d24 100644 --- a/tests/auto/qsqlerror/qsqlerror.pro +++ b/tests/auto/qsqlerror/qsqlerror.pro @@ -11,7 +11,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro index 7339854..2359151 100644 --- a/tests/auto/qsqlfield/qsqlfield.pro +++ b/tests/auto/qsqlfield/qsqlfield.pro @@ -7,7 +7,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro index 97646ed..fbcc998 100644 --- a/tests/auto/qsqlquery/qsqlquery.pro +++ b/tests/auto/qsqlquery/qsqlquery.pro @@ -8,7 +8,7 @@ QT = core sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -18,7 +18,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro index cda8cab..4b23e94 100644 --- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro @@ -10,7 +10,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro index f36f076..16e3ae4 100644 --- a/tests/auto/qsqlrecord/qsqlrecord.pro +++ b/tests/auto/qsqlrecord/qsqlrecord.pro @@ -5,7 +5,7 @@ symbian { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index c6681d5..dad42d5 100644 --- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqlrelationaltablemodel.cpp QT += sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -12,7 +12,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro index 9a23237..e49020f 100644 --- a/tests/auto/qsqltablemodel/qsqltablemodel.pro +++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqltablemodel.cpp QT += sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -12,7 +12,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro index 5522232..2e4c72a 100644 --- a/tests/auto/qsqlthread/qsqlthread.pro +++ b/tests/auto/qsqlthread/qsqlthread.pro @@ -5,7 +5,7 @@ QT = core sql wince*: { - plugFiles.sources = ../../../plugins/sqldrivers + plugFiles.files = ../../../plugins/sqldrivers plugFiles.path = . DEPLOYMENT += plugFiles LIBS += -lws2 @@ -13,7 +13,7 @@ wince*: { qt_not_deployed { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.files = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro index d7671ea..e21587b 100644 --- a/tests/auto/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/qsslcertificate/qsslcertificate.pro @@ -15,7 +15,7 @@ win32 { } wince*|symbian: { - certFiles.sources = certificates more-certificates + certFiles.files = certificates more-certificates certFiles.path = . DEPLOYMENT += certFiles } diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro index dff0db1..5a90b76 100644 --- a/tests/auto/qsslkey/qsslkey.pro +++ b/tests/auto/qsslkey/qsslkey.pro @@ -15,10 +15,10 @@ win32 { } wince*|symbian: { - keyFiles.sources = keys + keyFiles.files = keys keyFiles.path = . - passphraseFiles.sources = rsa-without-passphrase.pem rsa-with-passphrase.pem + passphraseFiles.files = rsa-without-passphrase.pem rsa-with-passphrase.pem passphraseFiles.path = . DEPLOYMENT += keyFiles passphraseFiles diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index accfa89..aeeae8f 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -18,7 +18,7 @@ win32 { wince* { DEFINES += SRCDIR=\\\"./\\\" - certFiles.sources = certs ssl.tar.gz + certFiles.files = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles } else:symbian { @@ -26,7 +26,7 @@ wince* { TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY=NetworkServices - certFiles.sources = certs ssl.tar.gz + certFiles.files = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro index 11f5943..eb198e2 100644 --- a/tests/auto/qstyle/qstyle.pro +++ b/tests/auto/qstyle/qstyle.pro @@ -4,7 +4,7 @@ SOURCES += tst_qstyle.cpp wince*|symbian: { !symbian:DEFINES += SRCDIR=\\\".\\\" - addPixmap.sources = task_25863.png + addPixmap.files = task_25863.png addPixmap.path = . DEPLOYMENT += addPixmap } else { diff --git a/tests/auto/qsvggenerator/qsvggenerator.pro b/tests/auto/qsvggenerator/qsvggenerator.pro index 1ccf8e9..2e899a9 100644 --- a/tests/auto/qsvggenerator/qsvggenerator.pro +++ b/tests/auto/qsvggenerator/qsvggenerator.pro @@ -8,7 +8,7 @@ QT += svg xml SOURCES += tst_qsvggenerator.cpp wince*|symbian { - addFiles.sources = referenceSvgs + addFiles.files = referenceSvgs addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qsvgrenderer/qsvgrenderer.pro b/tests/auto/qsvgrenderer/qsvgrenderer.pro index 0b785e3..49337e2 100644 --- a/tests/auto/qsvgrenderer/qsvgrenderer.pro +++ b/tests/auto/qsvgrenderer/qsvgrenderer.pro @@ -9,7 +9,7 @@ SOURCES += tst_qsvgrenderer.cpp RESOURCES += resources.qrc wince*|symbian { - addFiles.sources = *.svg *.svgz + addFiles.files = *.svg *.svgz addFiles.path = . DEPLOYMENT += addFiles diff --git a/tests/auto/qtcpserver/test/test.pro b/tests/auto/qtcpserver/test/test.pro index 123c79e..e91ba20 100644 --- a/tests/auto/qtcpserver/test/test.pro +++ b/tests/auto/qtcpserver/test/test.pro @@ -4,7 +4,7 @@ SOURCES += ../tst_qtcpserver.cpp win32: { wince*: { LIBS += -lws2 - crashApp.sources = ../crashingServer/crashingServer.exe + crashApp.files = ../crashingServer/crashingServer.exe crashApp.path = crashingServer DEPLOYMENT += crashApp } else { @@ -13,7 +13,7 @@ wince*: { } symbian { - crashApp.sources = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe + crashApp.files = $$QT_BUILD_TREE/examples/widgets/wiggly/$${BUILD_DIR}/crashingServer.exe crashApp.path = . DEPLOYMENT += crashApp } diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index c93a2e5..543c143 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -4,7 +4,7 @@ QT = core symbian { - testData.sources = tst_qtemporaryfile.cpp + testData.files = tst_qtemporaryfile.cpp testData.path = . DEPLOYMENT += testData }else { diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro index aa1fbb5..e8fb9cb 100644 --- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro +++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro @@ -5,7 +5,7 @@ SOURCES += tst_qtextboundaryfinder.cpp !symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\" wince*|symbian:{ - addFiles.sources = data + addFiles.files = data addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro index 88061a9..773fb97 100644 --- a/tests/auto/qtextbrowser/qtextbrowser.pro +++ b/tests/auto/qtextbrowser/qtextbrowser.pro @@ -6,9 +6,9 @@ contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - addFiles.sources = *.html + addFiles.files = *.html addFiles.path = . - addDir.sources = subdir/* + addDir.files = subdir/* addDir.path = subdir DEPLOYMENT += addFiles addDir } diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro index b85032a..2188d2f 100644 --- a/tests/auto/qtextcodec/test/test.pro +++ b/tests/auto/qtextcodec/test/test.pro @@ -17,7 +17,7 @@ win32: { } wince*|symbian { - addFiles.sources = ../*.txt + addFiles.files = ../*.txt addFiles.path = . DEPLOYMENT += addFiles wince*|qt_not_deployed { diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro index 43813da..e7d6c03 100644 --- a/tests/auto/qtextedit/qtextedit.pro +++ b/tests/auto/qtextedit/qtextedit.pro @@ -6,7 +6,7 @@ HEADERS += SOURCES += tst_qtextedit.cpp wince*|symbian: { - addImages.sources = fullWidthSelection/* + addImages.files = fullWidthSelection/* addImages.path = fullWidthSelection DEPLOYMENT += addImages } diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro index 20823de..8805fb9 100644 --- a/tests/auto/qtextstream/test/test.pro +++ b/tests/auto/qtextstream/test/test.pro @@ -18,9 +18,9 @@ QT = core network wince*|symbian: { - addFiles.sources = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp + addFiles.files = ../rfc3261.txt ../shift-jis.txt ../task113817.txt ../qtextstream.qrc ../tst_qtextstream.cpp addFiles.path = . - res.sources = ../resources + res.files = ../resources res.path = . DEPLOYMENT += addFiles } @@ -30,7 +30,7 @@ wince*: { }else:symbian { # Symbian can't define SRCDIR meaningfully here qt_not_deployed { - codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll + codecs_plugins.files = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs DEPLOYMENT += codecs_plugins } diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro index 68a5362..50c2669 100644 --- a/tests/auto/qtipc/qsharedmemory/test/test.pro +++ b/tests/auto/qtipc/qsharedmemory/test/test.pro @@ -20,16 +20,16 @@ TARGET = ../tst_qsharedmemory wince*:{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts +addFiles.files = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\".\\\" }else:symbian{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../../lackey/scripts +addFiles.files = ../../lackey/scripts addFiles.path = /data/qsharedmemorytemp/lackey -addBin.sources = lackey.exe +addBin.files = lackey.exe addBin.path = /sys/bin DEPLOYMENT += addFiles addBin } else { diff --git a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro index 8a5f8b2..bb319ee 100644 --- a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro +++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro @@ -17,7 +17,7 @@ requires(contains(QT_CONFIG,script)) # this test calls lackey, which then again depends on QtScript. # let's add it here so that it gets deployed easily QT += script -lackey.sources = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts +lackey.files = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts lackey.path = . DEPLOYMENT += lackey } @@ -28,7 +28,7 @@ requires(contains(QT_CONFIG,script)) # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../lackey/lackey.exe +lackey.files = ../lackey/lackey.exe lackey.path = /sys/bin DEPLOYMENT += lackey } diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro index 5b742f7..0001d1c 100644 --- a/tests/auto/qtranslator/qtranslator.pro +++ b/tests/auto/qtranslator/qtranslator.pro @@ -3,7 +3,7 @@ SOURCES += tst_qtranslator.cpp RESOURCES += qtranslator.qrc wince*|symbian: { - addFiles.sources = hellotr_la.qm msgfmt_from_po.qm + addFiles.files = hellotr_la.qm msgfmt_from_po.qm addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro index 9c0d009..7e5ffe4 100644 --- a/tests/auto/qudpsocket/test/test.pro +++ b/tests/auto/qudpsocket/test/test.pro @@ -15,7 +15,7 @@ win32 { } wince*|symbian: { - addApp.sources = ../clientserver/clientserver.exe + addApp.files = ../clientserver/clientserver.exe addApp.path = clientserver DEPLOYMENT += addApp } diff --git a/tests/auto/quuid/test/test.pro b/tests/auto/quuid/test/test.pro index 123aa50..06ae3bd 100644 --- a/tests/auto/quuid/test/test.pro +++ b/tests/auto/quuid/test/test.pro @@ -15,14 +15,14 @@ CONFIG(debug_and_release_target) { } wince* { - addFile_processUniqueness.sources = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe + addFile_processUniqueness.files = $$OUT_PWD/../testProcessUniqueness/testProcessUniqueness.exe addFile_processUniqueness.path = testProcessUniqueness DEPLOYMENT += addFile_processUniqueness } symbian { - binDep.sources = testProcessUniqueness.exe + binDep.files = testProcessUniqueness.exe binDep.path = \\sys\\bin DEPLOYMENT += binDep diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro index 5fb7fe2..c87518a 100644 --- a/tests/auto/qxml/qxml.pro +++ b/tests/auto/qxml/qxml.pro @@ -4,7 +4,7 @@ SOURCES += tst_qxml.cpp QT = core xml wince*|symbian: { - addFiles.sources = 0x010D.xml + addFiles.files = 0x010D.xml addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro index 339fa55..bcab0b4 100644 --- a/tests/auto/qxmlformatter/qxmlformatter.pro +++ b/tests/auto/qxmlformatter/qxmlformatter.pro @@ -4,7 +4,7 @@ SOURCES += tst_qxmlformatter.cpp include (../xmlpatterns.pri) wince*|symbian:{ - addFiles.sources = baselines input + addFiles.files = baselines input addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro index 044b7ce..d5e8228 100644 --- a/tests/auto/qxmlquery/qxmlquery.pro +++ b/tests/auto/qxmlquery/qxmlquery.pro @@ -19,10 +19,10 @@ wince* { include (../xmlpatterns.pri) wince*|symbian: { - addFiles.sources = pushBaselines input.xml + addFiles.files = pushBaselines input.xml addFiles.path = . - patternistFiles.sources = ../xmlpatterns/queries + patternistFiles.files = ../xmlpatterns/queries symbian: { #../xmlpatterns resolves to an illegal path for deployment patternistFiles.path = xmlpatterns diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro index c107470..bc3cbd2 100644 --- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro +++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro @@ -13,7 +13,7 @@ QT -= gui wince*|symbian: { - addFiles.sources = encodings parser xmldocs + addFiles.files = encodings parser xmldocs addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro index 8f076be..31d77e7 100644 --- a/tests/auto/qxmlstream/qxmlstream.pro +++ b/tests/auto/qxmlstream/qxmlstream.pro @@ -5,7 +5,7 @@ QT = core xml network wince*|symbian: { - addFiles.sources = data XML-Test-Suite + addFiles.files = data XML-Test-Suite addFiles.path = . DEPLOYMENT += addFiles DEFINES += SRCDIR=\\\"\\\" diff --git a/tests/auto/qzip/qzip.pro b/tests/auto/qzip/qzip.pro index 632c743..683da62 100644 --- a/tests/auto/qzip/qzip.pro +++ b/tests/auto/qzip/qzip.pro @@ -2,7 +2,7 @@ load(qttest_p4) SOURCES += tst_qzip.cpp wince*|symbian: { - addFiles.sources = testdata + addFiles.files = testdata addFiles.path = . DEPLOYMENT += addFiles !symbian:DEFINES += SRCDIR=\\\".\\\" diff --git a/tests/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro index d99df00..4e95956 100644 --- a/tests/auto/uiloader/uiloader/uiloader.pro +++ b/tests/auto/uiloader/uiloader/uiloader.pro @@ -17,10 +17,10 @@ QT += xml svg network contains(QT_CONFIG, qt3support): QT += qt3support wince*|symbian: { - configuration.sources = ../*.ini + configuration.files = ../*.ini configuration.path = . - screenapp.sources = ../tst_screenshot/tst_screenshot.exe + screenapp.files = ../tst_screenshot/tst_screenshot.exe screenapp.path = tst_screenshot DEPLOYMENT += configuration screenapp diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro index f3124a3..b0536a5 100644 --- a/tests/auto/windowsmobile/test/test.pro +++ b/tests/auto/windowsmobile/test/test.pro @@ -8,7 +8,7 @@ RESOURCES += windowsmobile.qrc TARGET = ../tst_windowsmobile wincewm*: { - addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe + addFiles.files = $$OUT_PWD/../testQMenuBar/*.exe addFiles.path = "\\Program Files\\tst_windowsmobile" diff --git a/tests/auto/xmlpatterns.pri b/tests/auto/xmlpatterns.pri index 8c8ccad..57b8517 100644 --- a/tests/auto/xmlpatterns.pri +++ b/tests/auto/xmlpatterns.pri @@ -4,9 +4,9 @@ contains(QT_CONFIG,xmlpatterns) { } wince*: { - patternsdk.sources = $$QT_BUILD_TREE/lib/QtXmlPatternsSDK*.dll + patternsdk.files = $$QT_BUILD_TREE/lib/QtXmlPatternsSDK*.dll patternsdk.path = . - basedata.sources = xmlpaternsxqts/Baseline.xml + basedata.files = xmlpaternsxqts/Baseline.xml basedata.path = . DEPLOYMENT += patternsdk QT += network diff --git a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro index 981adab..3e252f6 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro +++ b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro @@ -21,7 +21,7 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ ../xmlpatternssdk wince*|symbian { - catalog.sources = TestSuite Baseline.xml + catalog.files = TestSuite Baseline.xml catalog.path = . DEPLOYMENT += catalog } diff --git a/tests/auto/xmlpatternsview/xmlpatternsview.pro b/tests/auto/xmlpatternsview/xmlpatternsview.pro index d93cba3..5ab0f0e 100644 --- a/tests/auto/xmlpatternsview/xmlpatternsview.pro +++ b/tests/auto/xmlpatternsview/xmlpatternsview.pro @@ -6,7 +6,7 @@ include (../xmlpatterns.pri) TARGET = tst_xmlpatternsview wince*: { - viewexe.sources = $$QT_BUILD_TREE/xmlpatternsview.exe + viewexe.files = $$QT_BUILD_TREE/xmlpatternsview.exe viewexe.path = . DEPLOYMENT += viewexe } diff --git a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro index 940cc31..44c4754 100644 --- a/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro +++ b/tests/auto/xmlpatternsxslts/xmlpatternsxslts.pro @@ -18,7 +18,7 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternssdk \ ../xmlpatternssdk wince*: { - testdata.sources = XSLTS Baseline.xml + testdata.files = XSLTS Baseline.xml testdata.path = . DEPLOYMENT += testdata } diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro index 23f0e00..f26d623 100644 --- a/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro +++ b/tests/benchmarks/corelib/codecs/qtextcodec/qtextcodec.pro @@ -6,7 +6,7 @@ SOURCES += main.cpp wince*:{ DEFINES += SRCDIR=\\\"\\\" } else:symbian* { - addFiles.sources = utf-8.txt + addFiles.files = utf-8.txt addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro index 320746c..17d164d 100755 --- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro +++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro @@ -16,7 +16,7 @@ SOURCES += qfilesystemiterator.cpp HEADERS += qfilesystemiterator.h wince*|symbian: { - corelibdir.sources = $$QT_SOURCE_TREE/src/corelib + corelibdir.files = $$QT_SOURCE_TREE/src/corelib corelibdir.path = ./depot/src DEPLOYMENT += corelibdir } diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/tools/qstring/qstring.pro index e8720e1..e43e400 100644 --- a/tests/benchmarks/corelib/tools/qstring/qstring.pro +++ b/tests/benchmarks/corelib/tools/qstring/qstring.pro @@ -6,7 +6,7 @@ SOURCES += main.cpp data.cpp wince*:{ DEFINES += SRCDIR=\\\"\\\" } else:symbian* { - addFiles.sources = utf-8.txt + addFiles.files = utf-8.txt addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" diff --git a/tests/benchmarks/declarative/binding/binding.pro b/tests/benchmarks/declarative/binding/binding.pro index c1a8223..ceaabeb 100644 --- a/tests/benchmarks/declarative/binding/binding.pro +++ b/tests/benchmarks/declarative/binding/binding.pro @@ -8,7 +8,7 @@ SOURCES += tst_binding.cpp testtypes.cpp HEADERS += testtypes.h symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT = data } else { diff --git a/tests/benchmarks/declarative/compilation/compilation.pro b/tests/benchmarks/declarative/compilation/compilation.pro index 9277187..9ab2a25 100644 --- a/tests/benchmarks/declarative/compilation/compilation.pro +++ b/tests/benchmarks/declarative/compilation/compilation.pro @@ -9,7 +9,7 @@ CONFIG += release SOURCES += tst_compilation.cpp symbian { - data.sources += data + data.files += data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/creation/creation.pro b/tests/benchmarks/declarative/creation/creation.pro index 6540fa2..74cb47f 100644 --- a/tests/benchmarks/declarative/creation/creation.pro +++ b/tests/benchmarks/declarative/creation/creation.pro @@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_creation.cpp symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro index b2f39c1..4693a82 100644 --- a/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro +++ b/tests/benchmarks/declarative/qdeclarativecomponent/qdeclarativecomponent.pro @@ -8,7 +8,7 @@ SOURCES += tst_qdeclarativecomponent.cpp testtypes.cpp HEADERS += testtypes.h symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro index a68792b..c4d5609 100644 --- a/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro +++ b/tests/benchmarks/declarative/qdeclarativeimage/qdeclarativeimage.pro @@ -8,7 +8,7 @@ CONFIG += release SOURCES += tst_qdeclarativeimage.cpp symbian { - importFiles.sources = image.png + importFiles.files = image.png importFiles.path = DEPLOYMENT = importFiles } else { diff --git a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro index 65ee7e0..765e37a 100644 --- a/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro +++ b/tests/benchmarks/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro @@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qdeclarativemetaproperty.cpp symbian { - data.sources += data + data.files += data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/declarative/qmltime/qmltime.pro b/tests/benchmarks/declarative/qmltime/qmltime.pro index 6f5ad5e..273a60a 100644 --- a/tests/benchmarks/declarative/qmltime/qmltime.pro +++ b/tests/benchmarks/declarative/qmltime/qmltime.pro @@ -8,7 +8,7 @@ SOURCES += qmltime.cpp symbian { TARGET.CAPABILITY = "All -TCB" - example.sources = example.qml tests + example.files = example.qml tests example.path = . DEPLOYMENT += example } diff --git a/tests/benchmarks/declarative/script/script.pro b/tests/benchmarks/declarative/script/script.pro index 685ba03..d6cb708 100644 --- a/tests/benchmarks/declarative/script/script.pro +++ b/tests/benchmarks/declarative/script/script.pro @@ -8,7 +8,7 @@ CONFIG += release SOURCES += tst_script.cpp symbian { - importFiles.sources = data + importFiles.files = data importFiles.path = DEPLOYMENT = importFiles } else { diff --git a/tests/benchmarks/declarative/typeimports/typeimports.pro b/tests/benchmarks/declarative/typeimports/typeimports.pro index a5df3f0..56834e6 100644 --- a/tests/benchmarks/declarative/typeimports/typeimports.pro +++ b/tests/benchmarks/declarative/typeimports/typeimports.pro @@ -7,7 +7,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_typeimports.cpp symbian { - data.sources = data + data.files = data data.path = . DEPLOYMENT += data } else { diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro index 6e044f9..bfa374c 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/qgraphicsview.pro @@ -9,7 +9,7 @@ include(chiptester/chiptester.pri) symbian { qt_not_deployed { - plugins.sources = qjpeg.dll + plugins.files = qjpeg.dll plugins.path = imageformats DEPLOYMENT += plugins } diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro index d67f4be..db5ffcd 100644 --- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro +++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro @@ -11,15 +11,15 @@ SOURCES += tst_qimagereader.cpp QT += network wince*: { - addFiles.sources = images + addFiles.files = images addFiles.path = . CONFIG(debug, debug|release):{ - imageFormatsPlugins.sources = $$(QTDIR)/plugins/imageformats/*d4.dll + imageFormatsPlugins.files = $$(QTDIR)/plugins/imageformats/*d4.dll } CONFIG(release, debug|release):{ - imageFormatsPlugins.sources = $$(QTDIR)/plugins/imageformats/*[^d]4.dll + imageFormatsPlugins.files = $$(QTDIR)/plugins/imageformats/*[^d]4.dll } imageFormatsPlugins.path = imageformats DEPLOYMENT += addFiles imageFormatsPlugins diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro index a1b6a22..1c18302 100644 --- a/tests/benchmarks/gui/text/qtext/qtext.pro +++ b/tests/benchmarks/gui/text/qtext/qtext.pro @@ -6,7 +6,7 @@ SOURCES += main.cpp symbian* { TARGET.CAPABILITY = ALL -TCB - addFiles.sources = bidi.txt + addFiles.files = bidi.txt addFiles.path = . DEPLOYMENT += addFiles } else { diff --git a/tests/manual/textrendering/glyphshaping/glyphshaping.pro b/tests/manual/textrendering/glyphshaping/glyphshaping.pro index caa9028..1d78aa3 100644 --- a/tests/manual/textrendering/glyphshaping/glyphshaping.pro +++ b/tests/manual/textrendering/glyphshaping/glyphshaping.pro @@ -1,5 +1,5 @@ SOURCES = main.cpp OTHER_FILES = glyphshaping_data.xml glyphshaping_data.path = . -glyphshaping_data.sources = $$PWD/glyphshaping_data.xml +glyphshaping_data.files = $$PWD/glyphshaping_data.xml DEPLOYMENT += glyphshaping_data -- cgit v0.12 From 4d974ff0a748b22e668a4cb7ef38101122c85b3b Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Fri, 8 Oct 2010 14:21:10 +0200 Subject: Avoid in-place convertion of images with multiple references The decoding from image reader was assuming the image reader do not keep the image internally. This is not true for the GIF plugins because the previous image can be used to compose the current image. This was causing crash on ARM because the 16 bits color depth causes the image memory to be reduce by half. When the plugin was accessing the memory, it assumes the images has not changed and is on 32 bits. This patch disable the in-place conversion if a detach is required. Regular conversion is the correct solution in this case, and it can also be made faster by converting while copying. Reviewed-by: Andreas Kling --- src/gui/image/qimage.cpp | 4 ++++ tests/auto/qpixmap/tst_qpixmap.cpp | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ac148ee..1157b93 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -6607,6 +6607,10 @@ bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFla if (format == newFormat) return true; + // No in-place conversion if we have to detach + if (ref > 1) + return false; + const InPlace_Image_Converter *const converterPtr = &inplace_converter_map[format][newFormat]; InPlace_Image_Converter converter = *converterPtr; if (converter) diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 8005ec5..24cbb21 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -179,6 +179,7 @@ private slots: void fromImageReader_data(); void fromImageReader(); + void fromImageReaderAnimatedGif_data(); void fromImageReaderAnimatedGif(); void preserveDepth(); @@ -1605,6 +1606,8 @@ void tst_QPixmap::fromImageReader_data() QTest::newRow("designer_indexed8_no_alpha.gif") << prefix + "/designer_indexed8_no_alpha.gif"; QTest::newRow("designer_indexed8_with_alpha.gif") << prefix + "/designer_indexed8_with_alpha.gif"; QTest::newRow("designer_rgb32.jpg") << prefix + "/designer_rgb32.jpg"; + QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_with_alpha_animated.gif"; + QTest::newRow("designer_indexed8_with_alpha_animated") << prefix + "/designer_indexed8_no_alpha_animated.gif"; } void tst_QPixmap::fromImageReader() @@ -1621,14 +1624,22 @@ void tst_QPixmap::fromImageReader() QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap)); } +void tst_QPixmap::fromImageReaderAnimatedGif_data() +{ + QTest::addColumn("imagePath"); + QTest::newRow("gif with alpha") << QString::fromLatin1("/designer_indexed8_with_alpha_animated.gif"); + QTest::newRow("gif without alpha") << QString::fromLatin1("/designer_indexed8_no_alpha_animated.gif"); +} + void tst_QPixmap::fromImageReaderAnimatedGif() { + QFETCH(QString, imagePath); #ifdef Q_OS_SYMBIAN const QString prefix = QLatin1String(SRCDIR) + "loadFromData"; #else const QString prefix = QLatin1String(SRCDIR) + "/loadFromData"; #endif - const QString path = prefix + QString::fromLatin1("/designer_indexed8_with_alpha_animated.gif"); + const QString path = prefix + imagePath; QImageReader referenceReader(path); QImageReader pixmapReader(path); -- cgit v0.12 From 7ca4e9622c4b2e4142d401fa10d50a0a45906615 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 7 Oct 2010 15:26:47 +0200 Subject: Fixed missing QMAKE_MOC definition in certain mkspecs. Also removed the use of DIR_SEPARATOR. It does not get defined until after symbian.conf has finished parsing. RevBy: Miikka Heikkinen --- mkspecs/common/symbian/symbian-mmp.conf | 10 ---------- mkspecs/common/symbian/symbian.conf | 8 ++++++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf index 5292781..1fbd302 100644 --- a/mkspecs/common/symbian/symbian-mmp.conf +++ b/mkspecs/common/symbian/symbian-mmp.conf @@ -4,16 +4,6 @@ include(symbian.conf) -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 -} 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 -} - load(symbian/add_mmp_rules) symbian-abld { diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index cc5b788..d8c38f4 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -95,6 +95,10 @@ contains(QMAKE_HOST.os,Windows) { QMAKE_DEL_DIR = rmdir QMAKE_DEL_TREE = rmdir /s /q QMAKE_CHK_DIR_EXISTS = if not exist + + QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe + QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe + QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe } else { QMAKE_COPY = cp QMAKE_COPY_DIR = cp -r @@ -104,6 +108,10 @@ contains(QMAKE_HOST.os,Windows) { QMAKE_DEL_DIR = rmdir QMAKE_DEL_TREE = rm -rf QMAKE_CHK_DIR_EXISTS = test -d + + QMAKE_MOC = $$[QT_INSTALL_BINS]/moc + QMAKE_UIC = $$[QT_INSTALL_BINS]/uic + QMAKE_IDC = $$[QT_INSTALL_BINS]/idc } QMAKE_IDL = midl -- cgit v0.12 From aa0f3a7745472ea8c9ca43bb7d690a0591bde83b Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 8 Oct 2010 14:58:44 +0200 Subject: Fixed some preprocessor parameters for Mac support. RevBy: Liang Qi --- mkspecs/features/symbian/symbian_building.prf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index 614fb65..1a51cb2 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -229,7 +229,7 @@ symbian_resources_INCLUDES = $$replace(symbian_resources_INCLUDES, ",", " -I") symbian_resources_INCLUDES += $$join(INCLUDEPATH, " -I", "-I") symbian_resources_DEFINES = $$join(DEFINES, " -D", "-D") symbian_resources_RCC_DIR = $$replace(RCC_DIR, "/$", "") -symbian_resources_INCLUDES += "-I $$symbian_resources_RCC_DIR" +symbian_resources_INCLUDES += "-I$$symbian_resources_RCC_DIR" for(symbian_resource, SYMBIAN_RESOURCES) { symbian_resource = $$basename(symbian_resource) @@ -245,7 +245,7 @@ symbianresources.commands = cpp -nostdinc -undef \ $$symbian_resources_INCLUDES \ $$symbian_resources_DEFINES \ ${QMAKE_FILE_NAME} \ - -o $${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \ + > $${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \ && rcomp -u -m045,046,047 \ -s$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \ -o$${symbianDestdir}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsc \ @@ -265,7 +265,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { $$symbian_resources_INCLUDES \ $$symbian_resources_DEFINES \ $${baseTarget}.rss \ - -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \ + > $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \ && rcomp -u -m045,046,047 \ -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \ -o$${symbianDestdir}/$${baseTarget}.rsc \ @@ -284,7 +284,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { $$symbian_resources_INCLUDES \ $$symbian_resources_DEFINES \ $${baseTarget}_reg.rss \ - -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \ + > $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \ && rcomp -u -m045,046,047 \ -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \ -o$${symbianDestdir}/$${baseTarget}_reg.rsc \ -- cgit v0.12 From 4ee912a752a4b7f129e98e180328f1f46f053d4f Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 1 Oct 2010 13:25:28 +0200 Subject: Added support for using inputMethodHints in QInputDialog edit widget. AutoTest: Included Task: QTBUG-13200 RevBy: Denis Dzyubenko --- src/gui/dialogs/qinputdialog.cpp | 6 ++++++ src/gui/kernel/qwidget.cpp | 11 +++++++++-- src/gui/kernel/qwidget_p.h | 3 +++ tests/auto/qinputdialog/tst_qinputdialog.cpp | 20 ++++++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index e996ee9..700b234 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -244,6 +244,9 @@ void QInputDialogPrivate::ensureLineEdit() Q_Q(QInputDialog); if (!lineEdit) { lineEdit = new QLineEdit(q); +#ifndef QT_NO_IM + qt_widget_private(lineEdit)->inheritsInputMethodHints = 1; +#endif lineEdit->hide(); QObject::connect(lineEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_textChanged(QString))); @@ -255,6 +258,9 @@ void QInputDialogPrivate::ensureComboBox() Q_Q(QInputDialog); if (!comboBox) { comboBox = new QComboBox(q); +#ifndef QT_NO_IM + qt_widget_private(comboBox)->inheritsInputMethodHints = 1; +#endif comboBox->hide(); QObject::connect(comboBox, SIGNAL(editTextChanged(QString)), q, SLOT(_q_textChanged(QString))); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index dc0dbf4..330d699 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -273,6 +273,9 @@ QWidgetPrivate::QWidgetPrivate(int version) , isMoved(0) , isGLWidget(0) , usesDoubleBufferedGLContext(0) +#ifndef QT_NO_IM + , inheritsInputMethodHints(0) +#endif #if defined(Q_WS_X11) , picture(0) #elif defined(Q_WS_WIN) @@ -9228,9 +9231,13 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const */ Qt::InputMethodHints QWidget::inputMethodHints() const { - Q_D(const QWidget); #ifndef QT_NO_IM - return d->imHints; + const QWidgetPrivate *priv = d_func(); + while (priv->inheritsInputMethodHints) { + priv = priv->q_func()->parentWidget()->d_func(); + Q_ASSERT(priv); + } + return priv->imHints; #else //QT_NO_IM return 0; #endif //QT_NO_IM diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 4a79dc7..6c89659 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -748,6 +748,9 @@ public: uint isMoved : 1; uint isGLWidget : 1; uint usesDoubleBufferedGLContext : 1; +#ifndef QT_NO_IM + uint inheritsInputMethodHints : 1; +#endif // *************************** Platform specific ************************************ #if defined(Q_WS_X11) // <----------------------------------------------------------- X11 diff --git a/tests/auto/qinputdialog/tst_qinputdialog.cpp b/tests/auto/qinputdialog/tst_qinputdialog.cpp index 0d6644a..5d03142 100644 --- a/tests/auto/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/qinputdialog/tst_qinputdialog.cpp @@ -74,6 +74,7 @@ private slots: void getItem_data(); void getItem(); void task256299_getTextReturnNullStringOnRejected(); + void inputMethodHintsOfChildWidget(); }; QString stripFraction(const QString &s) @@ -404,5 +405,24 @@ void tst_QInputDialog::getItem() delete parent; } +void tst_QInputDialog::inputMethodHintsOfChildWidget() +{ + QInputDialog dialog; + dialog.setInputMode(QInputDialog::TextInput); + QList children = dialog.children(); + QLineEdit *editWidget = 0; + for (int c = 0; c < children.size(); c++) { + editWidget = qobject_cast(children.at(c)); + if (editWidget) + break; + } + QVERIFY(editWidget); + QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints()); + QCOMPARE(editWidget->inputMethodHints(), Qt::ImhNone); + dialog.setInputMethodHints(Qt::ImhDigitsOnly); + QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints()); + QCOMPARE(editWidget->inputMethodHints(), Qt::ImhDigitsOnly); +} + QTEST_MAIN(tst_QInputDialog) #include "tst_qinputdialog.moc" -- cgit v0.12 From 0fcee2f495eb2e1c4b76aa8c3e5462595aed0ab3 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 8 Oct 2010 13:25:04 +0100 Subject: Account for native child widgets when handling focus events The code previously contained an implicit assumption that the control which received the FocusChanged event was a top-level widget. This meant that focus events delivered to native child widgets could cause unexpected changes in visibility of the statusbar and CBA. Task-number: QTBUG-13761 Reviewed-by: Jason Barron --- src/gui/kernel/qapplication_s60.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 296f24f..5ff2fd4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1237,10 +1237,11 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. - const bool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); + QWidget *const window = qwidget->window(); + const bool visible = !(window->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); const bool statusPaneVisibility = visible; - const bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; - const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; + const bool isFullscreen = window->windowState() & Qt::WindowFullScreen; + const bool cbaVisibilityHint = window->windowFlags() & Qt::WindowSoftkeysVisibleHint; const bool buttonGroupVisibility = (visible || (isFullscreen && cbaVisibilityHint)); S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); #endif -- cgit v0.12 From 4b73e816189d924bd499fc8b7fb29365539d5e38 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 1 Oct 2010 14:50:52 +0200 Subject: Extended the convenience functions for QInputDialog for IM hints. Input method hints make a lot of sense when requesting specific information from the user, such as for example a URL. Therefore we include input method hints in the static convenience function. To maintain BC we need to keep the old symbol around, so a new function was added. To maintain SC, there cannot be any ambiguities when deciding which function to link to, therefore the function with the fewest arguments get to keep all the default arguments, whereas the new function gets a new explicit argument. AutoTest: Passed Task: QTBUG-13200 RevBy: Denis Dzyubenko --- src/gui/dialogs/qinputdialog.cpp | 32 ++++++++++++++++++++++++++++++-- src/gui/dialogs/qinputdialog.h | 25 ++++++++++++++++++++++--- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index 700b234..2d13c9a 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -1128,6 +1128,8 @@ void QInputDialog::done(int result) be entered). \a text is the default text which is placed in the line edit. \a mode is the echo mode the line edit will use. + \a inputMethodHints is the input method hints that will be used in the + edit widget if an input method is active. If \a ok is nonnull \e *\a ok will be set to true if the user pressed \gui OK and to false if the user pressed \gui Cancel. The dialog's parent @@ -1150,13 +1152,14 @@ void QInputDialog::done(int result) QString QInputDialog::getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, - Qt::WindowFlags flags) + Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints) { QInputDialog dialog(parent, flags); dialog.setWindowTitle(title); dialog.setLabelText(label); dialog.setTextValue(text); dialog.setTextEchoMode(mode); + dialog.setInputMethodHints(inputMethodHints); int ret = dialog.exec(); if (ok) @@ -1169,6 +1172,17 @@ QString QInputDialog::getText(QWidget *parent, const QString &title, const QStri } /*! + \internal +*/ +// ### Qt 5: Use only the version above. +QString QInputDialog::getText(QWidget *parent, const QString &title, const QString &label, + QLineEdit::EchoMode mode, const QString &text, bool *ok, + Qt::WindowFlags flags) +{ + return getText(parent, title, label, mode, text, ok, flags, Qt::ImhNone); +} + +/*! \since 4.5 Static convenience function to get an integer input from the user. @@ -1278,6 +1292,8 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr be entered). \a items is the string list which is inserted into the combobox. \a current is the number of the item which should be the current item. + \a inputMethodHints is the input method hints that will be used if the + combobox is editable and an input method is active. If \a editable is true the user can enter their own text; otherwise the user may only select one of the existing items. @@ -1302,7 +1318,7 @@ double QInputDialog::getDouble(QWidget *parent, const QString &title, const QStr QString QInputDialog::getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &items, int current, bool editable, bool *ok, - Qt::WindowFlags flags) + Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints) { QString text(items.value(current)); @@ -1312,6 +1328,7 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri dialog.setComboBoxItems(items); dialog.setTextValue(text); dialog.setComboBoxEditable(editable); + dialog.setInputMethodHints(inputMethodHints); int ret = dialog.exec(); if (ok) @@ -1324,6 +1341,17 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri } /*! + \internal +*/ +// ### Qt 5: Use only the version above. +QString QInputDialog::getItem(QWidget *parent, const QString &title, const QString &label, + const QStringList &items, int current, bool editable, bool *ok, + Qt::WindowFlags flags) +{ + return getItem(parent, title, label, items, current, editable, ok, flags, Qt::ImhNone); +} + +/*! \obsolete Use getInt() instead. diff --git a/src/gui/dialogs/qinputdialog.h b/src/gui/dialogs/qinputdialog.h index 02868c1..25e27b0 100644 --- a/src/gui/dialogs/qinputdialog.h +++ b/src/gui/dialogs/qinputdialog.h @@ -167,18 +167,37 @@ public: void setVisible(bool visible); +#ifdef Q_QDOC + static QString getText(QWidget *parent, const QString &title, const QString &label, + QLineEdit::EchoMode echo = QLineEdit::Normal, + const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0, + Qt::InputMethodHints inputMethodHints = Qt::ImhNone); + static QString getItem(QWidget *parent, const QString &title, const QString &label, + const QStringList &items, int current = 0, bool editable = true, + bool *ok = 0, Qt::WindowFlags flags = 0, + Qt::InputMethodHints inputMethodHints = Qt::ImhNone); +#else static QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode echo = QLineEdit::Normal, const QString &text = QString(), bool *ok = 0, Qt::WindowFlags flags = 0); + static QString getItem(QWidget *parent, const QString &title, const QString &label, + const QStringList &items, int current = 0, bool editable = true, + bool *ok = 0, Qt::WindowFlags flags = 0); + static QString getText(QWidget *parent, const QString &title, const QString &label, + QLineEdit::EchoMode echo, + const QString &text, bool *ok, Qt::WindowFlags flags, + Qt::InputMethodHints inputMethodHints); + static QString getItem(QWidget *parent, const QString &title, const QString &label, + const QStringList &items, int current, bool editable, + bool *ok, Qt::WindowFlags flags, + Qt::InputMethodHints inputMethodHints); +#endif static int getInt(QWidget *parent, const QString &title, const QString &label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, bool *ok = 0, Qt::WindowFlags flags = 0); static double getDouble(QWidget *parent, const QString &title, const QString &label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, bool *ok = 0, Qt::WindowFlags flags = 0); - static QString getItem(QWidget *parent, const QString &title, const QString &label, - const QStringList &items, int current = 0, bool editable = true, - bool *ok = 0, Qt::WindowFlags flags = 0); // obsolete static int getInteger(QWidget *parent, const QString &title, const QString &label, int value = 0, -- cgit v0.12 From 1966b88611bb45d18d586847eeb3597d6e022eb7 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 8 Oct 2010 18:37:25 +0200 Subject: Experimental support of the unified toolbar with the raster engine on Mac OS X. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-12615 Reviewed-by: Samuel Rødal --- src/gui/graphicsview/qgraphicsview_p.h | 2 +- src/gui/image/qnativeimage.cpp | 13 +- src/gui/kernel/qcocoaview_mac.mm | 11 +- src/gui/kernel/qt_cocoa_helpers_mac.mm | 7 + src/gui/kernel/qt_cocoa_helpers_mac_p.h | 2 + src/gui/kernel/qwidget.cpp | 14 +- src/gui/kernel/qwidget.h | 4 + src/gui/kernel/qwidget_p.h | 7 + src/gui/painting/painting.pri | 6 + src/gui/painting/qunifiedtoolbarsurface_mac.cpp | 233 ++++++++++++++++++++++++ src/gui/painting/qunifiedtoolbarsurface_mac_p.h | 95 ++++++++++ src/gui/painting/qwindowsurface.cpp | 4 +- src/gui/painting/qwindowsurface_p.h | 2 +- src/gui/painting/qwindowsurface_raster.cpp | 41 ++++- src/gui/painting/qwindowsurface_raster_p.h | 2 +- src/gui/widgets/qmainwindow.cpp | 11 +- src/gui/widgets/qmainwindowlayout_mac.mm | 12 ++ src/gui/widgets/qmainwindowlayout_p.h | 10 +- 18 files changed, 461 insertions(+), 15 deletions(-) create mode 100644 src/gui/painting/qunifiedtoolbarsurface_mac.cpp create mode 100644 src/gui/painting/qunifiedtoolbarsurface_mac_p.h diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h index 62be800..38c3bca 100644 --- a/src/gui/graphicsview/qgraphicsview_p.h +++ b/src/gui/graphicsview/qgraphicsview_p.h @@ -184,7 +184,7 @@ public: #ifdef Q_WS_MAC // QWidget::update() works slightly different on the Mac without the raster engine; // it's not part of our backing store so it needs special threatment. - if (QApplicationPrivate::graphics_system_name != "raster") { + if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) { // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa) // is called, which means there's a pending update request. We want to dispatch it // now because otherwise graphics view updates would require two diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp index 8446387..5978a1b 100644 --- a/src/gui/image/qnativeimage.cpp +++ b/src/gui/image/qnativeimage.cpp @@ -241,8 +241,19 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* : image(width, height, format) { - uint cgflags = kCGImageAlphaNoneSkipFirst; + switch (format) { + case QImage::Format_ARGB32: + cgflags = kCGImageAlphaFirst; + break; + case QImage::Format_ARGB32_Premultiplied: + case QImage::Format_ARGB8565_Premultiplied: + case QImage::Format_ARGB6666_Premultiplied: + case QImage::Format_ARGB8555_Premultiplied: + case QImage::Format_ARGB4444_Premultiplied: + cgflags = kCGImageAlphaPremultipliedFirst; + break; + } #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version cgflags |= kCGBitmapByteOrder32Host; diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 8576f52..2016d40 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -534,7 +534,7 @@ static int qCocoaViewCount = 0; return; // We use a different graphics system. - if (QApplicationPrivate::graphicsSystem() != 0) { + if (QApplicationPrivate::graphicsSystem() != 0 && !qwidgetprivate->isInUnifiedToolbar) { // Qt handles the painting occuring inside the window. // Cocoa also keeps track of all widgets as NSView and therefore might @@ -558,6 +558,15 @@ static int qCocoaViewCount = 0; CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; qwidgetprivate->hd = cg; + + // We steal the CGContext for flushing in the unified toolbar with the raster engine. + if (QApplicationPrivate::graphicsSystem() != 0 && qwidgetprivate->isInUnifiedToolbar) { + qwidgetprivate->cgContext = cg; + qwidgetprivate->hasOwnContext = true; + qwidgetprivate->unifiedSurface->flush(qwidget, qwidgetprivate->ut_rg, qwidgetprivate->ut_pt); + return; + } + CGContextSaveGState(cg); if (qwidget->isVisible() && qwidget->updatesEnabled()) { //process the actual paint event. diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 2dd3791..cce9daa 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1561,6 +1561,13 @@ void qt_cocoaStackChildWindowOnTopOfOtherChildren(QWidget *childWidget) } } +void qt_mac_display(QWidget *widget) +{ + NSView *theNSView = qt_mac_nativeview_for(widget); + [theNSView display]; + return; +} + #endif // QT_MAC_USE_COCOA 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 5c23392..04c2d06 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -227,6 +227,8 @@ void qt_cocoaPostMessage(id target, SEL selector, int argCount=0, id arg1=0, id void qt_mac_post_retranslateAppMenu(); +void qt_mac_display(QWidget *widget); + QT_END_NAMESPACE #endif // QT_COCOA_HELPERS_MAC_P_H diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index cffad1d..2c31fd0 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -301,6 +301,9 @@ QWidgetPrivate::QWidgetPrivate(int version) drawRectOriginalAdded = false; originalDrawMethod = true; changeMethods = false; + hasOwnContext = false; + isInUnifiedToolbar = false; + unifiedSurface = 0; #endif // QT_MAC_USE_COCOA #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; @@ -5316,6 +5319,14 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP if (rgn.isEmpty()) return; +#ifdef Q_WS_MAC + // We disable the rendering of QToolBar in the backingStore if + // it's supposed to be in the unified toolbar on Mac OS X. + if (backingStore && isInUnifiedToolbar) + return; +#endif // Q_WS_MAC + + Q_Q(QWidget); #ifndef QT_NO_GRAPHICSEFFECT if (graphicsEffect && graphicsEffect->isEnabled()) { @@ -5378,6 +5389,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP QPaintEngine *paintEngine = pdev->paintEngine(); if (paintEngine) { setRedirected(pdev, -offset); + #ifdef Q_WS_MAC // (Alien support) Special case for Mac when redirecting: If the paint device // is of the Widget type we need to set WA_WState_InPaintEvent since painting @@ -5420,7 +5432,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP //actually send the paint event QPaintEvent e(toBePainted); QCoreApplication::sendSpontaneousEvent(q, &e); -#if !defined(Q_WS_MAC) && !defined(Q_WS_QWS) +#if !defined(Q_WS_QWS) if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow())) backingStore->markDirtyOnScreen(toBePainted, q, offset); #endif diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 980f40f..81b3618 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -97,6 +97,8 @@ class QWindowSurface; class QLocale; class QGraphicsProxyWidget; class QGraphicsEffect; +class QRasterWindowSurface; +class QUnifiedToolbarSurface; #if defined(Q_WS_X11) class QX11Info; #endif @@ -758,6 +760,8 @@ private: friend OSViewRef qt_mac_nativeview_for(const QWidget *w); friend void qt_event_request_window_change(QWidget *widget); friend bool qt_mac_sendMacEventToWidget(QWidget *widget, EventRef ref); + friend class QRasterWindowSurface; + friend class QUnifiedToolbarSurface; #endif #ifdef Q_WS_QWS friend class QWSBackingStore; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index c943bd8..1433ce3 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -840,6 +840,13 @@ public: bool originalDrawMethod; // Do we need to change the methods? bool changeMethods; + bool hasOwnContext; + CGContextRef cgContext; + QRegion ut_rg; + QPoint ut_pt; + bool isInUnifiedToolbar; + QWindowSurface *unifiedSurface; + QPoint toolbar_offset; #endif void determineWindowClass(); void transferChildren(); diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 793d380..10c6f40 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -247,6 +247,12 @@ symbian { QMAKE_CXXFLAGS.ARMCC *= -O3 } +mac { + HEADERS += painting/qunifiedtoolbarsurface_mac_p.h + SOURCES += painting/qunifiedtoolbarsurface_mac.cpp +} + + NEON_SOURCES += painting/qdrawhelper_neon.cpp NEON_HEADERS += painting/qdrawhelper_neon_p.h NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac.cpp b/src/gui/painting/qunifiedtoolbarsurface_mac.cpp new file mode 100644 index 0000000..722355e --- /dev/null +++ b/src/gui/painting/qunifiedtoolbarsurface_mac.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 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$ +** +****************************************************************************/ + +#include "qunifiedtoolbarsurface_mac_p.h" +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +QUnifiedToolbarSurface::QUnifiedToolbarSurface(QWidget *widget) + : QRasterWindowSurface(widget, false), d_ptr(new QUnifiedToolbarSurfacePrivate) +{ + d_ptr->image = 0; + d_ptr->inSetGeometry = false; + setStaticContentsSupport(true); + + setGeometry(QRect(QPoint(0, 0), QSize(widget->width(), 100))); // FIXME: Fix height. +} + +QUnifiedToolbarSurface::~QUnifiedToolbarSurface() +{ + if (d_ptr->image) + delete d_ptr->image; +} + +QPaintDevice *QUnifiedToolbarSurface::paintDevice() +{ + return &d_ptr->image->image; +} + +void QUnifiedToolbarSurface::recursiveRedirect(QObject *object, const QPoint &offset) +{ + if (object != 0) { + if (object->isWidgetType()) { + QWidget *widget = qobject_cast(object); + widget->d_func()->unifiedSurface = this; + widget->d_func()->isInUnifiedToolbar = true; + widget->d_func()->toolbar_offset = offset; + } + + for (int i = 0; i < object->children().size(); ++i) { + recursiveRedirect(object->children().at(i), offset); + } + } +} + +void QUnifiedToolbarSurface::insertToolbar(QWidget *toolbar, const QPoint &offset) +{ + setGeometry(QRect(QPoint(0, 0), QSize(offset.x() + toolbar->width(), 100))); // FIXME + recursiveRedirect(toolbar, offset); +// toolbar->d_func()->toolbar_offset = offset; +} + +void QUnifiedToolbarSurface::setGeometry(const QRect &rect) +{ + QWindowSurface::setGeometry(rect); + Q_D(QUnifiedToolbarSurface); + d->inSetGeometry = true; + if (d->image == 0 || d->image->width() < rect.width() || d->image->height() < rect.height()) + prepareBuffer(QImage::Format_ARGB32_Premultiplied, window()); + d->inSetGeometry = false; +} + +void QUnifiedToolbarSurface::beginPaint(const QRegion &rgn) +{ + QPainter p(&d_ptr->image->image); + p.setCompositionMode(QPainter::CompositionMode_Source); + const QVector rects = rgn.rects(); + const QColor blank = Qt::transparent; + for (QVector::const_iterator it = rects.begin(); it != rects.end(); ++it) { + p.fillRect(*it, blank); + } +} + +void QUnifiedToolbarSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &offset) +{ + Q_D(QUnifiedToolbarSurface); + + if (!d->image || rgn.rectCount() == 0) { + return; + } + + Q_UNUSED(offset); + + // Get a context for the widget. + CGContextRef context; + if (!(widget->d_func()->hasOwnContext)) { + widget->d_func()->ut_rg = rgn; + widget->d_func()->ut_pt = offset; + qt_mac_display(widget); + return; + } else { + context = widget->d_func()->cgContext; + widget->render(widget->d_func()->unifiedSurface->paintDevice(), widget->d_func()->toolbar_offset, QRegion(), QWidget::DrawChildren); + } + + CGContextSaveGState(context); + + int areaX = widget->geometry().x() + widget->d_func()->toolbar_offset.x(); + int areaY = widget->geometry().y() + widget->d_func()->toolbar_offset.y(); + int areaWidth = widget->geometry().width(); + int areaHeight = widget->geometry().height(); + const CGRect area = CGRectMake(areaX, areaY, areaWidth, areaHeight); + + // Clip to region. + const QVector &rects = rgn.rects(); + for (int i = 0; i < rects.size(); ++i) { + const QRect &rect = rects.at(i); + // CGContextAddRect(context, CGRectMake(rect.x(), rect.y(), rect.width(), rect.height())); + CGContextAddRect(context, CGRectMake(0, 0, 1000, 1000)); //FIXME: Set correct size. + } + CGContextAddRect(context, area); + CGContextClip(context); + + + CGImageRef image = CGBitmapContextCreateImage(d->image->cg); + CGImageRef subImage = CGImageCreateWithImageInRect(image, area); + + const CGRect drawingArea = CGRectMake(0, 0, areaWidth, areaHeight); + qt_mac_drawCGImage(context, &drawingArea, subImage); + + CGImageRelease(subImage); + CGImageRelease(image); + + CGContextFlush(context); + + // Restore context. + CGContextRestoreGState(context); + widget->d_func()->hasOwnContext = false; +} + +void QUnifiedToolbarSurface::prepareBuffer(QImage::Format format, QWidget *widget) +{ + Q_D(QUnifiedToolbarSurface); + + int width = geometry().width(); + int height = geometry().height(); + if (d->image) { + width = qMax(d->image->width(), width); + height = qMax(d->image->height(), height); + } + + if (width == 0 || height == 0) { + delete d->image; + d->image = 0; + return; + } + + QNativeImage *oldImage = d->image; + + d->image = new QNativeImage(width, height, format, false, widget); + + if (oldImage && d->inSetGeometry && hasStaticContents()) { + // Make sure we use the const version of bits() (no detach). + const uchar *src = const_cast(oldImage->image).bits(); + uchar *dst = d->image->image.bits(); + + const int srcBytesPerLine = oldImage->image.bytesPerLine(); + const int dstBytesPerLine = d->image->image.bytesPerLine(); + const int bytesPerPixel = oldImage->image.depth() >> 3; + + QRegion staticRegion(staticContents()); + // Make sure we're inside the boundaries of the old image. + staticRegion &= QRect(0, 0, oldImage->image.width(), oldImage->image.height()); + const QVector &rects = staticRegion.rects(); + const QRect *srcRect = rects.constData(); + + // Copy the static content of the old image into the new one. + int numRectsLeft = rects.size(); + do { + const int bytesOffset = srcRect->x() * bytesPerPixel; + const int dy = srcRect->y(); + + // Adjust src and dst to point to the right offset. + const uchar *s = src + dy * srcBytesPerLine + bytesOffset; + uchar *d = dst + dy * dstBytesPerLine + bytesOffset; + const int numBytes = srcRect->width() * bytesPerPixel; + + int numScanLinesLeft = srcRect->height(); + do { + ::memcpy(d, s, numBytes); + d += dstBytesPerLine; + s += srcBytesPerLine; + } while (--numScanLinesLeft); + + ++srcRect; + } while (--numRectsLeft); + } + + delete oldImage; +} + +QT_END_NAMESPACE diff --git a/src/gui/painting/qunifiedtoolbarsurface_mac_p.h b/src/gui/painting/qunifiedtoolbarsurface_mac_p.h new file mode 100644 index 0000000..d7805e8 --- /dev/null +++ b/src/gui/painting/qunifiedtoolbarsurface_mac_p.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** 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 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 QUNIFIEDTOOLBARSURFACE_MAC_P_H +#define QUNIFIEDTOOLBARSURFACE_MAC_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 +#include +#include + +QT_BEGIN_NAMESPACE + +class QNativeImage; + + +class QUnifiedToolbarSurfacePrivate +{ +public: + QNativeImage *image; + uint inSetGeometry : 1; +}; + +class Q_GUI_EXPORT QUnifiedToolbarSurface : public QRasterWindowSurface +{ +public: + QUnifiedToolbarSurface(QWidget *widget); + ~QUnifiedToolbarSurface(); + + void flush(QWidget *widget, const QRegion ®ion, const QPoint &offset); + void setGeometry(const QRect &rect); + void beginPaint(const QRegion &rgn); + void insertToolbar(QWidget *toolbar, const QPoint &offset); + +private: + QPaintDevice *paintDevice(); + void prepareBuffer(QImage::Format format, QWidget *widget); + void recursiveRedirect(QObject *widget, const QPoint &offset); + + Q_DECLARE_PRIVATE(QUnifiedToolbarSurface) + QScopedPointer d_ptr; +}; + +QT_END_NAMESPACE + +#endif // QUNIFIEDTOOLBARSURFACE_MAC_P_H diff --git a/src/gui/painting/qwindowsurface.cpp b/src/gui/painting/qwindowsurface.cpp index 02a8b80..8cf3977 100644 --- a/src/gui/painting/qwindowsurface.cpp +++ b/src/gui/painting/qwindowsurface.cpp @@ -114,11 +114,11 @@ public: /*! Constructs an empty surface for the given top-level \a window. */ -QWindowSurface::QWindowSurface(QWidget *window) +QWindowSurface::QWindowSurface(QWidget *window, bool setDefaultSurface) : d_ptr(new QWindowSurfacePrivate(window)) { if (!QApplicationPrivate::runtime_graphics_system) { - if(window) + if(setDefaultSurface && window) window->setWindowSurface(this); } } diff --git a/src/gui/painting/qwindowsurface_p.h b/src/gui/painting/qwindowsurface_p.h index 6171ae8..ab84527 100644 --- a/src/gui/painting/qwindowsurface_p.h +++ b/src/gui/painting/qwindowsurface_p.h @@ -67,7 +67,7 @@ class QWindowSurfacePrivate; class Q_GUI_EXPORT QWindowSurface { public: - QWindowSurface(QWidget *window); + QWindowSurface(QWidget *window, bool setDefaultSurface = true); virtual ~QWindowSurface(); QWidget *window() const; diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 6a2cb1e..99f8597 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -64,6 +64,9 @@ #ifdef Q_WS_MAC #include +#include +#include +#include #endif QT_BEGIN_NAMESPACE @@ -82,8 +85,8 @@ public: uint inSetGeometry : 1; }; -QRasterWindowSurface::QRasterWindowSurface(QWidget *window) - : QWindowSurface(window), d_ptr(new QRasterWindowSurfacePrivate) +QRasterWindowSurface::QRasterWindowSurface(QWidget *window, bool setDefaultSurface) + : QWindowSurface(window, setDefaultSurface), d_ptr(new QRasterWindowSurfacePrivate) { #ifdef Q_WS_X11 d_ptr->gc = XCreateGC(X11->display, window->handle(), 0, 0); @@ -248,6 +251,23 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi #ifdef Q_WS_MAC + // Unified toolbar hack. + QMainWindow* mWindow = qobject_cast(widget->window()); + if (mWindow) { + QMainWindowLayout *mLayout = qobject_cast(mWindow->layout()); + QList toolbarList = mLayout->qtoolbarsInUnifiedToolbarList; + + for (int i = 0; i < toolbarList.size(); ++i) { + QToolBar* toolbar = toolbarList.at(i); + if (mLayout->toolBarArea(toolbar) == Qt::TopToolBarArea) { + QWidget* tbWidget = (QWidget*) toolbar; + if (tbWidget->d_func()->unifiedSurface) { + tbWidget->d_func()->unifiedSurface->flush(tbWidget, rgn, offset); + } + } + } + } + Q_UNUSED(offset); // Get a context for the widget. #ifndef QT_MAC_USE_COCOA @@ -318,6 +338,23 @@ void QRasterWindowSurface::setGeometry(const QRect &rect) prepareBuffer(QNativeImage::systemFormat(), window()); } d->inSetGeometry = false; +#ifdef Q_WS_MAC + QMainWindow* mWindow = qobject_cast(window()); + if (mWindow) { + QMainWindowLayout *mLayout = qobject_cast(mWindow->layout()); + QList toolbarList = mLayout->qtoolbarsInUnifiedToolbarList; + + for (int i = 0; i < toolbarList.size(); ++i) { + QToolBar* toolbar = toolbarList.at(i); + if (mLayout->toolBarArea(toolbar) == Qt::TopToolBarArea) { + QWidget* tbWidget = (QWidget*) toolbar; + if (tbWidget->d_func()->unifiedSurface) { + tbWidget->d_func()->unifiedSurface->setGeometry(rect); + } + } + } + } +#endif // Q_WS_MAC } // from qwindowsurface.cpp diff --git a/src/gui/painting/qwindowsurface_raster_p.h b/src/gui/painting/qwindowsurface_raster_p.h index 2b932a9..a7c3b9f 100644 --- a/src/gui/painting/qwindowsurface_raster_p.h +++ b/src/gui/painting/qwindowsurface_raster_p.h @@ -97,7 +97,7 @@ class QNativeImage; class Q_GUI_EXPORT QRasterWindowSurface : public QWindowSurface { public: - QRasterWindowSurface(QWidget *widget); + QRasterWindowSurface(QWidget *widget, bool setDefaultSurface = true); ~QRasterWindowSurface(); QPaintDevice *paintDevice(); diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 4ca11b0..861cfaa 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1516,14 +1516,19 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) if (!isWindow() || d->useHIToolBar == set || QSysInfo::MacintoshVersion < QSysInfo::MV_10_3) return; - // ### Disable the unified toolbar when using anything but the native graphics system. - // ### Disable when using alien widgets as well - if (windowSurface() || testAttribute(Qt::WA_NativeWindow) == false) + // ### Disable when using alien widgets + if (testAttribute(Qt::WA_NativeWindow) == false) { return; + } d->useHIToolBar = set; createWinId(); // We need the hiview for down below. + // Activate the unified toolbar with the raster engine. + if (windowSurface()) { + d->layout->unifiedSurface = new QUnifiedToolbarSurface(this); + } + d->layout->updateHIToolBarStatus(); // Enabling the unified toolbar clears the opaque size grip setting, update it. d->macUpdateOpaqueSizeGrip(); diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index 1bfc746..b2c4cea 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -49,6 +49,7 @@ #else #include #import +#include #endif QT_BEGIN_NAMESPACE @@ -408,6 +409,7 @@ void QMainWindowLayout::insertIntoMacToolbar(QToolBar *before, QToolBar *toolbar beforeIndex = qtoolbarsInUnifiedToolbarList.size(); int toolbarIndex = qtoolbarsInUnifiedToolbarList.indexOf(toolbar); + #ifndef QT_MAC_USE_COCOA HIToolbarRef macToolbar = NULL; if ((GetWindowToolbar(window, &macToolbar) == noErr) && !macToolbar) { @@ -444,6 +446,16 @@ void QMainWindowLayout::insertIntoMacToolbar(QToolBar *before, QToolBar *toolbar #endif } qtoolbarsInUnifiedToolbarList.insert(beforeIndex, toolbar); + + // Adding to the unified toolbar surface for the raster engine. + if (layoutState.mainWindow->windowSurface()) { + QPoint offset(0, 0); + for (int i = 0; i < beforeIndex; ++i) { + offset.setX(offset.x() + qtoolbarsInUnifiedToolbarList.at(i)->size().width()); + } + unifiedSurface->insertToolbar(toolbar, offset); + } + #ifndef QT_MAC_USE_COCOA QCFType outItem; const QObject *stupidArray[] = { toolbar, this }; diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h index e1b981c..3eb2545 100644 --- a/src/gui/widgets/qmainwindowlayout_p.h +++ b/src/gui/widgets/qmainwindowlayout_p.h @@ -85,7 +85,11 @@ typedef HIObjectRef HIToolbarItemRef; typedef const void * CFTypeRef; typedef const struct __CFString * CFStringRef; -#endif +# ifdef QT_MAC_USE_COCOA +#include +# endif // QT_MAC_USE_COCOA + +#endif // Q_WS_MAC QT_BEGIN_NAMESPACE @@ -337,7 +341,9 @@ public: bool useHIToolBar; void syncUnifiedToolbarVisibility(); bool blockVisiblityCheck; -#endif + + QUnifiedToolbarSurface *unifiedSurface; +#endif // Q_WS_MAC }; QT_END_NAMESPACE -- cgit v0.12 From f0c1f381af7d6338ded9f65d00ed54b1b9405ba9 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Sat, 9 Oct 2010 17:28:06 +0200 Subject: Add missing data for the autotest of in-place conversion for Pixmap The commit 4d974ff0a748b22e668a4cb7ef38101122c85b3b uses an new image which was not commited with the patch. --- .../loadFromData/designer_indexed8_no_alpha_animated.gif | Bin 0 -> 4075 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif diff --git a/tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif b/tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif new file mode 100644 index 0000000..86a3a2e Binary files /dev/null and b/tests/auto/qpixmap/loadFromData/designer_indexed8_no_alpha_animated.gif differ -- cgit v0.12 From aa7fa8608939676ba56e130214b85f5d0c3745df Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 Oct 2010 11:24:05 +1000 Subject: Add a declarative callback for when a QObject's objectName changes Task-number: QTBUG-13999 Reviewed-by: Martin Jones --- src/corelib/kernel/qobject.cpp | 6 ++++++ src/corelib/kernel/qobject_p.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 8330e47..579c225 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -127,6 +127,7 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *) void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = 0; void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = 0; +void (*QAbstractDeclarativeData::objectNameChanged)(QAbstractDeclarativeData *, QObject *) = 0; QObjectData::~QObjectData() {} @@ -1094,7 +1095,12 @@ QString QObject::objectName() const void QObject::setObjectName(const QString &name) { Q_D(QObject); + bool objectNameChanged = d->declarativeData && d->objectName != name; + d->objectName = name; + + if (objectNameChanged) + d->declarativeData->objectNameChanged(d->declarativeData, this); } diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 4800e6a..814769c 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -89,6 +89,7 @@ class Q_CORE_EXPORT QAbstractDeclarativeData public: static void (*destroyed)(QAbstractDeclarativeData *, QObject *); static void (*parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *); + static void (*objectNameChanged)(QAbstractDeclarativeData *, QObject *); }; class Q_CORE_EXPORT QObjectPrivate : public QObjectData -- cgit v0.12 From e11ee40cefc981fbdcfb10816039d4efb080fb17 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 11 Oct 2010 10:26:34 +1000 Subject: Don't give focus to a FocusScope that has had focus explicitly cleared. If focus was explicitly cleared on a non-visible FocusScope, and then it was made visible, it would incorrectly grab focus. Task-number: QTBUG-13380 --- src/gui/graphicsview/qgraphicsitem.cpp | 16 ++++++++----- src/gui/graphicsview/qgraphicsitem_p.h | 2 +- .../qdeclarativefocusscope/data/qtBug13380.qml | 24 ++++++++++++++++++++ .../tst_qdeclarativefocusscope.cpp | 26 ++++++++++++++++++++++ tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 3 +++ 5 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 60cd020..e63acac 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2365,7 +2365,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo while (fsi->d_ptr->focusScopeItem && fsi->d_ptr->focusScopeItem->isVisible()) fsi = fsi->d_ptr->focusScopeItem; fsi->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ true, - /* focusFromShow = */ true); + /* focusFromHide = */ false); } break; } @@ -2375,6 +2375,10 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo QGraphicsItem *fi = subFocusItem; if (fi && fi != scene->focusItem()) { scene->setFocusItem(fi); + } else if (flags & QGraphicsItem::ItemIsFocusScope && + !scene->focusItem() && + q->isAncestorOf(scene->d_func()->lastFocusItem)) { + q_ptr->setFocus(); } } } else { @@ -2385,7 +2389,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo if (p->flags() & QGraphicsItem::ItemIsFocusScope) { if (p->d_ptr->visible) { p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ true, - /* focusFromShow = */ true); + /* focusFromHide = */ true); } break; } @@ -3245,13 +3249,13 @@ bool QGraphicsItem::hasFocus() const */ void QGraphicsItem::setFocus(Qt::FocusReason focusReason) { - d_ptr->setFocusHelper(focusReason, /* climb = */ true, /* focusFromShow = */ false); + d_ptr->setFocusHelper(focusReason, /* climb = */ true, /* focusFromHide = */ false); } /*! \internal */ -void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromShow) +void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide) { // Disabled / unfocusable items cannot accept focus. if (!q_ptr->isEnabled() || !(flags & QGraphicsItem::ItemIsFocusable)) @@ -3272,7 +3276,7 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim if (p->flags() & QGraphicsItem::ItemIsFocusScope) { QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem; p->d_ptr->focusScopeItem = q_ptr; - if (!p->focusItem() && !focusFromShow) { + if (!p->focusItem() && !focusFromHide) { if (oldFocusScopeItem) oldFocusScopeItem->d_ptr->focusScopeItemChange(false); focusScopeItemChange(true); @@ -3334,7 +3338,7 @@ void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent) while (p) { if (p->flags() & QGraphicsItem::ItemIsFocusScope) { p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false, - /* focusFromShow = */ false); + /* focusFromHide = */ false); return; } p = p->d_ptr->parent; diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index c8a7699..8480c19 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -477,7 +477,7 @@ public: inline void markParentDirty(bool updateBoundingRect = false); - void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromShow); + void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide); void clearFocusHelper(bool giveFocusToParent); void setSubFocus(QGraphicsItem *rootItem = 0); void clearSubFocus(QGraphicsItem *rootItem = 0); diff --git a/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml b/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml new file mode 100644 index 0000000..1784202 --- /dev/null +++ b/tests/auto/declarative/qdeclarativefocusscope/data/qtBug13380.qml @@ -0,0 +1,24 @@ +import QtQuick 1.0 + +Rectangle { + width: 400; height: 400 + + property bool showRect: false + onShowRectChanged: if (showRect) rect.visible = true + property bool noFocus: !fs2.activeFocus + + FocusScope { + id: fs1 + focus: true + } + Rectangle { + id: rect + visible: false + FocusScope { + id: fs2 + Rectangle { + focus: true + } + } + } +} diff --git a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp index ec8f048..4cafbd9 100644 --- a/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp +++ b/tests/auto/declarative/qdeclarativefocusscope/tst_qdeclarativefocusscope.cpp @@ -70,6 +70,7 @@ private slots: void forceFocus(); void noParentFocus(); void signalEmission(); + void qtBug13380(); }; /* @@ -400,6 +401,31 @@ void tst_qdeclarativefocusscope::signalEmission() delete view; } +void tst_qdeclarativefocusscope::qtBug13380() +{ + QDeclarativeView *view = new QDeclarativeView; + view->setSource(QUrl::fromLocalFile(SRCDIR "/data/qtBug13380.qml")); + + view->show(); + QVERIFY(view->rootObject()); + qApp->setActiveWindow(view); + qApp->processEvents(); + +#ifdef Q_WS_X11 + // to be safe and avoid failing setFocus with window managers + qt_x11_wait_for_window_manager(view); +#endif + + QVERIFY(view->hasFocus()); + QVERIFY(view->scene()->hasFocus()); + QVERIFY(view->rootObject()->property("noFocus").toBool()); + + view->rootObject()->setProperty("showRect", true); + QVERIFY(view->rootObject()->property("noFocus").toBool()); + + delete view; +} + QTEST_MAIN(tst_qdeclarativefocusscope) #include "tst_qdeclarativefocusscope.moc" diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 2901dd5..2ddccd2 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -9065,6 +9065,9 @@ void tst_QGraphicsItem::focusScope() scope2->hide(); scope2->show(); QVERIFY(!scope2->hasFocus()); + QVERIFY(scope1->hasFocus()); + scope2->setFocus(); + scope3->setFocus(); QVERIFY(scope3->hasFocus()); QGraphicsRectItem *rect4 = new QGraphicsRectItem; -- cgit v0.12 From f69eeec7030a5df12803a9128819207e3fc5bead Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 Oct 2010 11:43:59 +1000 Subject: Install the declarative objectNameChanged callback Task-number: QTBUG-13999 --- src/declarative/qml/qdeclarativedata_p.h | 2 ++ src/declarative/qml/qdeclarativeengine.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h index e916273..c7857b7 100644 --- a/src/declarative/qml/qdeclarativedata_p.h +++ b/src/declarative/qml/qdeclarativedata_p.h @@ -82,10 +82,12 @@ public: static inline void init() { QAbstractDeclarativeData::destroyed = destroyed; QAbstractDeclarativeData::parentChanged = parentChanged; + QAbstractDeclarativeData::objectNameChanged = objectNameChanged; } static void destroyed(QAbstractDeclarativeData *, QObject *); static void parentChanged(QAbstractDeclarativeData *, QObject *, QObject *); + static void objectNameChanged(QAbstractDeclarativeData *, QObject *); void destroyed(QObject *); void parentChanged(QObject *, QObject *); diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 0749767..dfc29c4 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -468,6 +468,10 @@ void QDeclarativeData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QO static_cast(d)->parentChanged(o, p); } +void QDeclarativeData::objectNameChanged(QAbstractDeclarativeData *d, QObject *o) +{ +} + void QDeclarativeEnginePrivate::init() { Q_Q(QDeclarativeEngine); -- cgit v0.12 From 759da9b325f19670a3d79ede5f06fb3fa1f95495 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 Oct 2010 12:07:24 +1000 Subject: Allow objectName to be used in QML bindings Task-number: QTBUG-13999 --- src/declarative/qml/qdeclarativedata_p.h | 18 +++++++-- src/declarative/qml/qdeclarativeengine.cpp | 43 ++++++++++++++++++---- src/declarative/qml/qdeclarativefastproperties.cpp | 9 +++++ .../qml/qdeclarativeobjectscriptclass.cpp | 9 ++++- .../qdeclarativeecmascript/data/objectName.qml | 8 ++++ .../tst_qdeclarativeecmascript.cpp | 19 ++++++++++ 6 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h index c7857b7..def4188 100644 --- a/src/declarative/qml/qdeclarativedata_p.h +++ b/src/declarative/qml/qdeclarativedata_p.h @@ -64,6 +64,7 @@ class QDeclarativeAbstractBinding; class QDeclarativeContext; class QDeclarativePropertyCache; class QDeclarativeContextData; +class QDeclarativeNotifier; // This class is structured in such a way, that simply zero'ing it is the // default state for elemental object allocations. This is crucial in the // workings of the QDeclarativeInstruction::CreateSimpleObject instruction. @@ -75,7 +76,7 @@ public: : ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false), context(0), outerContext(0), bindings(0), nextContextObject(0), prevContextObject(0), bindingBitsSize(0), bindingBits(0), lineNumber(0), columnNumber(0), deferredComponent(0), deferredIdx(0), - attachedProperties(0), scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0) { + scriptValue(0), objectDataRefCount(0), propertyCache(0), guards(0), extendedData(0) { init(); } @@ -91,6 +92,7 @@ public: void destroyed(QObject *); void parentChanged(QObject *, QObject *); + void objectNameChanged(QObject *); void setImplicitDestructible() { if (!explicitIndestructibleSet) indestructible = false; @@ -125,8 +127,6 @@ public: QDeclarativeCompiledData *deferredComponent; // Can't this be found from the context? unsigned int deferredIdx; - QHash *attachedProperties; - // ### Can we make this QScriptValuePrivate so we incur no additional allocation // cost? QScriptValue *scriptValue; @@ -149,6 +149,18 @@ public: return 0; } } + + QDeclarativeNotifier *objectNameNotifier() const; + QHash *attachedProperties() const; + + struct ExtendedData { + ExtendedData(); + ~ExtendedData(); + + QHash attachedProperties; + void *objectNameNotifier; + }; + mutable ExtendedData *extendedData; }; template diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index dfc29c4..7ed925a 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -68,6 +68,7 @@ #include "private/qdeclarativelist_p.h" #include "private/qdeclarativetypenamecache_p.h" #include "private/qdeclarativeinclude_p.h" +#include "private/qdeclarativenotifier_p.h" #include #include @@ -470,6 +471,7 @@ void QDeclarativeData::parentChanged(QAbstractDeclarativeData *d, QObject *o, QO void QDeclarativeData::objectNameChanged(QAbstractDeclarativeData *d, QObject *o) { + static_cast(d)->objectNameChanged(o); } void QDeclarativeEnginePrivate::init() @@ -953,7 +955,7 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre if (!data) return 0; // Attached properties are only on objects created by QML - QObject *rv = data->attachedProperties?data->attachedProperties->value(id):0; + QObject *rv = data->extendedData?data->attachedProperties()->value(id):0; if (rv || !create) return rv; @@ -963,11 +965,8 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre rv = pf(const_cast(object)); - if (rv) { - if (!data->attachedProperties) - data->attachedProperties = new QHash(); - data->attachedProperties->insert(id, rv); - } + if (rv) + data->attachedProperties()->insert(id, rv); return rv; } @@ -988,8 +987,6 @@ void QDeclarativeData::destroyed(QObject *object) { if (deferredComponent) deferredComponent->release(); - if (attachedProperties) - delete attachedProperties; if (nextContextObject) nextContextObject->prevContextObject = prevContextObject; @@ -1023,6 +1020,9 @@ void QDeclarativeData::destroyed(QObject *object) if (scriptValue) delete scriptValue; + if (extendedData) + delete extendedData; + if (ownMemory) delete this; } @@ -1032,6 +1032,11 @@ void QDeclarativeData::parentChanged(QObject *, QObject *parent) if (!parent && scriptValue) { delete scriptValue; scriptValue = 0; } } +void QDeclarativeData::objectNameChanged(QObject *) +{ + if (extendedData) objectNameNotifier()->notify(); +} + bool QDeclarativeData::hasBindingBit(int bit) const { if (bindingBitsSize > bit) @@ -1068,6 +1073,28 @@ void QDeclarativeData::setBindingBit(QObject *obj, int bit) bindingBits[bit / 32] |= (1 << (bit % 32)); } +QDeclarativeData::ExtendedData::ExtendedData() +: objectNameNotifier(0) +{ +} + +QDeclarativeData::ExtendedData::~ExtendedData() +{ + ((QDeclarativeNotifier *)&objectNameNotifier)->~QDeclarativeNotifier(); +} + +QDeclarativeNotifier *QDeclarativeData::objectNameNotifier() const +{ + if (!extendedData) extendedData = new ExtendedData; + return (QDeclarativeNotifier *)&extendedData->objectNameNotifier; +} + +QHash *QDeclarativeData::attachedProperties() const +{ + if (!extendedData) extendedData = new ExtendedData; + return &extendedData->attachedProperties; +} + /*! Creates a QScriptValue allowing you to use \a object in QML script. \a engine is the QDeclarativeEngine it is to be created in. diff --git a/src/declarative/qml/qdeclarativefastproperties.cpp b/src/declarative/qml/qdeclarativefastproperties.cpp index eb69b6a..78e3afd 100644 --- a/src/declarative/qml/qdeclarativefastproperties.cpp +++ b/src/declarative/qml/qdeclarativefastproperties.cpp @@ -51,10 +51,19 @@ QT_BEGIN_NAMESPACE // primarily read from bindings is a candidate for inclusion as a fast // property. +static void QObject_objectName(QObject *object, void *output, QDeclarativeNotifierEndpoint *endpoint) +{ + if (endpoint) + endpoint->connect(QDeclarativeData::get(object, true)->objectNameNotifier()); + *((QString *)output) = object->objectName(); +} + QDeclarativeFastProperties::QDeclarativeFastProperties() { add(&QDeclarativeItem::staticMetaObject, QDeclarativeItem::staticMetaObject.indexOfProperty("parent"), QDeclarativeItemPrivate::parentProperty); + add(&QObject::staticMetaObject, QObject::staticMetaObject.indexOfProperty("objectName"), + QObject_objectName); } int QDeclarativeFastProperties::accessorIndexForProperty(const QMetaObject *metaObject, int propertyIndex) diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index ab6ff74..61a1f55 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -239,8 +239,13 @@ QDeclarativeObjectScriptClass::property(QObject *obj, const Identifier &name) } } else { if (enginePriv->captureProperties && !(lastData->flags & QDeclarativePropertyCache::Data::IsConstant)) { - enginePriv->capturedProperties << - QDeclarativeEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex); + if (lastData->coreIndex == 0) { + enginePriv->capturedProperties << + QDeclarativeEnginePrivate::CapturedProperty(QDeclarativeData::get(obj, true)->objectNameNotifier()); + } else { + enginePriv->capturedProperties << + QDeclarativeEnginePrivate::CapturedProperty(obj, lastData->coreIndex, lastData->notifyIndex); + } } if (QDeclarativeValueTypeFactory::isValueType((uint)lastData->propType)) { diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml new file mode 100644 index 0000000..ca8c90d --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/objectName.qml @@ -0,0 +1,8 @@ +import QtQuick 1.0 + +QtObject { + objectName: "hello" + + property string test1: objectName + property string test2: objectName.substr(1, 3) +} diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 4feb630..02832f3 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -162,6 +162,7 @@ private slots: void deleteLater(); void in(); void sharedAttachedObject(); + void objectName(); void include(); @@ -2594,6 +2595,24 @@ void tst_qdeclarativeecmascript::sharedAttachedObject() delete o; } +// QTBUG-13999 +void tst_qdeclarativeecmascript::objectName() +{ + QDeclarativeComponent component(&engine, TEST_FILE("objectName.qml")); + QObject *o = component.create(); + QVERIFY(o != 0); + + QCOMPARE(o->property("test1").toString(), QString("hello")); + QCOMPARE(o->property("test2").toString(), QString("ell")); + + o->setObjectName("world"); + + QCOMPARE(o->property("test1").toString(), QString("world")); + QCOMPARE(o->property("test2").toString(), QString("orl")); + + delete o; +} + QTEST_MAIN(tst_qdeclarativeecmascript) #include "tst_qdeclarativeecmascript.moc" -- cgit v0.12 From e67800d9e0dc82a38b01c9b8eff4dc1a10f306d8 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 Oct 2010 13:29:04 +1000 Subject: Test for absent qmldir Task-number: QTBUG-13051 --- .../qtest/declarative/qmllanguage/noqmldir/Test.qml | 2 ++ .../auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 1 + 2 files changed, 3 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml diff --git a/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml new file mode 100644 index 0000000..0b054d0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativelanguage/qtest/declarative/qmllanguage/noqmldir/Test.qml @@ -0,0 +1,2 @@ +import QtQuick 1.0 +Rectangle { } diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 6a45957..be04dee 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1569,6 +1569,7 @@ void tst_qdeclarativelanguage::basicRemote_data() QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage/"; QTest::newRow("no need for qmldir") << QUrl(serverdir+"Test.qml") << "" << ""; + QTest::newRow("absent qmldir") << QUrl(serverdir+"/noqmldir/Test.qml") << "" << ""; QTest::newRow("need qmldir") << QUrl(serverdir+"TestLocal.qml") << "" << ""; } -- cgit v0.12 From 9849d8f5f1c0c3f03d3f83cc51eea2beb3d9cbbc Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Mon, 11 Oct 2010 18:07:35 +1000 Subject: Fix autotest on windows --- src/declarative/qml/qdeclarativeengine.cpp | 12 ++++++++++++ .../tst_qdeclarativemoduleplugin.cpp | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 7ed925a..d768882 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -2196,7 +2196,19 @@ bool QDeclarative_isFileCaseCorrect(const QString &fileName) QFileInfo info(fileName); QString absolute = info.absoluteFilePath(); + +#if defined(Q_OS_MAC) QString canonical = info.canonicalFilePath(); +#elif defined(Q_OS_WIN) + wchar_t buffer[1024]; + + DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); + if (rv == 0 || rv >= 1024) return true; + rv = ::GetLongPathName(buffer, buffer, 1024); + if (rv == 0 || rv >= 1024) return true; + + QString canonical((QChar *)buffer); +#endif int absoluteLength = absolute.length(); int canonicalLength = canonical.length(); diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index 587a86a..51f66a5 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -132,7 +132,12 @@ void tst_qdeclarativemoduleplugin::incorrectPluginCase() QCOMPARE(errors.count(), 1); #if defined(Q_OS_MAC) || defined(Q_OS_WIN) - QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/libPluGin.dylib") + QLatin1String("\""); +#if defined(Q_OS_MAC) + QString libname = "libPluGin.dylib"; +#elif defined(Q_OS_WIN) + QString libname = "PluGin.dll"; +#endif + QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/" + libname) + QLatin1String("\""); #else QString expectedError = QLatin1String("module \"com.nokia.WrongCase\" plugin \"PluGin\" not found"); #endif -- cgit v0.12 From d7657d8506bf06efef6b7636d1b1cbaea0f0cfc7 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Mon, 11 Oct 2010 10:18:00 +0200 Subject: Remove references of qunifiedtoolbarcontainer_mac_p.h Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/widgets/qmainwindowlayout_mac.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index b2c4cea..21f6067 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -49,7 +49,6 @@ #else #include #import -#include #endif QT_BEGIN_NAMESPACE -- cgit v0.12 From 36438bc216f939acd4e6772847d435e2e77d41c3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 11 Oct 2010 10:48:54 +0200 Subject: Designer: Fix a crash when copying empty page-based containers. Reviewed-by: Jarek Kobus Task-number: QTBUG-14208 --- tools/designer/src/components/formeditor/formwindow.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp index 15775f6..38a0544 100644 --- a/tools/designer/src/components/formeditor/formwindow.cpp +++ b/tools/designer/src/components/formeditor/formwindow.cpp @@ -1683,10 +1683,13 @@ void FormWindow::cut() // for cases like QMainWindow (central widget is an inner container) or QStackedWidget (page is an inner container) QWidget *FormWindow::innerContainer(QWidget *outerContainer) const { - bool isContainer = m_core->widgetDataBase()->isContainer(outerContainer); - if (isContainer) - if (QDesignerContainerExtension *container = qt_extension(m_core->extensionManager(), outerContainer)) - return container->widget(container->currentIndex()); + if (m_core->widgetDataBase()->isContainer(outerContainer)) + if (const QDesignerContainerExtension *container = qt_extension(m_core->extensionManager(), outerContainer)) { + const int currentIndex = container->currentIndex(); + return currentIndex >= 0 ? + container->widget(currentIndex) : + static_cast(0); + } return outerContainer; } @@ -1706,8 +1709,10 @@ QWidget *FormWindow::containerForPaste() const QWidget *containerOfW = findContainer(selection.first(), /* exclude layouts */ true); if (!containerOfW || containerOfW == mainContainer()) break; - // No layouts, must be container + // No layouts, must be container. No empty page-based containers. containerOfW = innerContainer(containerOfW); + if (!containerOfW) + break; if (LayoutInfo::layoutType(m_core, containerOfW) != LayoutInfo::NoLayout || !m_core->widgetDataBase()->isContainer(containerOfW)) break; w = containerOfW; @@ -1716,6 +1721,8 @@ QWidget *FormWindow::containerForPaste() const // and the like as the central widget has the layout). w = innerContainer(w); + if (!w) + return 0; if (LayoutInfo::layoutType(m_core, w) != LayoutInfo::NoLayout) return 0; // Go up via container extension (also includes step from QMainWindow to its central widget) -- cgit v0.12 From 48f18622b6fbfd19ccc77574d3750a8c0c1f6a7d Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 8 Oct 2010 16:59:44 +0100 Subject: Spectrum demo: put binaries into correct locations on Windows Task-number: QTBUG-13483 Reviewed-by: Miikka Heikkinen --- demos/spectrum/3rdparty/fftreal/fftreal.pro | 2 +- demos/spectrum/app/app.pro | 9 ++------- demos/spectrum/spectrum.pri | 12 ++++++++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/demos/spectrum/3rdparty/fftreal/fftreal.pro b/demos/spectrum/3rdparty/fftreal/fftreal.pro index 6305af4..e5093ba 100644 --- a/demos/spectrum/3rdparty/fftreal/fftreal.pro +++ b/demos/spectrum/3rdparty/fftreal/fftreal.pro @@ -40,7 +40,7 @@ symbian { macx { CONFIG += lib_bundle } else { - !symbian: DESTDIR = ../.. + !symbian: DESTDIR = ../..$${spectrum_build_dir} } # Install diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro index 4fe8b6d..57be114 100644 --- a/demos/spectrum/app/app.pro +++ b/demos/spectrum/app/app.pro @@ -65,7 +65,7 @@ symbian { LIBS += -F$${fftreal_dir} LIBS += -framework fftreal } else { - LIBS += -L.. + LIBS += -L..$${spectrum_build_dir} LIBS += -lfftreal } } @@ -91,10 +91,8 @@ symbian { DEPLOYMENT += fftreal } } else { + DESTDIR = ..$${spectrum_build_dir} macx { - # Specify directory in which to create spectrum.app bundle - DESTDIR = .. - !contains(DEFINES, DISABLE_FFT) { # Relocate fftreal.framework into spectrum.app bundle framework_dir = ../spectrum.app/Contents/Frameworks @@ -110,9 +108,6 @@ symbian { ../spectrum.app/Contents/MacOS/spectrum } } else { - # Specify directory in which to create spectrum application - DESTDIR = .. - unix: { # Provide relative path from application to fftreal library QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN diff --git a/demos/spectrum/spectrum.pri b/demos/spectrum/spectrum.pri index c09aa0d..5773900 100644 --- a/demos/spectrum/spectrum.pri +++ b/demos/spectrum/spectrum.pri @@ -35,3 +35,15 @@ DEFINES += SPECTRUM_ANALYSER_SEPARATE_THREAD # Suppress warnings about strncpy potentially being unsafe, emitted by MSVC win32: DEFINES += _CRT_SECURE_NO_WARNINGS +win32 { + # spectrum_build_dir is defined with a leading slash so that it can + # be used in contexts such as + # ..$${spectrum_build_dir} + # without the result having a trailing slash where spectrum_build_dir + # is undefined. + spectrum_build_dir = /release + if (!debug_and_release|build_pass): CONFIG(debug, debug|release) { + spectrum_build_dir = /debug + } +} + -- cgit v0.12 From 3c2296647d2e7ddda4df6679a622b0bf46b34c35 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Fri, 8 Oct 2010 15:10:56 +0100 Subject: Spectrum demo: only use --rpath for linux-g++* mkspecs Task-number: QTBUG-13940 Reviewed-by: Martin Pejcoch --- demos/spectrum/app/app.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro index 57be114..b3ff227 100644 --- a/demos/spectrum/app/app.pro +++ b/demos/spectrum/app/app.pro @@ -108,7 +108,7 @@ symbian { ../spectrum.app/Contents/MacOS/spectrum } } else { - unix: { + linux-g++*: { # Provide relative path from application to fftreal library QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN } -- cgit v0.12 From 76e2668a621b03ee4da423c10afac0ceb66e6a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=AA=E0=A5=8D=E0=A4=B0=E0=A4=B5=E0=A4=BF=E0=A4=A3=20?= =?UTF-8?q?=E0=A4=B8=E0=A4=BE=E0=A4=A4=E0=A4=AA=E0=A5=81=E0=A4=A4=E0=A5=87?= Date: Mon, 11 Oct 2010 13:25:29 +0200 Subject: Fix several errors with shaping of Indic scripts 1. The opentype init feature was applied to some characters even when the character appeared inside a word. 2. Using the ZWJ to separate Ra and Halant Ya should connect the two latter characters and form a Yaphala 3. Some Oriya chars were not correctly marked as below-base form. Task-number: QTBUG-13620, QTBUG-13616, QTBUG-13542 Merge-request: 2484 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp index 4d8418b..817fb0d 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp @@ -37,7 +37,7 @@ static HB_Bool isLetter(HB_UChar16 ucs) FLAG(HB_Letter_Titlecase) | FLAG(HB_Letter_Modifier) | FLAG(HB_Letter_Other); - return FLAG(HB_GetUnicodeCharCategory(ucs)) & test; + return (FLAG(HB_GetUnicodeCharCategory(ucs)) & test) != 0; } static HB_Bool isMark(HB_UChar16 ucs) @@ -660,18 +660,18 @@ static const unsigned char indicPosition[0xe00-0x900] = { None, None, None, None, None, None, None, None, - None, None, None, None, - None, None, None, None, - None, None, None, None, + None, Below, Below, Below, + Below, Below, Below, Below, + Below, Below, None, Below, - None, None, None, None, - Below, None, None, None, - Below, None, None, None, + Below, Below, Below, Below, + Below, Below, Below, Below, + Below, None, Below, Below, Below, Below, Below, Post, Below, None, Below, Below, - None, None, None, None, - None, None, None, None, + None, Below, Below, Below, + Below, Below, None, None, None, None, Post, Above, Post, Below, Below, Below, @@ -1741,6 +1741,11 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int if (state == Halant && uc[pos] == 0x200d /* ZWJ */) break; // the control character should be the last char in the item + if (state == Consonant && script == HB_Script_Bengali && uc[pos-1] == 0x09B0 && uc[pos] == 0x200d /* ZWJ */) + break; + if (state == Consonant && script == HB_Script_Kannada && uc[pos-1] == 0x0CB0 && uc[pos] == 0x200d /* ZWJ */) + break; + // Bengali and Kannada has a special exception for rendering yaphala with ra (to avoid reph) see http://www.unicode.org/faq/indic.html#15 ++pos; goto finish; case Consonant: -- cgit v0.12 From ae37a39a16c0d28d69fe9e0295ec619d899dc518 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 11 Oct 2010 13:25:31 +0200 Subject: Add some tests for Indic shaping in Harfbuzz These were added to confirm the behavior in merge request 2484. Their validity depends on the validity of the merge request. Task-number: QTBUG-13620, QTBUG-13616, QTBUG-13542 --- src/3rdparty/harfbuzz/tests/shaping/main.cpp | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp index 28f8e07..73760a8 100644 --- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp +++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp @@ -642,6 +642,10 @@ void tst_QScriptEngine::bengali() { { 0x9f1, 0x9cd, 0x9ad, 0x0 }, { 0x191, 0x17d, 0x168, 0x0 } }, + // Ra ZWJ Halant Ya + { { 0x09b0, 0x200d, 0x09cd, 0x09af, 0x0 }, + { 0x016b, 0x01cf, 0x0 } }, + { {0}, {0} } }; @@ -749,6 +753,13 @@ void tst_QScriptEngine::bengali() { { 0x09b0, 0x09cd, 0x09ac, 0x09cd, 0x09ac, 0x0 }, { 0x013b, 0x00e1, 0x0 } }, + // Init feature for vowel sign E should only be + // applied when it's initial character (QTBUG-13620) + { { 0x09a8, 0x09c7, 0x0 }, + { 0x0232, 0x0086, 0x0 } }, + { { 0x09a8, 0x09a8, 0x09c7, 0x0 }, + { 0x0086, 0x009b, 0x0086, 0x0 } }, + { {0}, {0} } }; @@ -847,6 +858,19 @@ void tst_QScriptEngine::oriya() { 0x177, 0x0 } }, { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb30, 0xb4d, 0xb2f, 0x0 }, { 0x176, 0x124, 0x0 } }, + + // QTBUG-13542 + { { 0x0b2c, 0x0b4d, 0x0b21, 0x0 }, + { 0x0089, 0x00fc, 0x0 } }, + { { 0x0b36, 0x0b4d, 0x0b2b, 0x0 }, + { 0x0092, 0x0105, 0x0 } }, + { { 0x0b36, 0x0b4d, 0x0b1f, 0x0 }, + { 0x0092, 0x00fa, 0x0 } }, + { { 0x0b39, 0x0b4d, 0x0b1f, 0x0 }, + { 0x0095, 0x00fa, 0x0 } }, + { { 0x0b15, 0x0b4d, 0x0b16, 0x0 }, + { 0x0073, 0x00f1, 0x0 } }, + { {0}, {0} } }; @@ -1005,6 +1029,11 @@ void tst_QScriptEngine::kannada() { 0x0036, 0x00c1, 0x0 } }, { { 0x0cb0, 0x0ccd, 0x200d, 0x0c95, 0x0 }, { 0x0050, 0x00a7, 0x0 } }, + + // Kaphala + { { 0x0cb0, 0x200d, 0x0ccd, 0x0c95, 0x0 }, + { 0x0050, 0x00a7, 0x0 } }, + { {0}, {0} } }; -- cgit v0.12 From c27f1586d7c4c56af1f46fa09ad77f03b7736e5d Mon Sep 17 00:00:00 2001 From: mread Date: Fri, 8 Oct 2010 15:31:09 +0100 Subject: Making the hybrid allocator change compatible across all 4.7.x The hybrid allocator introduced a new export to qtcore.dll and made all apps link to it when they linked with the corresponding qtmain.lib. However, this made all apps depend on this new export, and since that export is not present in early 4.7.x release, these apps would not run with the Qt DLLs from those releases, which breaks Qt's compatibility guarantees for patch releases. This change makes apps compatible with all 4.7.x releases again. For export frozen Qt builds (the sort that should be compatible across all 4.7.x releases), qtmain.lib no longer forces a static import link to qt_symbian_SetupThreadHeap(). Instead it dynamically loads qtcore.dll, looks up qt_symbian_SetupThreadHeap(), and calls it if present. If the function is not present, or on emulator builds where we know that qtcore will use the system allocator creation function, we call the system allocator creation function. For export unfrozen builds, there is no compatibility between builds or releases, so we do use a static import link to qt_symbian_SetupThreadHeap(), as we have to use the qtcore dll we have built with it anyway. This has been tested as follows: S60 3.1 SDK, def files not frozen. App compiled against latest code runs on the corresponding DLLs, and does not start with 4.7.0, which is what we expect. S60 3.2 SDK, def files frozen. App compiled against latest code runs on the corresponding DLLs with the new allocator, and runs on 4.7.0 DLLs with the old allocator. Which demonstrates compatibility. S60 5.0 SDK, def files not frozen, debug build. Same result as for the 3.1 SDK, which demonstrates debug build working too (all other tests are release build tests). S60 5.0 SDK, def files frozen, debug build. Same result as on S60 3.2 SDK, which demonstrates debug build working with def files. Symbian^3 SDK, def files frozen. Same result as on S60 3.2 SDK, demonstrating Symbian^3 compatibility. Symbian^4, code and tests compile and does not affect running. *** This change is only required for 4.7. It is not needed for 4.8+ *** *** If this change appears in 4.8+, it can be reverted. *** Task-number: QT-4080 Reviewed-by: Shane Kearns --- src/s60main/newallocator_hook.cpp | 87 ++++++++++++++++++++++++++++++++++++++- src/s60main/s60main.pro | 3 ++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/src/s60main/newallocator_hook.cpp b/src/s60main/newallocator_hook.cpp index 9cc6afb..9ea2ef0 100644 --- a/src/s60main/newallocator_hook.cpp +++ b/src/s60main/newallocator_hook.cpp @@ -41,6 +41,11 @@ #include #include +#ifdef QT_EXPORTS_NOT_FROZEN +// If exports in Qt DLLs are not frozen in this build, then we have to pick up the +// allocator creation function by import link. We know the function will be present +// in the DLLs we test with, as we have to use the DLLs we have built. + struct SStdEpocThreadCreateInfo; Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); @@ -51,8 +56,88 @@ Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCre * Uses link-time symbol preemption to capture a call from the application * startup. On return, there is some kind of heap allocator installed on the * thread. -*/ +*/ TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) { return qt_symbian_SetupThreadHeap(aNotFirst, aInfo); } + +#else // QT_EXPORTS_NOT_FROZEN +// If we are using an export frozen build, it should be compatible with all 4.7.x Qt releases. +// We want to use the allocator creation function introduced in qtcore.dll after 4.7.1. But we +// can't import link to it, as it may not be present in whatever 4.7.x DLLs we are running with. +// So the function is found and called dynamically, by library lookup. If it is not found, we +// use the OS allocator creation functions instead. + +struct SThreadCreateInfo + { + TAny* iHandle; + TInt iType; + TThreadFunction iFunction; + TAny* iPtr; + TAny* iSupervisorStack; + TInt iSupervisorStackSize; + TAny* iUserStack; + TInt iUserStackSize; + TInt iInitialThreadPriority; + TPtrC iName; + TInt iTotalSize; // Size including any extras (must be a multiple of 8 bytes) + }; + +struct SStdEpocThreadCreateInfo : public SThreadCreateInfo + { + RAllocator* iAllocator; + TInt iHeapInitialSize; + TInt iHeapMaxSize; + TInt iPadding; // Make structure size a multiple of 8 bytes + }; + + +/* \internal + * + * Uses link-time symbol preemption to capture a call from the application + * startup. On return, there is some kind of heap allocator installed on the + * thread. +*/ +TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) +{ + TInt r = KErrNone; + +#ifndef __WINS__ + // attempt to create the fast allocator through a known export ordinal in qtcore.dll + RLibrary qtcore; + if (qtcore.Load(_L("qtcore.dll")) == KErrNone) + { + const int qt_symbian_SetupThreadHeap_eabi_ordinal = 3713; + TLibraryFunction libFunc = qtcore.Lookup(qt_symbian_SetupThreadHeap_eabi_ordinal); + if (libFunc) + { + typedef int (*TSetupThreadHeapFunc)(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); + TSetupThreadHeapFunc p_qt_symbian_SetupThreadHeap = TSetupThreadHeapFunc(libFunc); + r = (*p_qt_symbian_SetupThreadHeap)(aNotFirst, aInfo); + } + qtcore.Close(); + if (libFunc) + return r; + } +#endif + + // no fast allocator support - use default allocator creation + if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0) + { + // new heap required + RHeap* pH = NULL; + r = UserHeap::CreateThreadHeap(aInfo, pH); + } + else if (aInfo.iAllocator) + { + // sharing a heap + RAllocator* pA = aInfo.iAllocator; + pA->Open(); + User::SwitchAllocator(pA); + r = KErrNone; + } + return r; +} + +#endif // QT_EXPORTS_NOT_FROZEN diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index 664f155..8ab3bd3 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -31,6 +31,9 @@ symbian { # against GCCE apps, so remove it MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA linux-armcc:QMAKE_CXXFLAGS *= --export_all_vtbl + + # Flag if exports are not frozen to avoid lookup of qtcore allocator creation function by ordinal + contains(CONFIG, def_files_disabled): DEFINES += QT_EXPORTS_NOT_FROZEN } else { error("$$_FILE_ is intended only for Symbian!") } -- cgit v0.12 From 791ff94dc3b3a01798ce0bf1243de228b3c19e25 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 11 Oct 2010 14:28:05 +0200 Subject: The completer in an itemview would not be activated right away If you have set the edit triggers to AnyKeyPressed and you press a key the completer would not kick in because the key event would come before the lineedit gets focus. The completer is only active when the lineedit has focus. Task-number: QTBUG14363 Reviewed-by: ogoffart --- src/gui/itemviews/qabstractitemview.cpp | 6 ++--- tests/auto/qlistwidget/tst_qlistwidget.cpp | 40 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 0842ee8..b5ca812 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -4101,13 +4101,13 @@ bool QAbstractItemViewPrivate::openEditor(const QModelIndex &index, QEvent *even if (!w) return false; - if (event) - QApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event); - q->setState(QAbstractItemView::EditingState); w->show(); w->setFocus(); + if (event) + QApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event); + return true; } diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index eb3fb6b..8aa50d3 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -133,6 +133,7 @@ private slots: void task217070_scrollbarsAdjusted(); void task258949_keypressHangup(); void QTBUG8086_currentItemChangedOnClick(); + void QTBUG14363_completerWithAnyKeyPressedEditTriggers(); protected slots: @@ -1640,5 +1641,44 @@ void tst_QListWidget::QTBUG8086_currentItemChangedOnClick() } +class ItemDelegate : public QItemDelegate +{ +public: + ItemDelegate(QObject *parent = 0) : QItemDelegate(parent) + {} + virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &) const + { + QLineEdit *lineEdit = new QLineEdit(parent); + lineEdit->setFrame(false); + QCompleter *completer = new QCompleter(QStringList() << "completer", lineEdit); + completer->setCompletionMode(QCompleter::InlineCompletion); + lineEdit->setCompleter(completer); + return lineEdit; + } +}; + +void tst_QListWidget::QTBUG14363_completerWithAnyKeyPressedEditTriggers() +{ + QListWidget listWidget; + listWidget.setEditTriggers(QAbstractItemView::AnyKeyPressed); + listWidget.setItemDelegate(new ItemDelegate); + QListWidgetItem *item = new QListWidgetItem(QLatin1String("select an item (don't start editing)"), &listWidget); + item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable|Qt::ItemIsEditable); + new QListWidgetItem(QLatin1String("try to type the letter 'c'"), &listWidget); + new QListWidgetItem(QLatin1String("completer"), &listWidget); + listWidget.show(); + listWidget.setCurrentItem(item); + QTest::qWaitForWindowShown(&listWidget); + + QTest::keyClick(listWidget.viewport(), Qt::Key_C); + + QLineEdit *le = qobject_cast(listWidget.itemWidget(item)); + QVERIFY(le); + QCOMPARE(le->text(), QString("completer")); + QCOMPARE(le->completer()->currentCompletion(), QString("completer")); +} + + + QTEST_MAIN(tst_QListWidget) #include "tst_qlistwidget.moc" -- cgit v0.12 From ef7df41b11c4f5e026b85ca9b02a9c05b427a301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 8 Oct 2010 15:33:25 +0200 Subject: Compile fix for OpenVG without VGFont. ShivaVG doesn't have VGFont support for example. Reviewed-by: Jason Barron --- src/openvg/qpaintengine_vg.cpp | 9 ++------- src/openvg/qvg_p.h | 5 +++++ src/openvg/qvgfontglyphcache_p.h | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index f6d2435..ce9d11a 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -61,11 +61,6 @@ QT_BEGIN_NAMESPACE -// vgDrawGlyphs() only exists in OpenVG 1.1 and higher. -#if !defined(OPENVG_VERSION_1_1) && !defined(QVG_NO_DRAW_GLYPHS) -#define QVG_NO_DRAW_GLYPHS 1 -#endif - // vgRenderToMask() only exists in OpenVG 1.1 and higher. // Also, disable masking completely if we are using the scissor to clip. #if !defined(OPENVG_VERSION_1_1) && !defined(QVG_NO_RENDER_TO_MASK) @@ -75,11 +70,11 @@ QT_BEGIN_NAMESPACE #define QVG_NO_RENDER_TO_MASK 1 #endif -#if !defined(QVG_NO_DRAW_GLYPHS) - // use the same rounding as in qrasterizer.cpp (6 bit fixed point) static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; +#if !defined(QVG_NO_DRAW_GLYPHS) + Q_DECL_IMPORT extern int qt_defaultDpiX(); Q_DECL_IMPORT extern int qt_defaultDpiY(); diff --git a/src/openvg/qvg_p.h b/src/openvg/qvg_p.h index 51abbee..94d1eae 100644 --- a/src/openvg/qvg_p.h +++ b/src/openvg/qvg_p.h @@ -55,6 +55,11 @@ // We mean it. // +// vgDrawGlyphs() only exists in OpenVG 1.1 and higher. +#if !defined(OPENVG_VERSION_1_1) && !defined(QVG_NO_DRAW_GLYPHS) +#define QVG_NO_DRAW_GLYPHS 1 +#endif + #include #if !defined(QT_NO_EGL) diff --git a/src/openvg/qvgfontglyphcache_p.h b/src/openvg/qvgfontglyphcache_p.h index b32a873..8bcdcc7 100644 --- a/src/openvg/qvgfontglyphcache_p.h +++ b/src/openvg/qvgfontglyphcache_p.h @@ -56,10 +56,14 @@ #include #include +#include + QT_BEGIN_NAMESPACE class QVGPaintEnginePrivate; +#ifndef QVG_NO_DRAW_GLYPHS + class QVGFontGlyphCache { public: @@ -90,6 +94,8 @@ public: }; #endif +#endif + QT_END_NAMESPACE #endif // QVGFONTGLYPHCACHE_H -- cgit v0.12 From 650a0078e2cef43eff107fe8d2505f64a0bfedf0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 12 Oct 2010 13:11:38 +1000 Subject: Update sections if model content changes. We didn't handle the section property changing, e.g. due to asynchronous model. Task-number: QT-4093 Reviewed-by: Aaron Kennedy --- .../graphicsitems/qdeclarativelistview.cpp | 40 ++++++++++++++++++++-- .../graphicsitems/qdeclarativelistview_p.h | 2 ++ .../graphicsitems/qdeclarativevisualitemmodel.cpp | 21 ++++++++++++ .../graphicsitems/qdeclarativevisualitemmodel_p.h | 4 +++ .../tst_qdeclarativelistview.cpp | 11 ++++++ 5 files changed, 75 insertions(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 4943aef..6fd3b71 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -775,7 +775,6 @@ void QDeclarativeListViewPrivate::layout() setPosition(0); return; } - updateSections(); if (!visibleItems.isEmpty()) { qreal oldEnd = visibleItems.last()->endPosition(); qreal pos = visibleItems.first()->endPosition() + spacing + 1; @@ -934,6 +933,7 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem) return; if (listItem->attached->m_prevSection != listItem->attached->m_section) { if (!listItem->section) { + qreal pos = listItem->position(); int i = sectionCacheSize-1; while (i >= 0 && !sectionCache[i]) --i; @@ -961,8 +961,10 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem) delete context; } } + listItem->setPosition(pos); } } else if (listItem->section) { + qreal pos = listItem->position(); int i = 0; do { if (!sectionCache[i]) { @@ -975,12 +977,13 @@ void QDeclarativeListViewPrivate::createSection(FxListItem *listItem) } while (i < sectionCacheSize); delete listItem->section; listItem->section = 0; + listItem->setPosition(pos); } } void QDeclarativeListViewPrivate::updateSections() { - if (sectionCriteria) { + if (sectionCriteria && !visibleItems.isEmpty()) { QString prevSection; if (visibleIndex > 0) prevSection = sectionAt(visibleIndex-1); @@ -990,6 +993,8 @@ void QDeclarativeListViewPrivate::updateSections() if (visibleItems.at(i)->index != -1) { QDeclarativeListViewAttached *attached = visibleItems.at(i)->attached; attached->setPrevSection(prevSection); + QString propValue = model->stringValue(visibleItems.at(i)->index, sectionCriteria->property()); + attached->setSection(sectionCriteria->sectionString(propValue)); if (prevAtt) prevAtt->setNextSection(attached->section()); createSection(visibleItems.at(i)); @@ -1560,6 +1565,7 @@ void QDeclarativeListView::setModel(const QVariant &model) disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); disconnect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); disconnect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); + disconnect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int))); disconnect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); disconnect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); disconnect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); @@ -1590,6 +1596,7 @@ void QDeclarativeListView::setModel(const QVariant &model) if (d->model) { d->bufferMode = QDeclarativeListViewPrivate::BufferBefore | QDeclarativeListViewPrivate::BufferAfter; if (isComponentComplete()) { + updateSections(); refill(); if (d->currentIndex >= d->model->count() || d->currentIndex < 0) { setCurrentIndex(0); @@ -1605,6 +1612,7 @@ void QDeclarativeListView::setModel(const QVariant &model) connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); + connect(d->model, SIGNAL(itemsChanged(int,int)), this, SLOT(itemsChanged(int,int))); connect(d->model, SIGNAL(modelReset()), this, SLOT(modelReset())); connect(d->model, SIGNAL(createdItem(int, QDeclarativeItem*)), this, SLOT(createdItem(int,QDeclarativeItem*))); connect(d->model, SIGNAL(destroyingItem(QDeclarativeItem*)), this, SLOT(destroyingItem(QDeclarativeItem*))); @@ -1662,6 +1670,7 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate) d->visibleItems.clear(); d->releaseItem(d->currentItem); d->currentItem = 0; + updateSections(); refill(); d->moveReason = QDeclarativeListViewPrivate::SetIndex; d->updateCurrent(d->currentIndex); @@ -2075,8 +2084,10 @@ void QDeclarativeListView::setCacheBuffer(int b) QDeclarativeViewSection *QDeclarativeListView::sectionCriteria() { Q_D(QDeclarativeListView); - if (!d->sectionCriteria) + if (!d->sectionCriteria) { d->sectionCriteria = new QDeclarativeViewSection(this); + connect(d->sectionCriteria, SIGNAL(propertyChanged()), this, SLOT(updateSections())); + } return d->sectionCriteria; } @@ -2669,6 +2680,7 @@ void QDeclarativeListView::componentComplete() { Q_D(QDeclarativeListView); QDeclarativeFlickable::componentComplete(); + updateSections(); if (d->isValid()) { refill(); d->moveReason = QDeclarativeListViewPrivate::SetIndex; @@ -2685,6 +2697,18 @@ void QDeclarativeListView::componentComplete() } } +void QDeclarativeListView::updateSections() +{ + Q_D(QDeclarativeListView); + if (isComponentComplete() && d->model) { + QList roles; + if (d->sectionCriteria && !d->sectionCriteria->property().isEmpty()) + roles << d->sectionCriteria->property().toUtf8(); + d->model->setWatchedRoles(roles); + d->updateSections(); + } +} + void QDeclarativeListView::refill() { Q_D(QDeclarativeListView); @@ -2894,6 +2918,7 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count) for (int j = 0; j < added.count(); ++j) added.at(j)->attached->emitAdd(); + d->updateSections(); d->itemCount += count; emit countChanged(); } @@ -2986,6 +3011,7 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count) } } + d->updateSections(); emit countChanged(); } @@ -3107,6 +3133,14 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count) // Ensure we don't cause an ugly list scroll. d->visibleItems.first()->setPosition(d->visibleItems.first()->position() + moveBy); + d->updateSections(); + d->layout(); +} + +void QDeclarativeListView::itemsChanged(int, int) +{ + Q_D(QDeclarativeListView); + d->updateSections(); d->layout(); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h index 735b248..2678b90 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview_p.h +++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h @@ -250,11 +250,13 @@ protected: virtual void componentComplete(); private Q_SLOTS: + void updateSections(); void refill(); void trackedPositionChanged(); void itemsInserted(int index, int count); void itemsRemoved(int index, int count); void itemsMoved(int from, int to, int count); + void itemsChanged(int index, int count); void modelReset(); void destroyRemoved(); void createdItem(int index, QDeclarativeItem *item); diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 439f500..e569dd2 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -403,6 +403,8 @@ public: QDeclarativeListAccessor *m_listAccessor; QModelIndex m_root; + QList watchedRoles; + QList watchedRoleIds; }; class QDeclarativeVisualDataModelDataMetaObject : public QDeclarativeOpenMetaObject @@ -1170,10 +1172,25 @@ int QDeclarativeVisualDataModel::indexOf(QDeclarativeItem *item, QObject *) cons return -1; } +void QDeclarativeVisualDataModel::setWatchedRoles(QList roles) +{ + Q_D(QDeclarativeVisualDataModel); + d->watchedRoles = roles; + d->watchedRoleIds.clear(); +} + void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count, const QList &roles) { Q_D(QDeclarativeVisualDataModel); + bool changed = false; + if (!d->watchedRoles.isEmpty() && d->watchedRoleIds.isEmpty()) { + foreach (QByteArray r, d->watchedRoles) { + if (d->m_roleNames.contains(r)) + d->watchedRoleIds << d->m_roleNames.value(r); + } + } + for (QHash::ConstIterator iter = d->m_cache.begin(); iter != d->m_cache.end(); ++iter) { const int idx = iter.key(); @@ -1183,6 +1200,8 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count, QDeclarativeVisualDataModelData *data = d->data(objRef.obj); for (int roleIdx = 0; roleIdx < roles.count(); ++roleIdx) { int role = roles.at(roleIdx); + if (!changed && !d->watchedRoleIds.isEmpty() && d->watchedRoleIds.contains(role)) + changed = true; int propId = data->propForRole(role); if (propId != -1) { if (data->hasValue(propId)) { @@ -1217,6 +1236,8 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count, } } } + if (changed) + emit itemsChanged(index, count); } void QDeclarativeVisualDataModel::_q_itemsInserted(int index, int count) diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h index f09d8dd..5e187c2 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h @@ -79,6 +79,7 @@ public: virtual bool completePending() const = 0; virtual void completeItem() = 0; virtual QString stringValue(int, const QString &) = 0; + virtual void setWatchedRoles(QList roles) = 0; virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const = 0; @@ -87,6 +88,7 @@ Q_SIGNALS: void itemsInserted(int index, int count); void itemsRemoved(int index, int count); void itemsMoved(int from, int to, int count); + void itemsChanged(int index, int count); void modelReset(); void createdItem(int index, QDeclarativeItem *item); void destroyingItem(QDeclarativeItem *item); @@ -120,6 +122,7 @@ public: virtual bool completePending() const; virtual void completeItem(); virtual QString stringValue(int index, const QString &role); + virtual void setWatchedRoles(QList) {} virtual int indexOf(QDeclarativeItem *item, QObject *objectContext) const; @@ -174,6 +177,7 @@ public: bool completePending() const; void completeItem(); virtual QString stringValue(int index, const QString &role); + virtual void setWatchedRoles(QList roles); int indexOf(QDeclarativeItem *item, QObject *objectContext) const; diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 65ff635..7a58773 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -985,6 +985,17 @@ void tst_QDeclarativeListView::sections() QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); + // check that headers change when item changes + listview->setContentY(0); + model.modifyItem(0, "changed", "2"); + + canvas->show(); + qApp->exec(); + + item = findItem(contentItem, "wrapper", 1); + QTRY_VERIFY(item); + QTRY_COMPARE(item->height(), 40.0); + delete canvas; } -- cgit v0.12 From e4dbf0c82b46e7a32e21185c8f633506229be944 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Tue, 12 Oct 2010 14:35:22 +1000 Subject: Bug: TextEdit ignores plain text format when pasting text Task-number: QTBUG-14003 Reviewed-by: Michael Brasser --- .../graphicsitems/qdeclarativetextedit.cpp | 1 + .../tst_qdeclarativetextedit.cpp | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp index 6f5608a..e05f4e4 100644 --- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp @@ -319,6 +319,7 @@ void QDeclarativeTextEdit::setTextFormat(TextFormat format) updateSize(); } d->format = format; + d->control->setAcceptRichText(d->format != PlainText); emit textFormatChanged(d->format); } diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 472c5ef..a7971cc 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -56,6 +56,8 @@ #include #include #include +#include +#include #include #include @@ -119,6 +121,8 @@ private slots: void openInputPanelOnClick(); void openInputPanelOnFocus(); void geometrySignals(); + void pastingRichText_QTBUG_14003(); + private: void simulateKey(QDeclarativeView *, int key); QDeclarativeView *createView(const QString &filename); @@ -1174,6 +1178,27 @@ void tst_qdeclarativetextedit::geometrySignals() delete o; } +void tst_qdeclarativetextedit::pastingRichText_QTBUG_14003() +{ +#ifndef QT_NO_CLIPBOARD + QString componentStr = "import QtQuick 1.0\nTextEdit { textFormat: TextEdit.PlainText }"; + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeTextEdit *obj = qobject_cast(component.create()); + + QTRY_VERIFY(obj != 0); + QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText); + + QMimeData *mData = new QMimeData; + mData->setHtml("Hello"); + QApplication::clipboard()->setMimeData(mData); + + obj->paste(); + QTRY_VERIFY(obj->text() == ""); + QTRY_VERIFY(obj->textFormat() == QDeclarativeTextEdit::PlainText); +#endif +} + QTEST_MAIN(tst_qdeclarativetextedit) #include "tst_qdeclarativetextedit.moc" -- cgit v0.12 From 99390f4d639e35f3b0606df4d2abbcd3879f128f Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 12 Oct 2010 16:06:07 +1000 Subject: Compile on MSVC2008 --- src/declarative/qml/qdeclarativeengine.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index d768882..ec583f9 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -105,6 +105,7 @@ #ifdef Q_OS_WIN // for %APPDATA% #include #include +#include #define CSIDL_APPDATA 0x001a // \Application Data #endif @@ -2202,9 +2203,7 @@ bool QDeclarative_isFileCaseCorrect(const QString &fileName) #elif defined(Q_OS_WIN) wchar_t buffer[1024]; - DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); - if (rv == 0 || rv >= 1024) return true; - rv = ::GetLongPathName(buffer, buffer, 1024); + DWORD rv = ::GetLongPathName((wchar_t*)absolute.utf16(), buffer, 1024); if (rv == 0 || rv >= 1024) return true; QString canonical((QChar *)buffer); -- cgit v0.12 From 912085070b97af83a88d7de181cb0c5ef946589c Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 12 Oct 2010 17:14:15 +1000 Subject: Update QtCore def files --- src/s60installs/bwins/QtCoreu.def | 1 + src/s60installs/eabi/QtCoreu.def | 1 + 2 files changed, 2 insertions(+) diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def index 5eeb244..f4e3a28 100644 --- a/src/s60installs/bwins/QtCoreu.def +++ b/src/s60installs/bwins/QtCoreu.def @@ -4483,4 +4483,5 @@ EXPORTS ?msecsSinceReference@QElapsedTimer@@QBE_JXZ @ 4482 NONAME ; long long QElapsedTimer::msecsSinceReference(void) const ?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4483 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void) ?qt_symbian_SetupThreadHeap@@YAHHAAUSStdEpocThreadCreateInfo@@@Z @ 4484 NONAME ; int qt_symbian_SetupThreadHeap(int, struct SStdEpocThreadCreateInfo &) + ?objectNameChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4485 NONAME ; void (*QAbstractDeclarativeData::objectNameChanged)(class QAbstractDeclarativeData *, class QObject *) diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def index f496839..eb53dca 100644 --- a/src/s60installs/eabi/QtCoreu.def +++ b/src/s60installs/eabi/QtCoreu.def @@ -3712,4 +3712,5 @@ EXPORTS _ZltRK13QElapsedTimerS1_ @ 3711 NONAME _ZrsR11QDataStreamR12QEasingCurve @ 3712 NONAME _Z26qt_symbian_SetupThreadHeapiR24SStdEpocThreadCreateInfo @ 3713 NONAME + _ZN24QAbstractDeclarativeData17objectNameChangedE @ 3714 NONAME DATA 4 -- cgit v0.12 From c284a54ac24b6ff800b66c193016cc98d6305293 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 12 Oct 2010 17:14:33 +1000 Subject: Update QtDeclarative def files --- src/s60installs/bwins/QtDeclarativeu.def | 1 + src/s60installs/eabi/QtDeclarativeu.def | 1 + 2 files changed, 2 insertions(+) diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def index cf0398a..b72147e 100644 --- a/src/s60installs/bwins/QtDeclarativeu.def +++ b/src/s60installs/bwins/QtDeclarativeu.def @@ -1838,4 +1838,5 @@ EXPORTS ?addChanged@QDeclarativeBasePositioner@@IAEXXZ @ 1837 NONAME ; void QDeclarativeBasePositioner::addChanged(void) ?start@QDeclarativeAbstractAnimation@@QAEXXZ @ 1838 NONAME ; void QDeclarativeAbstractAnimation::start(void) ?qt_metacall@QDeclarativeAbstractAnimation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1839 NONAME ; int QDeclarativeAbstractAnimation::qt_metacall(enum QMetaObject::Call, int, void * *) + ?connect@QDeclarativePropertyPrivate@@SA_NPBVQObject@@H0HHPAH@Z @ 1840 NONAME ; bool QDeclarativePropertyPrivate::connect(class QObject const *, int, class QObject const *, int, int, int *) diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def index d4084cc..cbfafdc 100644 --- a/src/s60installs/eabi/QtDeclarativeu.def +++ b/src/s60installs/eabi/QtDeclarativeu.def @@ -1883,4 +1883,5 @@ EXPORTS _ZThn8_N29QDeclarativeAbstractAnimation9setTargetERK20QDeclarativeProperty @ 1882 NONAME _ZThn8_N29QDeclarativeAbstractAnimationD0Ev @ 1883 NONAME _ZThn8_N29QDeclarativeAbstractAnimationD1Ev @ 1884 NONAME + _ZN27QDeclarativePropertyPrivate7connectEPK7QObjectiS2_iiPi @ 1885 NONAME -- cgit v0.12 From 1113344ece060bb7386ea540becbf59f9c8320ea Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Fri, 8 Oct 2010 11:39:49 +0200 Subject: Crash fix when using the runtime graphics system on Symbian. If QWidget::destroy() is called (perhaps by setParent) then the window surface is deleted by the destructor of QSymbianControl instead of in the "normal" place which is ~QWidget(). This means that we should not attempt to use the RWindow in the window surface because it is in the process of being destroyed. Reviewed-by: Jani Hautakangas --- src/gui/painting/qwindowsurface_s60.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 8bac1f5..ea19fcd 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -101,9 +101,11 @@ QS60WindowSurface::~QS60WindowSurface() // Issue empty redraw to clear the UI surface QWidget *w = window(); - RWindow *const window = static_cast(w->winId()->DrawableWindow()); - window->BeginRedraw(); - window->EndRedraw(); + if (w->testAttribute(Qt::WA_WState_Created)) { + RWindow *const window = static_cast(w->winId()->DrawableWindow()); + window->BeginRedraw(); + window->EndRedraw(); + } } } #endif -- cgit v0.12 From edddadd88950f22f6d813e50acdcf2711d3d5a84 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 12 Oct 2010 10:58:11 +0200 Subject: Add support for Qt::WA_TranslucentBackground with OpenVG on Symbian^3 S^3 does not have a client side API to support semi-transparent EGL surfaces so if this flag is enabled for a particular widget, then we should return a raster surface instead of a VG surface. Raster surfaces can still be semi-transparent but will be slower to render to. Task-number: QTBUG-14400 Reviewed-by: Jani Hautakangas Reviewed-by: Gareth Stockwell Reviewed-by: Sami Merila --- src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp index 2c7c0b7..9674233 100644 --- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp +++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp @@ -42,6 +42,9 @@ #include "qgraphicssystem_vg_p.h" #include #include +#if defined(Q_OS_SYMBIAN) && !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE) +#include +#endif QT_BEGIN_NAMESPACE @@ -64,6 +67,11 @@ QPixmapData *QVGGraphicsSystem::createPixmapData(QPixmapData::PixelType type) co QWindowSurface *QVGGraphicsSystem::createWindowSurface(QWidget *widget) const { +#if defined(Q_OS_SYMBIAN) && !defined(Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE) + QWidgetPrivate *d = qt_widget_private(widget); + if (!d->isOpaque && widget->testAttribute(Qt::WA_TranslucentBackground)) + return d->createDefaultWindowSurface_sys(); +#endif return new QVGWindowSurface(widget); } -- cgit v0.12 From 825e138da5376245d7ea58e5858365524e6753d9 Mon Sep 17 00:00:00 2001 From: mread Date: Tue, 12 Oct 2010 10:13:28 +0100 Subject: Revert "Making the hybrid allocator change compatible across all 4.7.x" This reverts commit c27f1586d7c4c56af1f46fa09ad77f03b7736e5d. The change to make the hybrid allocator change compatible across all 4.7.x releases is not needed after 4.7. The exported function added for the hybrid allocator will always be present now. --- src/s60main/newallocator_hook.cpp | 87 +-------------------------------------- src/s60main/s60main.pro | 3 -- 2 files changed, 1 insertion(+), 89 deletions(-) diff --git a/src/s60main/newallocator_hook.cpp b/src/s60main/newallocator_hook.cpp index 9ea2ef0..9cc6afb 100644 --- a/src/s60main/newallocator_hook.cpp +++ b/src/s60main/newallocator_hook.cpp @@ -41,11 +41,6 @@ #include #include -#ifdef QT_EXPORTS_NOT_FROZEN -// If exports in Qt DLLs are not frozen in this build, then we have to pick up the -// allocator creation function by import link. We know the function will be present -// in the DLLs we test with, as we have to use the DLLs we have built. - struct SStdEpocThreadCreateInfo; Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); @@ -56,88 +51,8 @@ Q_CORE_EXPORT TInt qt_symbian_SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCre * Uses link-time symbol preemption to capture a call from the application * startup. On return, there is some kind of heap allocator installed on the * thread. -*/ +*/ TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) { return qt_symbian_SetupThreadHeap(aNotFirst, aInfo); } - -#else // QT_EXPORTS_NOT_FROZEN -// If we are using an export frozen build, it should be compatible with all 4.7.x Qt releases. -// We want to use the allocator creation function introduced in qtcore.dll after 4.7.1. But we -// can't import link to it, as it may not be present in whatever 4.7.x DLLs we are running with. -// So the function is found and called dynamically, by library lookup. If it is not found, we -// use the OS allocator creation functions instead. - -struct SThreadCreateInfo - { - TAny* iHandle; - TInt iType; - TThreadFunction iFunction; - TAny* iPtr; - TAny* iSupervisorStack; - TInt iSupervisorStackSize; - TAny* iUserStack; - TInt iUserStackSize; - TInt iInitialThreadPriority; - TPtrC iName; - TInt iTotalSize; // Size including any extras (must be a multiple of 8 bytes) - }; - -struct SStdEpocThreadCreateInfo : public SThreadCreateInfo - { - RAllocator* iAllocator; - TInt iHeapInitialSize; - TInt iHeapMaxSize; - TInt iPadding; // Make structure size a multiple of 8 bytes - }; - - -/* \internal - * - * Uses link-time symbol preemption to capture a call from the application - * startup. On return, there is some kind of heap allocator installed on the - * thread. -*/ -TInt UserHeap::SetupThreadHeap(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo) -{ - TInt r = KErrNone; - -#ifndef __WINS__ - // attempt to create the fast allocator through a known export ordinal in qtcore.dll - RLibrary qtcore; - if (qtcore.Load(_L("qtcore.dll")) == KErrNone) - { - const int qt_symbian_SetupThreadHeap_eabi_ordinal = 3713; - TLibraryFunction libFunc = qtcore.Lookup(qt_symbian_SetupThreadHeap_eabi_ordinal); - if (libFunc) - { - typedef int (*TSetupThreadHeapFunc)(TBool aNotFirst, SStdEpocThreadCreateInfo& aInfo); - TSetupThreadHeapFunc p_qt_symbian_SetupThreadHeap = TSetupThreadHeapFunc(libFunc); - r = (*p_qt_symbian_SetupThreadHeap)(aNotFirst, aInfo); - } - qtcore.Close(); - if (libFunc) - return r; - } -#endif - - // no fast allocator support - use default allocator creation - if (!aInfo.iAllocator && aInfo.iHeapInitialSize>0) - { - // new heap required - RHeap* pH = NULL; - r = UserHeap::CreateThreadHeap(aInfo, pH); - } - else if (aInfo.iAllocator) - { - // sharing a heap - RAllocator* pA = aInfo.iAllocator; - pA->Open(); - User::SwitchAllocator(pA); - r = KErrNone; - } - return r; -} - -#endif // QT_EXPORTS_NOT_FROZEN diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index 8ab3bd3..664f155 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -31,9 +31,6 @@ symbian { # against GCCE apps, so remove it MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA linux-armcc:QMAKE_CXXFLAGS *= --export_all_vtbl - - # Flag if exports are not frozen to avoid lookup of qtcore allocator creation function by ordinal - contains(CONFIG, def_files_disabled): DEFINES += QT_EXPORTS_NOT_FROZEN } else { error("$$_FILE_ is intended only for Symbian!") } -- cgit v0.12 From 71de6cd879f2f79900bda83cc4ba48f6df051d66 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 12 Oct 2010 12:41:26 +0300 Subject: Fix for CFbsBitmap to QPixmap conversion. Symbian bitmap formats may have different scanline length when compared to QImage formats. We need to define scanline length for intermediate QImage when converting from CFbsBitmap to QPixmap. Task-number: QTBUG-14218 Reviewed-by: Jason Barron --- src/gui/image/qpixmap_s60.cpp | 3 ++- src/openvg/qvg_symbian.cpp | 3 ++- tests/auto/qpixmap/tst_qpixmap.cpp | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 47249d9..b7c8acb 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -968,11 +968,12 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType) if (needsCopy) { TSize size = sourceBitmap->SizeInPixels(); + int bytesPerLine = sourceBitmap->ScanLineLength(size.iWidth, displayMode); QSymbianBitmapDataAccess da; da.beginDataAccess(sourceBitmap); uchar *bytes = (uchar*)sourceBitmap->DataAddress(); - QImage img = QImage(bytes, size.iWidth, size.iHeight, format); + QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format); img = img.copy(); da.endDataAccess(sourceBitmap); diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp index a9625b2..41b35fc 100644 --- a/src/openvg/qvg_symbian.cpp +++ b/src/openvg/qvg_symbian.cpp @@ -185,10 +185,11 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) QImage::Format format = qt_TDisplayMode2Format(displayMode); TSize size = bitmap->SizeInPixels(); + int bytesPerLine = bitmap->ScanLineLength(size.iWidth, displayMode); bitmap->BeginDataAccess(); uchar *bytes = (uchar*)bitmap->DataAddress(); - QImage img = QImage(bytes, size.iWidth, size.iHeight, format); + QImage img = QImage(bytes, size.iWidth, size.iHeight, bytesPerLine, format); img = img.copy(); bitmap->EndDataAccess(); diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 24cbb21..fdf8311 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -1160,6 +1160,8 @@ void tst_QPixmap::fromSymbianCFbsBitmap_data() const int smallHeight = 20; const int largeWidth = 240; const int largeHeight = 320; + const int notAlignedWidth = 250; + const int notAlignedHeight = 250; // Indexed Color Formats - Disabled since images seem to be blank -> no palette? // QTest::newRow("EGray2 small") << EGray2 << smallWidth << smallHeight << QColor(Qt::black); @@ -1172,14 +1174,19 @@ void tst_QPixmap::fromSymbianCFbsBitmap_data() // Direct Color Formats QTest::newRow("EColor4K small") << EColor4K << smallWidth << smallHeight << QColor(Qt::red); QTest::newRow("EColor4K big") << EColor4K << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor4K not aligned") << EColor4K << notAlignedWidth << notAlignedHeight << QColor(Qt::red); QTest::newRow("EColor64K small") << EColor64K << smallWidth << smallHeight << QColor(Qt::green); QTest::newRow("EColor64K big") << EColor64K << largeWidth << largeHeight << QColor(Qt::green); + QTest::newRow("EColor64K not aligned") << EColor64K << notAlignedWidth << notAlignedHeight << QColor(Qt::green); QTest::newRow("EColor16M small") << EColor16M << smallWidth << smallHeight << QColor(Qt::yellow); QTest::newRow("EColor16M big") << EColor16M << largeWidth << largeHeight << QColor(Qt::yellow); + QTest::newRow("EColor16M not aligned") << EColor16M << notAlignedWidth << notAlignedHeight << QColor(Qt::yellow); QTest::newRow("EColor16MU small") << EColor16MU << smallWidth << smallHeight << QColor(Qt::red); QTest::newRow("EColor16MU big") << EColor16MU << largeWidth << largeHeight << QColor(Qt::red); + QTest::newRow("EColor16MU not aligned") << EColor16MU << notAlignedWidth << notAlignedHeight << QColor(Qt::red); QTest::newRow("EColor16MA small opaque") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0); QTest::newRow("EColor16MA big opaque") << EColor16MA << largeWidth << largeHeight << QColor(255, 255, 0); + QTest::newRow("EColor16MA not aligned opaque") << EColor16MA << notAlignedWidth << notAlignedHeight << QColor(255, 255, 0); // Semi-transparent Colors - Disabled for now, since the QCOMPARE fails, but visually confirmed to work // QTest::newRow("EColor16MA small semi") << EColor16MA << smallWidth << smallHeight << QColor(255, 255, 0, 127); @@ -1237,6 +1244,10 @@ void tst_QPixmap::fromSymbianCFbsBitmap() QColor actualColor(image.pixel(1, 1)); QCOMPARE(actualColor, color); + + QImage shouldBe(pixmap.width(), pixmap.height(), image.format()); + shouldBe.fill(color.rgba()); + QCOMPARE(image, shouldBe); } __UHEAP_MARKEND; -- cgit v0.12 From 354246566cf86f687ee897f95586ac17b5deb35c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 12 Oct 2010 12:30:45 +0200 Subject: Fix text position with OpenGL engine and Freetype If you use the OpenGL engine, the left bearing of the glyph was incorrectly retrieved from the system as the glyph was queried with the wrong format, and adjustments for antialiasing were not applied. To make the position identical to painting with, new API was added to QFontEngine (The bounding box of a glyph is also not logically necessarily the same thing as the bounding box of the rasterized glyph.) Done-with: Trond Task-number: QTBUG-14410 --- src/gui/painting/qtextureglyphcache.cpp | 9 ++++++++- src/gui/text/qfontengine_ft.cpp | 25 +++++++++++++++++++++---- src/gui/text/qfontengine_ft_p.h | 11 +++-------- src/gui/text/qfontengine_p.h | 13 +++++++++++++ 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 9219876..78c1019 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -143,6 +143,13 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const QHash listItemCoordinates; int rowHeight = 0; + QFontEngine::GlyphFormat format; + switch (m_type) { + case Raster_A8: format = QFontEngine::Format_A8; break; + case Raster_RGBMask: format = QFontEngine::Format_A32; break; + default: format = QFontEngine::Format_Mono; break; + } + // check each glyph for its metrics and get the required rowHeight. for (int i=0; i < numGlyphs; ++i) { const glyph_t glyph = glyphs[i]; @@ -157,7 +164,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const continue; if (listItemCoordinates.contains(GlyphAndSubPixelPosition(glyph, subPixelPosition))) continue; - glyph_metrics_t metrics = fontEngine->boundingBox(glyph, m_transform); + glyph_metrics_t metrics = fontEngine->alphaMapBoundingBox(glyph, m_transform, format); #ifdef CACHE_DEBUG printf("(%4x): w=%.2f, h=%.2f, xoff=%.2f, yoff=%.2f, x=%.2f, y=%.2f\n", diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 512afc8..6991143 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -755,10 +755,10 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format) return true; } -QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph) const +QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const { Glyph *g = set->getGlyph(glyph); - if (g) + if (g && g->format == format) return g; int load_flags = FT_LOAD_DEFAULT | default_load_flags; @@ -766,6 +766,18 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph ? FT_LOAD_TARGET_LIGHT : FT_LOAD_TARGET_NORMAL; + if (format == Format_Mono) { + load_target = FT_LOAD_TARGET_MONO; + } else if (format == Format_A32) { + if (subpixelType == QFontEngineFT::Subpixel_RGB || subpixelType == QFontEngineFT::Subpixel_BGR) { + if (default_hint_style == HintFull) + load_target = FT_LOAD_TARGET_LCD; + } else if (subpixelType == QFontEngineFT::Subpixel_VRGB || subpixelType == QFontEngineFT::Subpixel_VBGR) { + if (default_hint_style == HintFull) + load_target = FT_LOAD_TARGET_LCD_V; + } + } + if (set->outline_drawing) load_flags = FT_LOAD_NO_BITMAP; @@ -1767,6 +1779,11 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph) glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph, const QTransform &matrix) { + return alphaMapBoundingBox(glyph, matrix, QFontEngine::Format_None); +} + +glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, const QTransform &matrix, QFontEngine::GlyphFormat format) +{ FT_Face face = 0; glyph_metrics_t overall; QGlyphSet *glyphSet = 0; @@ -1810,9 +1827,9 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph, const QTransform &matr glyphSet = &defaultGlyphSet; } Glyph * g = glyphSet->getGlyph(glyph); - if (!g) { + if (!g || g->format != format) { face = lockFace(); - g = loadGlyphMetrics(glyphSet, glyph); + g = loadGlyphMetrics(glyphSet, glyph, format); } if (g) { diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 72f7d9f..1a1cadb 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -130,13 +130,6 @@ private: class Q_GUI_EXPORT QFontEngineFT : public QFontEngine { public: - enum GlyphFormat { - Format_None, - Format_Render = Format_None, - Format_Mono, - Format_A8, - Format_A32 - }; /* we don't cache glyphs that are too large anyway, so we can make this struct rather small */ struct Glyph { @@ -242,6 +235,8 @@ private: virtual void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const; virtual QImage alphaMapForGlyph(glyph_t); virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t); + virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, const QTransform &matrix, + QFontEngine::GlyphFormat format); virtual void removeGlyphFromCache(glyph_t glyph); virtual int glyphCount() const; @@ -311,7 +306,7 @@ protected: bool embeddedbitmap; private: - QFontEngineFT::Glyph *loadGlyphMetrics(QGlyphSet *set, uint glyph) const; + QFontEngineFT::Glyph *loadGlyphMetrics(QGlyphSet *set, uint glyph, GlyphFormat format) const; GlyphFormat defaultFormat; FT_Matrix matrix; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index d07c8c9..d1ec4c1 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -120,6 +120,14 @@ public: TestFontEngine = 0x1000 }; + enum GlyphFormat { + Format_None, + Format_Render = Format_None, + Format_Mono, + Format_A8, + Format_A32 + }; + QFontEngine(); virtual ~QFontEngine(); @@ -191,6 +199,11 @@ public: virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t); virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t); + virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, const QTransform &matrix, GlyphFormat /*format*/) + { + return boundingBox(glyph, matrix); + } + virtual void removeGlyphFromCache(glyph_t); virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) = 0; -- cgit v0.12 From 61d23b1740780b3c7970c9dd5d089002a35f339e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 Oct 2010 13:01:42 +0200 Subject: Fix memory leak in QFontEngineS60::addGlyphsToPath() An "Open()"ed RGlyphOutlineIterator needs to be "Close()"d before destroying the iterator. Otherwise some allocated memory does not get freed. The RGlyphOutlineIterator destructor does not close an open iterator. Task-Number: QTBUG-14408 Done-by: Colleague from Nokia, Oulu Reviewed-by: Alessandro Portale --- src/gui/text/qfontengine_s60.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 5980f20..653965e 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -308,6 +308,7 @@ void QFontEngineS60::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, parseGlyphPathData(outlineChar, outlineEnd, *path, fontSizeInPixels, positions[count++].toPointF(), false); } while(KErrNone == iterator.Next() && count <= nglyphs); + iterator.Close(); #else // Q_SYMBIAN_HAS_GLYPHOUTLINE_API QFontEngine::addGlyphsToPath(glyphs, positions, nglyphs, path, flags); #endif //Q_SYMBIAN_HAS_GLYPHOUTLINE_API -- cgit v0.12 From 7cd0a90344d340f22b6b2d3afeef092dbaf2cd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 12 Oct 2010 12:54:15 +0200 Subject: Revert "Don't define highp/mediump/lowp if desktop GL has them" This reverts commit 6155050f68cc86c445552da61a5f240c16f5e2cd. The GL_ARB_ES2_compatibility extension does not mention the lowp, mediump or highp keywords. Task-number: QTBUG-14384 Reviewed-by: Samuel Reviewed-by: Prasanth --- dist/changes-4.6.4 | 4 +--- src/opengl/qgl.cpp | 3 --- src/opengl/qgl_p.h | 3 +-- src/opengl/qglshaderprogram.cpp | 10 ++-------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/dist/changes-4.6.4 b/dist/changes-4.6.4 index 389aa3a..3949b9a 100644 --- a/dist/changes-4.6.4 +++ b/dist/changes-4.6.4 @@ -66,8 +66,6 @@ QtOpenGL - QGLShaderProgram * [QTBUG-12478] Don't resolve GLSL extensions if no shaders. * [QTBUG-12591] setUniformValue(QSize) was setting (w,w) not (w,h). - * [QTBUG-12862] Don't #define highp/mediump/lowp if the desktop OpenGL - implementation has the GL_ARB_ES2_compatibility extension. * [QTBUG-12554] Wrong OpenGLVersionFlags on OpenGL 4.0 systems. QtScript @@ -109,7 +107,7 @@ Third party components Qt for Unix (X11 and Mac OS X) ------------------------------ - - + - Qt for Linux/X11 ---------------- diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 9e74e04..7f25887 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5264,8 +5264,6 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= FragmentShader; if (extensions.match("GL_ARB_shader_objects")) glExtensions |= FragmentShader; - if (extensions.match("GL_ARB_ES2_compatibility")) - glExtensions |= ES2Compatibility; if (extensions.match("GL_ARB_texture_mirrored_repeat")) glExtensions |= MirroredRepeat; if (extensions.match("GL_EXT_framebuffer_object")) @@ -5286,7 +5284,6 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= FramebufferObject; glExtensions |= GenerateMipmap; glExtensions |= FragmentShader; - glExtensions |= ES2Compatibility; #endif #if defined(QT_OPENGL_ES_1) if (extensions.match("GL_OES_framebuffer_object")) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 623eeaf..387c8f7 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -284,8 +284,7 @@ public: DDSTextureCompression = 0x00008000, ETC1TextureCompression = 0x00010000, PVRTCTextureCompression = 0x00020000, - FragmentShader = 0x00040000, - ES2Compatibility = 0x00080000 + FragmentShader = 0x00040000 }; Q_DECLARE_FLAGS(Extensions, Extension) diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index bc1c009..74382b0 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -97,10 +97,6 @@ QT_BEGIN_NAMESPACE to just features that are present in GLSL/ES, and avoid standard variable names that only work on the desktop. - If the \c{GL_ARB_ES2_compatibility} extension is present, - then the above prefix is not added because the desktop OpenGL - implementation supports precision qualifiers. - \section1 Simple shader example \snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 1 @@ -398,10 +394,8 @@ bool QGLShader::compileSourceCode(const char *source) srclen.append(GLint(headerLen)); } #ifdef QGL_DEFINE_QUALIFIERS - if (!(QGLExtensions::glExtensions() & QGLExtensions::ES2Compatibility)) { - src.append(qualifierDefines); - srclen.append(GLint(sizeof(qualifierDefines) - 1)); - } + src.append(qualifierDefines); + srclen.append(GLint(sizeof(qualifierDefines) - 1)); #endif #ifdef QGL_REDEFINE_HIGHP if (d->shaderType == Fragment) { -- cgit v0.12 From ab057be7228d20d909246183505b72e821cc440f Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 Oct 2010 14:00:38 +0200 Subject: Remove unnecessary calls to GetHorizBounds() + boundingBox() QFontEngineS60::boundingBox_const(): The metrics that CFont::getCharacterData() returns is equivalent to what TOpenFontCharMetrics::GetHorizBounds() returns. So, remove the use of TRect glyphBounds, and TOpenFontCharMetrics::GetHorizBounds(). Implementation of TOpenFontCharMetrics::GetHorizBounds(): http://developer.symbian.org/oss/API_REF/Public_API/file/837f303aceeb/epoc32/include/openfont.h#l1352 QRasterPaintEngine::drawGlyphsS60(): The metrics that QFontEngineS60::getCharacterData() returns are equivalent to what QFontEngineS60::boundingBox() returns. So, remove the use of glyph_metrics_t metrics, and QFontEngineS60::boundingBox(). These changes increase the Fps in qt\tests\manual\textrendering\textperformance "Latin" from 16.2 to 16.5 Fps on an XM5800. And they do that by removing code :) Task-number: QTBUG-14378 Reviewed-by: Jason Barron --- src/gui/painting/qpaintengine_raster.cpp | 6 ++---- src/gui/text/qfontengine_s60.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 9749244..c92d291 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3164,10 +3164,8 @@ void QRasterPaintEngine::drawGlyphsS60(const QPointF &p, const QTextItemInt &ti) const TUint8 *glyphBitmapBytes; TSize glyphBitmapSize; fe->getCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize); - const glyph_metrics_t metrics = ti.fontEngine->boundingBox(glyphs[i]); - const int x = qFloor(positions[i].x + metrics.x + aliasDelta); - const int y = qFloor(positions[i].y + metrics.y + aliasDelta); - + const int x = qFloor(positions[i].x + tmetrics.HorizBearingX() + aliasDelta); + const int y = qFloor(positions[i].y - tmetrics.HorizBearingY() + aliasDelta); alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight); } diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 653965e..32fcb82 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -360,13 +360,11 @@ glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const const TUint8 *glyphBitmapBytes; TSize glyphBitmapSize; getCharacterData(glyph, metrics, glyphBitmapBytes, glyphBitmapSize); - TRect glyphBounds; - metrics.GetHorizBounds(glyphBounds); const glyph_metrics_t result( - glyphBounds.iTl.iX, - glyphBounds.iTl.iY, - glyphBounds.Width(), - glyphBounds.Height(), + metrics.HorizBearingX(), + -metrics.HorizBearingY(), + metrics.Width(), + metrics.Height(), metrics.HorizAdvance(), 0 ); -- cgit v0.12 From ea5281e6cd1ebc63e080f7232d4eb28f1610539e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 Oct 2010 14:18:54 +0200 Subject: Implement QFontEngineS60::emSquareSize() Some glyph position tweaks during the shaping phase require the "Units per Em" information for the font. QFontEngineS60 did not reimplement emSquareSize(), therefore, some combined glyphs were rendered incorrectly (see QTBUG-10725) This patch implements QFontEngineS60::emSquareSize() Since Symbian does not provide the "Units per Em" via public Api, we have to pick that out of the 'head' font table. The value is cached per font. Task-Number: QTBUG-10725 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_s60.cpp | 26 ++++++++++++++++++++++++++ src/gui/text/qfontengine_s60_p.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 32fcb82..824a8e2 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -41,6 +41,7 @@ #include "qfontengine_s60_p.h" #include "qtextengine_p.h" +#include "qendian.h" #include "qglobal.h" #include #include "qimage.h" @@ -176,6 +177,24 @@ CFont *QSymbianTypeFaceExtras::fontOwner() const return m_cFont; } +QFixed QSymbianTypeFaceExtras::unitsPerEm() const +{ + if (m_unitsPerEm.value() != 0) + return m_unitsPerEm; + const QByteArray head = getSfntTable(MAKE_TAG('h', 'e', 'a', 'd')); + const int unitsPerEmOffset = 18; + if (head.size() > unitsPerEmOffset + sizeof(quint16)) { + const uchar* tableData = reinterpret_cast(head.constData()); + const uchar* unitsPerEm = tableData + unitsPerEmOffset; + m_unitsPerEm = qFromBigEndian(unitsPerEm); + } else { + // Bitmap font? Corrupt font? + // We return -1 and let the QFontEngineS60 return the pixel size. + m_unitsPerEm = -1; + } + return m_unitsPerEm; +} + // duplicated from qfontengine_xyz.cpp static inline unsigned int getChar(const QChar *str, int &i, const int len) { @@ -248,6 +267,13 @@ QFontEngineS60::~QFontEngineS60() releaseFont(m_scaledFont); } +QFixed QFontEngineS60::emSquareSize() const +{ + const QFixed unitsPerEm = m_extras->unitsPerEm(); + return unitsPerEm.toInt() == -1 ? + QFixed::fromReal(m_originalFontSizeInPixels) : unitsPerEm; +} + bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const { if (*nglyphs < len) { diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index d05c23c..c65ce55 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -82,11 +82,13 @@ public: const uchar *cmap() const; CFont *fontOwner() const; bool isSymbolCMap() const; + QFixed unitsPerEm() const; private: CFont* m_cFont; mutable bool m_symbolCMap; mutable QByteArray m_cmapTable; + mutable QFixed m_unitsPerEm; #ifndef Q_SYMBIAN_HAS_FONTTABLE_API COpenFont *m_openFont; mutable MOpenFontTrueTypeExtension *m_trueTypeExtension; @@ -99,6 +101,7 @@ public: QFontEngineS60(const QFontDef &fontDef, const QSymbianTypeFaceExtras *extras); ~QFontEngineS60(); + QFixed emSquareSize() const; bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const; void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const; -- cgit v0.12 From 0b3402f2ff0db1de747e9d38021a5c9300c8a011 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 12 Oct 2010 15:33:44 +0300 Subject: Added bearer plugin deployment to qt.iby Reviewed-by: TrustMe --- src/s60installs/qt.iby | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index b6cdce9..4afbf05 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -53,6 +53,9 @@ file=ABI_DIR\BUILD_DIR\qaudio.dll SHARED_LIB_DIR\qaudio.dll file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll SHARED_LIB_DIR\qvggraphicssystem.dll file=ABI_DIR\BUILD_DIR\qglgraphicssystem.dll SHARED_LIB_DIR\qglgraphicssystem.dll +// bearer +file=ABI_DIR\BUILD_DIR\qsymbianbearer.dll SHARED_LIB_DIR\qsymbianbearer.dll + // S60 version compatibility plugins for 5.0 (3.1 and 3.2 devices are never likely to have this in ROM, // so don't bother including those plugins file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll @@ -99,6 +102,9 @@ data=\epoc32\data\qt\qtlibspluginstubs\qaudio.qtplugin resource\qt\plugins\audio data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin +// bearer stub +data=\epoc32\data\z\resource\qt\plugins\bearer\qsymbianbearer.qtplugin resource\qt\plugins\bearer\qsymbianbearer.qtplugin + // Stub sis file data=ZSYSTEM\install\qt_stub.sis System\Install\qt_stub.sis data=ZSYSTEM\install\qtwebkit_stub.sis System\Install\qtwebkit_stub.sis -- cgit v0.12 From e39f273b921a36b307b2b2adddd7135f0c5a8858 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 12 Oct 2010 14:39:12 +0200 Subject: Delete qtdemoapps.iby. This file was used to deploy certain Qt demo applications to a Symbian ROM image and was always being exported to the epoc32 tree when Qt was compiled. This doesn't make sense since these will never (hopefully) be deployed on any real device. If someone wants demo apps deployed, they should create their own IBY file. Reviewed-by: Shane Kearns Reviewed-by: Miikka Heikkinen --- src/s60installs/qtdemoapps.iby | 15 --------------- src/s60installs/s60installs.pro | 1 - 2 files changed, 16 deletions(-) delete mode 100644 src/s60installs/qtdemoapps.iby diff --git a/src/s60installs/qtdemoapps.iby b/src/s60installs/qtdemoapps.iby deleted file mode 100644 index d888135..0000000 --- a/src/s60installs/qtdemoapps.iby +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef QTDEMOAPPS_IBY -#define QTDEMOAPPS_IBY - -// A subset of Qt demo & example applications - -// Note that star requires OpenVG and the Qt OpenVG paint engine -S60_APP_EXE(star) -S60_APP_RESOURCE(star) -data=\epoc32\data\Z\private\10003a3f\import\Apps\star_reg.rsc \private\10003a3f\import\apps\star_reg.rsc - -S60_APP_EXE(wiggly) -S60_APP_RESOURCE(wiggly) -data=\epoc32\data\Z\private\10003a3f\import\Apps\wiggly_reg.rsc \private\10003a3f\import\apps\wiggly_reg.rsc - -#endif // QTDEMOAPPS_IBY diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index c73ed06..d63b97c 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -200,5 +200,4 @@ symbian: { } BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" - BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CUSTOMER_VARIANT_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)" } -- cgit v0.12 From 92fb7e405a93785af162e5dff0a6b2a2d40060bc Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 Oct 2010 16:27:31 +0200 Subject: Optimize QFontEngineS60::recalcAdvances() (Addition to ab057be7228d20d909246183505b72e821cc440f) Instead of using a glyph_metrics_t (which gets filled with data from a TOpenFontCharMetrics), we use a TOpenFontCharMetrics, directly. Also, the advances_y gets set to 0. Like on the other platforms. These change increases the Fps in qt\tests\manual\textrendering\textperformance "Latin" from 16.5 to 16.6 Fps on an XM5800. I am sure that I can construct a benchmark where the speed gain is bigger. Task-number: QTBUG-14378 Reviewed-by: TrustMe --- src/gui/text/qfontengine_s60.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 824a8e2..3705136 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -303,10 +303,13 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const { Q_UNUSED(flags); + TOpenFontCharMetrics metrics; + const TUint8 *glyphBitmapBytes; + TSize glyphBitmapSize; for (int i = 0; i < glyphs->numGlyphs; i++) { - const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]); - glyphs->advances_x[i] = bbox.xoff; - glyphs->advances_y[i] = bbox.yoff; + getCharacterData(glyphs->glyphs[i], metrics, glyphBitmapBytes, glyphBitmapSize); + glyphs->advances_x[i] = metrics.HorizAdvance(); + glyphs->advances_y[i] = 0; } } -- cgit v0.12 From 7d21b598d299ee61d61f15c69b41b8b38daf9bea Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 12 Oct 2010 22:55:20 +0200 Subject: Remove obsolete tweak in QFontEngineS60::alphaMapForGlyph On some Symbian versions (apparently <= Symbian^1), CFont::GetCharacterData() returns 8-bit data with gray values 0x00, 0x10 ... 0xe0, 0xf0 due to a bug. The glyphs are nowhere perfectly opaque, which is bad for blitting. This has been however been fixed for Symbian^3. The funny thing about this tweak was that it was only executed on Symbian^3 (with the OpenVG/OpenGL paintengines). On Symbian^1 and below (rasterpaintengine), QFontEngineS60::alphaMapForGlyph() does not get called at all, anymore. Therefore, the removal of this tweak should not be noticable anywhere, except that on Symbian^3, quite a few CPU cycles are now saved. See the attachments in QTBUG-14419 for details. Task-Number: QTBUG-14419 Reviewed-By: TrustMe --- src/gui/text/qfontengine_s60.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 3705136..bf30e1c 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -345,29 +345,17 @@ void QFontEngineS60::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, QImage QFontEngineS60::alphaMapForGlyph(glyph_t glyph) { + // Note: On some Symbian versions (apparently <= Symbian^1), this + // function will return gray values 0x00, 0x10 ... 0xe0, 0xf0 due + // to a bug. The glyphs are nowhere perfectly opaque. + // This has been fixed for Symbian^3. + TOpenFontCharMetrics metrics; const TUint8 *glyphBitmapBytes; TSize glyphBitmapSize; getCharacterData(glyph, metrics, glyphBitmapBytes, glyphBitmapSize); QImage result(glyphBitmapBytes, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight, glyphBitmapSize.iWidth, QImage::Format_Indexed8); result.setColorTable(grayPalette()); - - // The above setColorTable() call detached the image data anyway, so why not shape tha data a bit, while we can. - // CFont::GetCharacterData() returns 8-bit data that obviously was 4-bit data before, and converted to 8-bit incorrectly. - // The data values are 0x00, 0x10 ... 0xe0, 0xf0. So, a real opaque 0xff is never reached, which we get punished - // for every time we want to blit this glyph in the raster paint engine. - // "Fix" is to convert all 0xf0 to 0xff. Is fine, quality wise, and I assume faster than correcting all values. - // Blitting is however, evidentially faster now. - const int bpl = result.bytesPerLine(); - for (int row = 0; row < result.height(); ++row) { - uchar *scanLine = result.scanLine(row); - for (int column = 0; column < bpl; ++column) { - if (*scanLine == 0xf0) - *scanLine = 0xff; - scanLine++; - } - } - return result; } -- cgit v0.12 From a311b854e0886f0498c068af5b489af36a96b845 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 13 Oct 2010 10:52:16 +1000 Subject: Compile on WinCE --- src/declarative/qml/qdeclarativeengine.cpp | 4 ++-- .../declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 4 ++-- .../qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index ec583f9..8e1416e 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -2193,14 +2193,14 @@ const QMetaObject *QDeclarativeEnginePrivate::metaObjectForType(int t) const bool QDeclarative_isFileCaseCorrect(const QString &fileName) { -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) QFileInfo info(fileName); QString absolute = info.absoluteFilePath(); #if defined(Q_OS_MAC) QString canonical = info.canonicalFilePath(); -#elif defined(Q_OS_WIN) +#elif defined(Q_OS_WIN32) wchar_t buffer[1024]; DWORD rv = ::GetLongPathName((wchar_t*)absolute.utf16(), buffer, 1024); diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index be04dee..061ac48 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -387,7 +387,7 @@ void tst_qdeclarativelanguage::errors_data() QTest::newRow("singularProperty") << "singularProperty.qml" << "singularProperty.errors.txt" << false; QTest::newRow("singularProperty.2") << "singularProperty.2.qml" << "singularProperty.2.errors.txt" << false; QTest::newRow("incorrectCase") << "incorrectCase.qml" -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) << "incorrectCase.errors.insensitive.txt" #else << "incorrectCase.errors.sensitive.txt" @@ -1784,7 +1784,7 @@ void tst_qdeclarativelanguage::importIncorrectCase() QList errors = component.errors(); QCOMPARE(errors.count(), 1); -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) QString expectedError = QLatin1String("cannot load module \"com.Nokia.installedtest\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("data/lib/com/Nokia/installedtest/qmldir") + QLatin1String("\""); #else QString expectedError = QLatin1String("module \"com.Nokia.installedtest\" is not installed"); diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp index 51f66a5..85fa718 100644 --- a/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp +++ b/tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp @@ -131,10 +131,10 @@ void tst_qdeclarativemoduleplugin::incorrectPluginCase() QList errors = component.errors(); QCOMPARE(errors.count(), 1); -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) +#if defined(Q_OS_MAC) || defined(Q_OS_WIN32) #if defined(Q_OS_MAC) QString libname = "libPluGin.dylib"; -#elif defined(Q_OS_WIN) +#elif defined(Q_OS_WIN32) QString libname = "PluGin.dll"; #endif QString expectedError = QLatin1String("plugin cannot be loaded for module \"com.nokia.WrongCase\": File name case mismatch for \"") + QFileInfo(__FILE__).absoluteDir().filePath("imports/com/nokia/WrongCase/" + libname) + QLatin1String("\""); -- cgit v0.12 From 2553ca41a05afb28e49d813a1aebed12474f6b00 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 13 Oct 2010 14:55:07 +1000 Subject: Remove debug code added by 650a0078e2cef43eff107fe8d2505f64a0bfedf0 Task-number: QT-4093 --- .../auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index 7a58773..2649c0d 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -989,9 +989,6 @@ void tst_QDeclarativeListView::sections() listview->setContentY(0); model.modifyItem(0, "changed", "2"); - canvas->show(); - qApp->exec(); - item = findItem(contentItem, "wrapper", 1); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 40.0); -- cgit v0.12 From cdcc5bc1a82b70d27752370d83b4b21c912f6153 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 13 Oct 2010 15:01:19 +1000 Subject: Fix alignment bugs in Text element Task-number: QTBUG-14374 --- src/declarative/graphicsitems/qdeclarativetext.cpp | 961 +++++++++++---------- .../graphicsitems/qdeclarativetext_p_p.h | 48 +- 2 files changed, 526 insertions(+), 483 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 54cb062..308aefa 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -85,12 +85,13 @@ private: DEFINE_BOOL_CONFIG_OPTION(enableImageCache, QML_ENABLE_TEXT_IMAGE_CACHE); QDeclarativeTextPrivate::QDeclarativeTextPrivate() -: color((QRgb)0), style(QDeclarativeText::Normal), - hAlign(QDeclarativeText::AlignLeft), vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone), - imgDirty(true), dirty(true), richText(false), singleline(false), cache(true), internalWidthUpdate(false), doc(0), - format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap) +: color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft), + vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone), + format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap), imageCacheDirty(true), + updateOnComponentComplete(true), richText(false), singleline(false), cacheAllTextAsImage(true), + internalWidthUpdate(false), doc(0) { - cache = enableImageCache(); + cacheAllTextAsImage = enableImageCache(); QGraphicsItemPrivate::acceptedMouseButtons = Qt::LeftButton; QGraphicsItemPrivate::flags = QGraphicsItemPrivate::flags & ~QGraphicsItem::ItemHasNoContents; } @@ -151,7 +152,6 @@ void QTextDocumentWithImageResources::requestFinished() #endif QDeclarativeTextPrivate *d = QDeclarativeTextPrivate::get(textItem); d->updateLayout(); - d->markImgDirty(); } } @@ -172,6 +172,382 @@ void QTextDocumentWithImageResources::setText(const QString &text) QSet QTextDocumentWithImageResources::errors; +QDeclarativeTextPrivate::~QDeclarativeTextPrivate() +{ +} + +void QDeclarativeTextPrivate::updateLayout() +{ + Q_Q(QDeclarativeText); + if (!q->isComponentComplete()) { + updateOnComponentComplete = true; + return; + } + + // Setup instance of QTextLayout for all cases other than richtext + if (!richText) { + layout.clearLayout(); + layout.setFont(font); + if (format != QDeclarativeText::StyledText) { + QString tmp = text; + tmp.replace(QLatin1Char('\n'), QChar::LineSeparator); + singleline = !tmp.contains(QChar::LineSeparator); + if (singleline && elideMode != QDeclarativeText::ElideNone && q->widthValid()) { + QFontMetrics fm(font); + tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width()); // XXX still worth layout...? + } + layout.setText(tmp); + } else { + singleline = false; + QDeclarativeStyledText::parse(text, layout); + } + } + + updateSize(); +} + +void QDeclarativeTextPrivate::updateSize() +{ + Q_Q(QDeclarativeText); + + if (!q->isComponentComplete()) { + updateOnComponentComplete = true; + return; + } + + invalidateImageCache(); + + QFontMetrics fm(font); + if (text.isEmpty()) { + q->setImplicitHeight(fm.height()); + emit q->paintedSizeChanged(); + return; + } + + int dy = q->height(); + QSize size(0, 0); + + //setup instance of QTextLayout for all cases other than richtext + if (!richText) { + size = setupTextLayout(); + if (layedOutTextSize != size) { + q->prepareGeometryChange(); + layedOutTextSize = size; + } + dy -= size.height(); + } else { + singleline = false; // richtext can't elide or be optimized for single-line case + ensureDoc(); + doc->setDefaultFont(font); + QTextOption option((Qt::Alignment)int(hAlign | vAlign)); + option.setWrapMode(QTextOption::WrapMode(wrapMode)); + doc->setDefaultTextOption(option); + if (wrapMode != QDeclarativeText::NoWrap && q->widthValid()) + doc->setTextWidth(q->width()); + else + doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug) + dy -= (int)doc->size().height(); + QSize dsize = doc->size().toSize(); + if (dsize != layedOutTextSize) { + q->prepareGeometryChange(); + layedOutTextSize = dsize; + } + size = QSize(int(doc->idealWidth()),dsize.height()); + } + int yoff = 0; + + if (q->heightValid()) { + if (vAlign == QDeclarativeText::AlignBottom) + yoff = dy; + else if (vAlign == QDeclarativeText::AlignVCenter) + yoff = dy/2; + } + q->setBaselineOffset(fm.ascent() + yoff); + + //### need to comfirm cost of always setting these for richText + internalWidthUpdate = true; + q->setImplicitWidth(size.width()); + internalWidthUpdate = false; + q->setImplicitHeight(size.height()); + emit q->paintedSizeChanged(); +} + +/*! + Lays out the QDeclarativeTextPrivate::layout QTextLayout in the constraints of the QDeclarativeText. + + Returns the size of the final text. This can be used to position the text vertically (the text is + already absolutely positioned horizontally). +*/ +QSize QDeclarativeTextPrivate::setupTextLayout() +{ + // ### text layout handling should be profiled and optimized as needed + // what about QStackTextEngine engine(tmp, d->font.font()); QTextLayout textLayout(&engine); + + Q_Q(QDeclarativeText); + layout.setCacheEnabled(true); + + int height = 0; + qreal widthUsed = 0; + qreal lineWidth = 0; + + //set manual width + if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid()) + lineWidth = q->width(); + + QTextOption textOption = layout.textOption(); + textOption.setWrapMode(QTextOption::WrapMode(wrapMode)); + layout.setTextOption(textOption); + + layout.beginLayout(); + while (1) { + QTextLine line = layout.createLine(); + if (!line.isValid()) + break; + + if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid()) + line.setLineWidth(lineWidth); + } + layout.endLayout(); + + for (int i = 0; i < layout.lineCount(); ++i) { + QTextLine line = layout.lineAt(i); + widthUsed = qMax(widthUsed, line.naturalTextWidth()); + } + + qreal layoutWidth = q->widthValid()?q->width():widthUsed; + + int x = 0; + for (int i = 0; i < layout.lineCount(); ++i) { + QTextLine line = layout.lineAt(i); + line.setPosition(QPointF(0, height)); + height += int(line.height()); + + if (!cacheAllTextAsImage) { + if (hAlign == QDeclarativeText::AlignLeft) { + x = 0; + } else if (hAlign == QDeclarativeText::AlignRight) { + x = layoutWidth - (int)line.naturalTextWidth(); + } else if (hAlign == QDeclarativeText::AlignHCenter) { + x = (layoutWidth - (int)line.naturalTextWidth()) / 2; + } + line.setPosition(QPoint(x, (int)line.y())); + } + } + + return QSize(qCeil(widthUsed), height); +} + +/*! + Returns a painted version of the QDeclarativeTextPrivate::layout QTextLayout. + If \a drawStyle is true, the style color overrides all colors in the document. +*/ +QPixmap QDeclarativeTextPrivate::textLayoutImage(bool drawStyle) +{ + //do layout + QSize size = layedOutTextSize; + + int x = 0; + for (int i = 0; i < layout.lineCount(); ++i) { + QTextLine line = layout.lineAt(i); + if (hAlign == QDeclarativeText::AlignLeft) { + x = 0; + } else if (hAlign == QDeclarativeText::AlignRight) { + x = size.width() - (int)line.naturalTextWidth(); + } else if (hAlign == QDeclarativeText::AlignHCenter) { + x = (size.width() - (int)line.naturalTextWidth()) / 2; + } + line.setPosition(QPoint(x, (int)line.y())); + } + + //paint text + QPixmap img(size); + if (!size.isEmpty()) { + img.fill(Qt::transparent); +#ifdef Q_WS_MAC + bool oldSmooth = qt_applefontsmoothing_enabled; + qt_applefontsmoothing_enabled = false; +#endif + QPainter p(&img); +#ifdef Q_WS_MAC + qt_applefontsmoothing_enabled = oldSmooth; +#endif + drawTextLayout(&p, QPointF(0,0), drawStyle); + } + return img; +} + +/*! + Paints the QDeclarativeTextPrivate::layout QTextLayout into \a painter at \a pos. If + \a drawStyle is true, the style color overrides all colors in the document. +*/ +void QDeclarativeTextPrivate::drawTextLayout(QPainter *painter, const QPointF &pos, bool drawStyle) +{ + if (drawStyle) + painter->setPen(styleColor); + else + painter->setPen(color); + painter->setFont(font); + layout.draw(painter, pos); +} + +/*! + Returns a painted version of the QDeclarativeTextPrivate::doc QTextDocument. + If \a drawStyle is true, the style color overrides all colors in the document. +*/ +QPixmap QDeclarativeTextPrivate::textDocumentImage(bool drawStyle) +{ + QSize size = doc->size().toSize(); + + //paint text + QPixmap img(size); + img.fill(Qt::transparent); +#ifdef Q_WS_MAC + bool oldSmooth = qt_applefontsmoothing_enabled; + qt_applefontsmoothing_enabled = false; +#endif + QPainter p(&img); +#ifdef Q_WS_MAC + qt_applefontsmoothing_enabled = oldSmooth; +#endif + + QAbstractTextDocumentLayout::PaintContext context; + + QTextOption oldOption(doc->defaultTextOption()); + if (drawStyle) { + context.palette.setColor(QPalette::Text, styleColor); + QTextOption colorOption(doc->defaultTextOption()); + colorOption.setFlags(QTextOption::SuppressColors); + doc->setDefaultTextOption(colorOption); + } else { + context.palette.setColor(QPalette::Text, color); + } + doc->documentLayout()->draw(&p, context); + if (drawStyle) + doc->setDefaultTextOption(oldOption); + return img; +} + +/*! + Mark the image cache as dirty. +*/ +void QDeclarativeTextPrivate::invalidateImageCache() +{ + Q_Q(QDeclarativeText); + + if (imageCacheDirty) + return; + + imageCacheDirty = true; + imageCache = QPixmap(); + + if (q->isComponentComplete()) + q->update(); +} + +/*! + Tests if the image cache is dirty, and repaints it if it is. +*/ +void QDeclarativeTextPrivate::checkImageCache() +{ + if (!imageCacheDirty) + return; + + if (text.isEmpty()) { + + imageCache = QPixmap(); + + } else { + + QPixmap textImage; + QPixmap styledImage; + + if (richText) { + textImage = textDocumentImage(false); + if (style != QDeclarativeText::Normal) + styledImage = textDocumentImage(true); //### should use styleColor + } else { + textImage = textLayoutImage(false); + if (style != QDeclarativeText::Normal) + styledImage = textLayoutImage(true); //### should use styleColor + } + + switch (style) { + case QDeclarativeText::Outline: + imageCache = drawOutline(textImage, styledImage); + break; + case QDeclarativeText::Sunken: + imageCache = drawOutline(textImage, styledImage, -1); + break; + case QDeclarativeText::Raised: + imageCache = drawOutline(textImage, styledImage, 1); + break; + default: + imageCache = textImage; + break; + } + + } + + imageCacheDirty = false; +} + +/*! + Ensures the QDeclarativeTextPrivate::doc variable is set to a valid text document +*/ +void QDeclarativeTextPrivate::ensureDoc() +{ + if (!doc) { + Q_Q(QDeclarativeText); + doc = new QTextDocumentWithImageResources(q); + doc->setDocumentMargin(0); + } +} + +/*! + Draw \a styleSource as an outline around \a source and return the new image. +*/ +QPixmap QDeclarativeTextPrivate::drawOutline(const QPixmap &source, const QPixmap &styleSource) +{ + QPixmap img = QPixmap(styleSource.width() + 2, styleSource.height() + 2); + img.fill(Qt::transparent); + + QPainter ppm(&img); + + QPoint pos(0, 0); + pos += QPoint(-1, 0); + ppm.drawPixmap(pos, styleSource); + pos += QPoint(2, 0); + ppm.drawPixmap(pos, styleSource); + pos += QPoint(-1, -1); + ppm.drawPixmap(pos, styleSource); + pos += QPoint(0, 2); + ppm.drawPixmap(pos, styleSource); + + pos += QPoint(0, -1); + ppm.drawPixmap(pos, source); + ppm.end(); + + return img; +} + +/*! + Draw \a styleSource below \a source at \a yOffset and return the new image. +*/ +QPixmap QDeclarativeTextPrivate::drawOutline(const QPixmap &source, const QPixmap &styleSource, int yOffset) +{ + QPixmap img = QPixmap(styleSource.width() + 2, styleSource.height() + 2); + img.fill(Qt::transparent); + + QPainter ppm(&img); + + ppm.drawPixmap(QPoint(0, yOffset), styleSource); + ppm.drawPixmap(0, 0, source); + + ppm.end(); + + return img; +} + /*! \qmlclass Text QDeclarativeText \ingroup qml-basic-visual-elements @@ -211,10 +587,44 @@ QDeclarativeText::~QDeclarativeText() { } +/*! + \qmlproperty bool Text::clip + This property holds whether the text is clipped. -QDeclarativeTextPrivate::~QDeclarativeTextPrivate() -{ -} + Note that if the text does not fit in the bounding rectangle it will be abruptly chopped. + + If you want to display potentially long text in a limited space, you probably want to use \c elide instead. +*/ + +/*! + \qmlproperty bool Text::smooth + + This property holds whether the text is smoothly scaled or transformed. + + Smooth filtering gives better visual quality, but is slower. If + the item is displayed at its natural size, this property has no visual or + performance effect. + + \note Generally scaling artifacts are only visible if the item is stationary on + the screen. A common pattern when animating an item is to disable smooth + filtering at the beginning of the animation and reenable it at the conclusion. +*/ + +/*! + \qmlsignal Text::onLinkActivated(string link) + + This handler is called when the user clicks on a link embedded in the text. + The link must be in rich text or HTML format and the + \a link string provides access to the particular link. + + \snippet doc/src/snippets/declarative/text/onLinkActivated.qml 0 + + The example code will display the text + "The main website is at \l{http://qt.nokia.com}{Nokia Qt DF}." + + Clicking on the highlighted link will output + \tt{http://qt.nokia.com link activated} to the console. +*/ /*! \qmlproperty string Text::font.family @@ -320,7 +730,6 @@ QDeclarativeTextPrivate::~QDeclarativeTextPrivate() Text { text: "Hello"; font.capitalization: Font.AllLowercase } \endqml */ - QFont QDeclarativeText::font() const { Q_D(const QDeclarativeText); @@ -334,30 +743,9 @@ void QDeclarativeText::setFont(const QFont &font) return; d->font = font; - d->updateLayout(); - d->markImgDirty(); - emit fontChanged(d->font); -} - -void QDeclarativeText::setText(const QString &n) -{ - Q_D(QDeclarativeText); - if (d->text == n) - return; - d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(n)); - if (d->richText) { - if (isComponentComplete()) { - d->ensureDoc(); - d->doc->setText(n); - } - } - - d->text = n; - d->updateLayout(); - d->markImgDirty(); - emit textChanged(d->text); + emit fontChanged(d->font); } /*! @@ -374,17 +762,25 @@ QString QDeclarativeText::text() const return d->text; } -void QDeclarativeText::setColor(const QColor &color) +void QDeclarativeText::setText(const QString &n) { Q_D(QDeclarativeText); - if (d->color == color) + if (d->text == n) return; - d->color = color; - d->markImgDirty(); - emit colorChanged(d->color); + d->richText = d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(n)); + if (d->richText && isComponentComplete()) { + d->ensureDoc(); + d->doc->setText(n); + } + + d->text = n; + d->updateLayout(); + + emit textChanged(d->text); } + /*! \qmlproperty color Text::color @@ -398,13 +794,23 @@ void QDeclarativeText::setColor(const QColor &color) Text { color: "steelblue"; ... } \endqml */ - QColor QDeclarativeText::color() const { Q_D(const QDeclarativeText); return d->color; } +void QDeclarativeText::setColor(const QColor &color) +{ + Q_D(QDeclarativeText); + if (d->color == color) + return; + + d->color = color; + d->invalidateImageCache(); + emit colorChanged(d->color); +} + /*! \qmlproperty enumeration Text::style @@ -445,21 +851,10 @@ void QDeclarativeText::setStyle(QDeclarativeText::TextStyle style) if (isComponentComplete() && (d->style == Normal || style == Normal)) prepareGeometryChange(); d->style = style; - d->markImgDirty(); + d->invalidateImageCache(); emit styleChanged(d->style); } -void QDeclarativeText::setStyleColor(const QColor &color) -{ - Q_D(QDeclarativeText); - if (d->styleColor == color) - return; - - d->styleColor = color; - d->markImgDirty(); - emit styleColorChanged(d->styleColor); -} - /*! \qmlproperty color Text::styleColor @@ -481,6 +876,18 @@ QColor QDeclarativeText::styleColor() const return d->styleColor; } +void QDeclarativeText::setStyleColor(const QColor &color) +{ + Q_D(QDeclarativeText); + if (d->styleColor == color) + return; + + d->styleColor = color; + d->invalidateImageCache(); + emit styleColorChanged(d->styleColor); +} + + /*! \qmlproperty enumeration Text::horizontalAlignment \qmlproperty enumeration Text::verticalAlignment @@ -511,7 +918,10 @@ void QDeclarativeText::setHAlign(HAlignment align) if (isComponentComplete()) prepareGeometryChange(); + d->hAlign = align; + d->updateLayout(); + emit horizontalAlignmentChanged(align); } @@ -559,9 +969,8 @@ void QDeclarativeText::setWrapMode(WrapMode mode) return; d->wrapMode = mode; - d->updateLayout(); - d->markImgDirty(); + emit wrapModeChanged(); } @@ -621,7 +1030,6 @@ Column { \o \image declarative-textformat.png \endtable */ - QDeclarativeText::TextFormat QDeclarativeText::textFormat() const { Q_D(const QDeclarativeText); @@ -635,21 +1043,15 @@ void QDeclarativeText::setTextFormat(TextFormat format) return; d->format = format; bool wasRich = d->richText; - d->richText = format == RichText || (format == AutoText && Qt::mightBeRichText(d->text)); - - if (wasRich && !d->richText) { - //### delete control? (and vice-versa below) - d->updateLayout(); - d->markImgDirty(); - } else if (!wasRich && d->richText) { - if (isComponentComplete()) { - d->ensureDoc(); - d->doc->setText(d->text); - } - d->updateLayout(); - d->markImgDirty(); + d->richText = format == RichText || (format == AutoText && Qt::mightBeRichText(d->text)); + + if (!wasRich && d->richText && isComponentComplete()) { + d->ensureDoc(); + d->doc->setText(d->text); } + d->updateLayout(); + emit textFormatChanged(d->format); } @@ -688,12 +1090,12 @@ void QDeclarativeText::setElideMode(QDeclarativeText::TextElideMode mode) return; d->elideMode = mode; - d->updateLayout(); - d->markImgDirty(); + emit elideModeChanged(d->elideMode); } +/*! \internal */ QRectF QDeclarativeText::boundingRect() const { Q_D(const QDeclarativeText); @@ -704,7 +1106,7 @@ QRectF QDeclarativeText::boundingRect() const int x = 0; int y = 0; - QSize size = d->cachedLayoutSize; + QSize size = d->layedOutTextSize; if (d->style != Normal) size += QSize(2,2); @@ -737,117 +1139,23 @@ QRectF QDeclarativeText::boundingRect() const return QRectF(x,y,size.width(),size.height()); } -void QDeclarativeText::geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) +/*! \internal */ +void QDeclarativeText::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { Q_D(QDeclarativeText); - if (!d->internalWidthUpdate && newGeometry.width() != oldGeometry.width()) { - if (d->wrapMode != QDeclarativeText::NoWrap || d->elideMode != QDeclarativeText::ElideNone) { - //re-elide if needed - if (d->singleline && d->elideMode != QDeclarativeText::ElideNone && - isComponentComplete() && widthValid()) { - - QFontMetrics fm(d->font); - QString tmp = fm.elidedText(d->text,(Qt::TextElideMode)d->elideMode,width()); // XXX still worth layout...? - d->layout.setText(tmp); - } + if (!d->internalWidthUpdate && newGeometry.width() != oldGeometry.width() && + (d->wrapMode != QDeclarativeText::NoWrap || d->elideMode != QDeclarativeText::ElideNone)) { - d->imgDirty = true; + if (d->singleline && d->elideMode != QDeclarativeText::ElideNone && widthValid()) { + // We need to re-elide + d->updateLayout(); + } else { + // We just need to re-layout d->updateSize(); } } - QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); -} - -void QDeclarativeTextPrivate::updateLayout() -{ - Q_Q(QDeclarativeText); - if (q->isComponentComplete()) { - //setup instance of QTextLayout for all cases other than richtext - if (!richText) { - layout.clearLayout(); - layout.setFont(font); - if (format != QDeclarativeText::StyledText) { - QString tmp = text; - tmp.replace(QLatin1Char('\n'), QChar::LineSeparator); - singleline = !tmp.contains(QChar::LineSeparator); - if (singleline && elideMode != QDeclarativeText::ElideNone && q->widthValid()) { - QFontMetrics fm(font); - tmp = fm.elidedText(tmp,(Qt::TextElideMode)elideMode,q->width()); // XXX still worth layout...? - } - layout.setText(tmp); - } else { - singleline = false; - QDeclarativeStyledText::parse(text, layout); - } - } - updateSize(); - } else { - dirty = true; - } -} - - -void QDeclarativeTextPrivate::updateSize() -{ - Q_Q(QDeclarativeText); - if (q->isComponentComplete()) { - QFontMetrics fm(font); - if (text.isEmpty()) { - q->setImplicitHeight(fm.height()); - emit q->paintedSizeChanged(); - return; - } - - int dy = q->height(); - QSize size(0, 0); - - //setup instance of QTextLayout for all cases other than richtext - if (!richText) { - size = setupTextLayout(); - if (cachedLayoutSize != size) { - q->prepareGeometryChange(); - cachedLayoutSize = size; - } - dy -= size.height(); - } else { - singleline = false; // richtext can't elide or be optimized for single-line case - ensureDoc(); - doc->setDefaultFont(font); - QTextOption option((Qt::Alignment)int(hAlign | vAlign)); - option.setWrapMode(QTextOption::WrapMode(wrapMode)); - doc->setDefaultTextOption(option); - if (wrapMode != QDeclarativeText::NoWrap && q->widthValid()) - doc->setTextWidth(q->width()); - else - doc->setTextWidth(doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug) - dy -= (int)doc->size().height(); - QSize dsize = doc->size().toSize(); - if (dsize != cachedLayoutSize) { - q->prepareGeometryChange(); - cachedLayoutSize = dsize; - } - size = QSize(int(doc->idealWidth()),dsize.height()); - } - int yoff = 0; - if (q->heightValid()) { - if (vAlign == QDeclarativeText::AlignBottom) - yoff = dy; - else if (vAlign == QDeclarativeText::AlignVCenter) - yoff = dy/2; - } - q->setBaselineOffset(fm.ascent() + yoff); - - //### need to comfirm cost of always setting these for richText - internalWidthUpdate = true; - q->setImplicitWidth(size.width()); - internalWidthUpdate = false; - q->setImplicitHeight(size.height()); - emit q->paintedSizeChanged(); - } else { - dirty = true; - } + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); } /*! @@ -872,228 +1180,6 @@ qreal QDeclarativeText::paintedHeight() const return implicitHeight(); } - - -// ### text layout handling should be profiled and optimized as needed -// what about QStackTextEngine engine(tmp, d->font.font()); QTextLayout textLayout(&engine); - -void QDeclarativeTextPrivate::drawOutline() -{ - QPixmap img = QPixmap(imgStyleCache.width()+2,imgStyleCache.height()+2); - img.fill(Qt::transparent); - - QPainter ppm(&img); - - QPoint pos(imgCache.rect().topLeft()); - pos += QPoint(-1, 0); - ppm.drawPixmap(pos, imgStyleCache); - pos += QPoint(2, 0); - ppm.drawPixmap(pos, imgStyleCache); - pos += QPoint(-1, -1); - ppm.drawPixmap(pos, imgStyleCache); - pos += QPoint(0, 2); - ppm.drawPixmap(pos, imgStyleCache); - - pos += QPoint(0, -1); - ppm.drawPixmap(pos, imgCache); - ppm.end(); - - imgCache = img; -} - -void QDeclarativeTextPrivate::drawOutline(int yOffset) -{ - QPixmap img = QPixmap(imgStyleCache.width()+2,imgStyleCache.height()+2); - img.fill(Qt::transparent); - - QPainter ppm(&img); - - QPoint pos(imgCache.rect().topLeft()); - pos += QPoint(0, yOffset); - ppm.drawPixmap(pos, imgStyleCache); - - pos += QPoint(0, -yOffset); - ppm.drawPixmap(pos, imgCache); - ppm.end(); - - imgCache = img; -} - -QSize QDeclarativeTextPrivate::setupTextLayout() -{ - Q_Q(QDeclarativeText); - layout.setCacheEnabled(true); - - int height = 0; - qreal widthUsed = 0; - qreal lineWidth = 0; - - //set manual width - if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid()) - lineWidth = q->width(); - - QTextOption textOption = layout.textOption(); - textOption.setWrapMode(QTextOption::WrapMode(wrapMode)); - layout.setTextOption(textOption); - - layout.beginLayout(); - - while (1) { - QTextLine line = layout.createLine(); - if (!line.isValid()) - break; - - if ((wrapMode != QDeclarativeText::NoWrap || elideMode != QDeclarativeText::ElideNone) && q->widthValid()) - line.setLineWidth(lineWidth); - } - layout.endLayout(); - - int x = 0; - for (int i = 0; i < layout.lineCount(); ++i) { - QTextLine line = layout.lineAt(i); - widthUsed = qMax(widthUsed, line.naturalTextWidth()); - line.setPosition(QPointF(0, height)); - height += int(line.height()); - - if (!cache) { - if (hAlign == QDeclarativeText::AlignLeft) { - x = 0; - } else if (hAlign == QDeclarativeText::AlignRight) { - x = q->width() - (int)line.naturalTextWidth(); - } else if (hAlign == QDeclarativeText::AlignHCenter) { - x = (q->width() - (int)line.naturalTextWidth()) / 2; - } - line.setPosition(QPoint(x, (int)line.y())); - } - } - - return QSize(qCeil(widthUsed), height); -} - -QPixmap QDeclarativeTextPrivate::wrappedTextImage(bool drawStyle) -{ - //do layout - QSize size = cachedLayoutSize; - - int x = 0; - for (int i = 0; i < layout.lineCount(); ++i) { - QTextLine line = layout.lineAt(i); - if (hAlign == QDeclarativeText::AlignLeft) { - x = 0; - } else if (hAlign == QDeclarativeText::AlignRight) { - x = size.width() - (int)line.naturalTextWidth(); - } else if (hAlign == QDeclarativeText::AlignHCenter) { - x = (size.width() - (int)line.naturalTextWidth()) / 2; - } - line.setPosition(QPoint(x, (int)line.y())); - } - - //paint text - QPixmap img(size); - if (!size.isEmpty()) { - img.fill(Qt::transparent); -#ifdef Q_WS_MAC - bool oldSmooth = qt_applefontsmoothing_enabled; - qt_applefontsmoothing_enabled = false; -#endif - QPainter p(&img); -#ifdef Q_WS_MAC - qt_applefontsmoothing_enabled = oldSmooth; -#endif - drawWrappedText(&p, QPointF(0,0), drawStyle); - } - return img; -} - -void QDeclarativeTextPrivate::drawWrappedText(QPainter *p, const QPointF &pos, bool drawStyle) -{ - if (drawStyle) - p->setPen(styleColor); - else - p->setPen(color); - p->setFont(font); - layout.draw(p , pos); -} - -QPixmap QDeclarativeTextPrivate::richTextImage(bool drawStyle) -{ - QSize size = doc->size().toSize(); - - //paint text - QPixmap img(size); - img.fill(Qt::transparent); -#ifdef Q_WS_MAC - bool oldSmooth = qt_applefontsmoothing_enabled; - qt_applefontsmoothing_enabled = false; -#endif - QPainter p(&img); -#ifdef Q_WS_MAC - qt_applefontsmoothing_enabled = oldSmooth; -#endif - - QAbstractTextDocumentLayout::PaintContext context; - - QTextOption oldOption(doc->defaultTextOption()); - if (drawStyle) { - context.palette.setColor(QPalette::Text, styleColor); - QTextOption colorOption(doc->defaultTextOption()); - colorOption.setFlags(QTextOption::SuppressColors); - doc->setDefaultTextOption(colorOption); - } else { - context.palette.setColor(QPalette::Text, color); - } - doc->documentLayout()->draw(&p, context); - if (drawStyle) - doc->setDefaultTextOption(oldOption); - return img; -} - -void QDeclarativeTextPrivate::checkImgCache() -{ - if (!imgDirty) - return; - - bool empty = text.isEmpty(); - QPixmap newImgCache; - if (empty) { - imgStyleCache = QPixmap(); - } else if (richText) { - newImgCache = richTextImage(false); - if (style != QDeclarativeText::Normal) - imgStyleCache = richTextImage(true); //### should use styleColor - } else { - newImgCache = wrappedTextImage(false); - if (style != QDeclarativeText::Normal) - imgStyleCache = wrappedTextImage(true); //### should use styleColor - } - imgCache = newImgCache; - if (!empty) - switch (style) { - case QDeclarativeText::Outline: - drawOutline(); - break; - case QDeclarativeText::Sunken: - drawOutline(-1); - break; - case QDeclarativeText::Raised: - drawOutline(1); - break; - default: - break; - } - - imgDirty = false; -} - -void QDeclarativeTextPrivate::ensureDoc() -{ - if (!doc) { - Q_Q(QDeclarativeText); - doc = new QTextDocumentWithImageResources(q); - doc->setDocumentMargin(0); - } -} - /*! Returns the number of resources (images) that are being loaded asynchronously. */ @@ -1103,22 +1189,14 @@ int QDeclarativeText::resourcesLoading() const return d->doc ? d->doc->resourcesLoading() : 0; } -/*! - \qmlproperty bool Text::clip - This property holds whether the text is clipped. - - Note that if the text does not fit in the bounding rectangle it will be abruptly chopped. - - If you want to display potentially long text in a limited space, you probably want to use \c elide instead. -*/ - +/*! \internal */ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) { Q_D(QDeclarativeText); - if (d->cache || d->style != Normal) { - d->checkImgCache(); - if (d->imgCache.isNull()) + if (d->cacheAllTextAsImage || d->style != Normal) { + d->checkImageCache(); + if (d->imageCache.isNull()) return; bool oldAA = p->testRenderHint(QPainter::Antialiasing); @@ -1128,23 +1206,23 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid QRect br = boundingRect().toRect(); - bool needClip = clip() && (d->imgCache.width() > width() || - d->imgCache.height() > height()); + bool needClip = clip() && (d->imageCache.width() > width() || + d->imageCache.height() > height()); if (needClip) - p->drawPixmap(0, 0, width(), height(), d->imgCache, -br.x(), -br.y(), width(), height()); + p->drawPixmap(0, 0, width(), height(), d->imageCache, -br.x(), -br.y(), width(), height()); else - p->drawPixmap(br.x(), br.y(), d->imgCache); + p->drawPixmap(br.x(), br.y(), d->imageCache); if (d->smooth) { p->setRenderHint(QPainter::Antialiasing, oldAA); p->setRenderHint(QPainter::SmoothPixmapTransform, oldSmooth); } } else { - qreal y = boundingRect().y(); + QRectF bounds = boundingRect(); - bool needClip = clip() && (d->cachedLayoutSize.width() > width() || - d->cachedLayoutSize.height() > height()); + bool needClip = clip() && (d->layedOutTextSize.width() > width() || + d->layedOutTextSize.height() > height()); if (needClip) { p->save(); @@ -1153,49 +1231,35 @@ void QDeclarativeText::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWid if (d->richText) { QAbstractTextDocumentLayout::PaintContext context; context.palette.setColor(QPalette::Text, d->color); - p->translate(0, y); + p->translate(bounds.x(), bounds.y()); d->doc->documentLayout()->draw(p, context); - p->translate(0, -y); + p->translate(-bounds.x(), -bounds.y()); } else { - d->drawWrappedText(p, QPointF(0,y), false); + d->drawTextLayout(p, QPointF(0, bounds.y()), false); } - if (needClip) + + if (needClip) { p->restore(); + } } } -/*! - \qmlproperty bool Text::smooth - - This property holds whether the text is smoothly scaled or transformed. - - Smooth filtering gives better visual quality, but is slower. If - the item is displayed at its natural size, this property has no visual or - performance effect. - - \note Generally scaling artifacts are only visible if the item is stationary on - the screen. A common pattern when animating an item is to disable smooth - filtering at the beginning of the animation and reenable it at the conclusion. -*/ - +/*! \internal */ void QDeclarativeText::componentComplete() { Q_D(QDeclarativeText); QDeclarativeItem::componentComplete(); - if (d->dirty) { + if (d->updateOnComponentComplete) { + d->updateOnComponentComplete = false; if (d->richText) { d->ensureDoc(); d->doc->setText(d->text); } d->updateLayout(); - d->dirty = false; } } -/*! - \overload - Handles the given mouse \a event. - */ +/*! \internal */ void QDeclarativeText::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_D(QDeclarativeText); @@ -1214,26 +1278,7 @@ void QDeclarativeText::mousePressEvent(QGraphicsSceneMouseEvent *event) } -/*! - \qmlsignal Text::onLinkActivated(string link) - - This handler is called when the user clicks on a link embedded in the text. - The link must be in rich text or HTML format and the - \a link string provides access to the particular link. - - \snippet doc/src/snippets/declarative/text/onLinkActivated.qml 0 - - The example code will display the text - "The main website is at \l{http://qt.nokia.com}{Nokia Qt DF}." - - Clicking on the highlighted link will output - \tt{http://qt.nokia.com link activated} to the console. -*/ - -/*! - \overload - Handles the given mouse \a event. - */ +/*! \internal */ void QDeclarativeText::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Q_D(QDeclarativeText); diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h index db68558..e37f477 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h @@ -74,24 +74,8 @@ public: ~QDeclarativeTextPrivate(); - void ensureDoc(); void updateSize(); void updateLayout(); - void markImgDirty() { - Q_Q(QDeclarativeText); - imgDirty = true; - if (q->isComponentComplete()) - q->update(); - } - void checkImgCache(); - - void drawOutline(); - void drawOutline(int yOffset); - - QPixmap wrappedTextImage(bool drawStyle); - void drawWrappedText(QPainter *p, const QPointF &pos, bool drawStyle); - QPixmap richTextImage(bool drawStyle); - QSize setupTextLayout(); QString text; QFont font; @@ -99,23 +83,37 @@ public: QDeclarativeText::TextStyle style; QColor styleColor; QString activeLink; - QPixmap imgCache; - QPixmap imgStyleCache; QDeclarativeText::HAlignment hAlign; QDeclarativeText::VAlignment vAlign; QDeclarativeText::TextElideMode elideMode; - bool imgDirty:1; - bool dirty:1; + QDeclarativeText::TextFormat format; + QDeclarativeText::WrapMode wrapMode; + + void invalidateImageCache(); + void checkImageCache(); + QPixmap imageCache; + + bool imageCacheDirty:1; + bool updateOnComponentComplete:1; bool richText:1; bool singleline:1; - bool cache:1; + bool cacheAllTextAsImage:1; bool internalWidthUpdate:1; + + QSize layedOutTextSize; + + void ensureDoc(); + QPixmap textDocumentImage(bool drawStyle); QTextDocumentWithImageResources *doc; + + QSize setupTextLayout(); + QPixmap textLayoutImage(bool drawStyle); + void drawTextLayout(QPainter *p, const QPointF &pos, bool drawStyle); QDeclarativeTextLayout layout; - QSize cachedLayoutSize; - QDeclarativeText::TextFormat format; - QDeclarativeText::WrapMode wrapMode; - + + static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource); + static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource, int yOffset); + static inline QDeclarativeTextPrivate *get(QDeclarativeText *t) { return t->d_func(); } -- cgit v0.12 From befbf33a0170de28631adb01c49491197595d20c Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Wed, 13 Oct 2010 15:12:28 +1000 Subject: Update reference bitmaps used in bitmap comparison tests to follow changes in Text painting Task-number: QTBUG-14374 --- .../declarative/qdeclarativetext/data/alignments_cb.png | Bin 496 -> 496 bytes .../declarative/qdeclarativetext/data/alignments_cc.png | Bin 556 -> 556 bytes .../declarative/qdeclarativetext/data/alignments_ct.png | Bin 533 -> 533 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png index 99de219..cf6199a 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png index cb85251..f81ccb4 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png index ddca549..9ba6412 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png differ -- cgit v0.12 From deb92145c5bc69b7ee252687cf5b763b33f17775 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 28 Sep 2010 10:40:49 +1000 Subject: Update color type docs to mention transparency --- doc/src/declarative/basictypes.qdoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index e327d4a..e8aceb3 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -156,8 +156,10 @@ Example: \qml Rectangle { color: "steelblue" } + Rectangle { color: "transparent" } Rectangle { color: "#FF0000" } Rectangle { color: "#800000FF" } + Rectangle { color: "#00000000" } // ARGB fully transparent \endqml Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, -- cgit v0.12 From a47835bf8cabffc127c2879b758f6730aca3d52b Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Wed, 13 Oct 2010 16:47:03 +1000 Subject: Fix worker ListModels to property emit countChanged() Task-number: QT-4094 --- src/declarative/util/qdeclarativelistmodelworkeragent.cpp | 2 +- .../qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp index 6804d4a..852b055 100644 --- a/src/declarative/util/qdeclarativelistmodelworkeragent.cpp +++ b/src/declarative/util/qdeclarativelistmodelworkeragent.cpp @@ -208,7 +208,7 @@ bool QDeclarativeListModelWorkerAgent::event(QEvent *e) const QList &changes = s->data.changes; if (m_copy) { - bool cc = m_copy->count() != s->list->count(); + bool cc = m_orig->count() != s->list->count(); FlatListModel *orig = m_orig->m_flat; FlatListModel *copy = s->list->m_flat; diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index be77f8e..4b8d772 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -320,11 +320,16 @@ void tst_qdeclarativelistmodel::dynamic() if (!warning.isEmpty()) QTest::ignoreMessage(QtWarningMsg, warning.toLatin1()); + QSignalSpy spyCount(&model, SIGNAL(countChanged())); + int actual = e.evaluate().toInt(); if (e.hasError()) qDebug() << e.error(); // errors not expected QCOMPARE(actual,result); + + if (model.count() > 0) + QVERIFY(spyCount.count() > 0); } void tst_qdeclarativelistmodel::dynamic_worker_data() @@ -351,6 +356,8 @@ void tst_qdeclarativelistmodel::dynamic_worker() QDeclarativeItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); + QSignalSpy spyCount(&model, SIGNAL(countChanged())); + if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}')) script = script.mid(1, script.length() - 2); QVariantList operations; @@ -367,6 +374,9 @@ void tst_qdeclarativelistmodel::dynamic_worker() waitForWorker(item); QCOMPARE(QDeclarativeProperty(item, "result").read().toInt(), result); + if (model.count() > 0) + QVERIFY(spyCount.count() > 0); + delete item; qApp->processEvents(); } -- cgit v0.12 From 9abacb24b4e88e6811b90881d9e55764061607b2 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 13 Oct 2010 11:42:57 +0300 Subject: Added --remove-destination to qmake_emulator_deployment.flm This will fix the issue with deploying files when destination is owned by another user. Reviewed-by: TrustMe --- mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm index 3877edb..a557cbb 100644 --- a/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm +++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_emulator_deployment.flm @@ -21,7 +21,7 @@ CLEAN_TARGET:=$(1) $(1): $(2) $(call startrule,qmake_emulator_deployment) \ - $(GNUCP) --no-preserve=mode $(2) "$$@" && \ + $(GNUCP) --remove-destination --no-preserve=mode $(2) "$$@" && \ $(GNUCHMOD) a+rw "$$@" \ $(call endrule,qmake_emulator_deployment) endef -- cgit v0.12 From 0f81945563441082551c65f964531c16e185d3de Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 13 Oct 2010 18:50:46 +1000 Subject: Fix autotest on windows --- src/declarative/qml/qdeclarativeengine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 8e1416e..c3fdf36 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -2203,7 +2203,9 @@ bool QDeclarative_isFileCaseCorrect(const QString &fileName) #elif defined(Q_OS_WIN32) wchar_t buffer[1024]; - DWORD rv = ::GetLongPathName((wchar_t*)absolute.utf16(), buffer, 1024); + DWORD rv = ::GetShortPathName((wchar_t*)absolute.utf16(), buffer, 1024); + if (rv == 0 || rv >= 1024) return true; + rv = ::GetLongPathName(buffer, buffer, 1024); if (rv == 0 || rv >= 1024) return true; QString canonical((QChar *)buffer); -- cgit v0.12 From 378b1608e7962da9ee295101be40c84606a8a6c0 Mon Sep 17 00:00:00 2001 From: kh1 Date: Wed, 13 Oct 2010 11:58:21 +0200 Subject: Fix potential crash in case we had opened pages but run now without docs. --- tools/assistant/tools/assistant/openpagesmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/assistant/tools/assistant/openpagesmanager.cpp b/tools/assistant/tools/assistant/openpagesmanager.cpp index 3b69b50..75b8653 100644 --- a/tools/assistant/tools/assistant/openpagesmanager.cpp +++ b/tools/assistant/tools/assistant/openpagesmanager.cpp @@ -167,7 +167,8 @@ void OpenPagesManager::setupInitialPages(bool defaultCollection, m_model->addPage(helpEngine.homePage()); for (int i = 0; i < m_model->rowCount(); ++i) CentralWidget::instance()->addPage(m_model->pageAt(i)); - setCurrentPage(initialPage); + setCurrentPage((initialPage >= m_model->rowCount()) + ? m_model->rowCount() - 1 : initialPage); m_openPagesSwitcher->selectCurrentPage(); } -- cgit v0.12 From a6006b9b97634ae93e2ccc2dd93c0161e69d55dc Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 13 Oct 2010 13:35:30 +0200 Subject: Disable selection of Libraries on Windows 7 in getExistingDirectory(). The Libraries on Windows 7 are user-defined collection of folders, which is only a logical representation. There are no file system entries associated with it . This patch makes sure that user cannot choose a library when using the QFileDialog::getExistingDirectory(), in such cases it will show a standard windows warning message. Task-number: QTBUG-12655 Reviewed-by: Thierry Bastian --- src/gui/dialogs/qfiledialog_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 5b192b4..98860c4 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -603,7 +603,7 @@ QString qt_win_CID_get_existing_directory(const QFileDialogArgs &args) // Set the FOS_PICKFOLDERS flag DWORD newOptions; hr = pfd->GetOptions(&newOptions); - newOptions |= FOS_PICKFOLDERS; + newOptions |= (FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM); if (SUCCEEDED(hr) && SUCCEEDED((hr = pfd->SetOptions(newOptions)))) { QWidget *parentWindow = args.parent; if (parentWindow) -- cgit v0.12 From 2def16770a623df4e5fc0dcd5f0e55c485251992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Oct 2010 18:28:36 +0200 Subject: Add manual test for mkspecs to visualize the effect of the final config Reviewed-by: ossi --- qmake/generators/mac/pbuilder_pbx.cpp | 1 + qmake/generators/metamakefile.cpp | 1 + qmake/generators/win32/msvc_vcproj.cpp | 1 + tests/manual/mkspecs/.gitignore | 2 ++ tests/manual/mkspecs/test.sh | 64 ++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 tests/manual/mkspecs/.gitignore create mode 100755 tests/manual/mkspecs/test.sh diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index aa55f51..c659adb 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -167,6 +167,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) } if(tmp_proj.read(fn)) { if(Option::debug_level) { + debug_msg(1, "Dumping all variables:"); QMap &vars = tmp_proj.variables(); for(QMap::Iterator it = vars.begin(); it != vars.end(); ++it) { diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index e98831d..df05550 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -217,6 +217,7 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd) // debugging if(Option::debug_level) { + debug_msg(1, "Dumping all variables:"); QMap &vars = project->variables(); for(QMap::Iterator it = vars.begin(); it != vars.end(); ++it) { if(!it.key().startsWith(".") && !it.value().isEmpty()) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 8582ce1..c98251b 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -459,6 +459,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) tmp_vcproj.setProjectFile(&tmp_proj); Option::qmake_mode = old_mode; if(Option::debug_level) { + debug_msg(1, "Dumping all variables:"); QMap &vars = tmp_proj.variables(); for(QMap::Iterator it = vars.begin(); it != vars.end(); ++it) { diff --git a/tests/manual/mkspecs/.gitignore b/tests/manual/mkspecs/.gitignore new file mode 100644 index 0000000..403e028 --- /dev/null +++ b/tests/manual/mkspecs/.gitignore @@ -0,0 +1,2 @@ +tmp +specs diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh new file mode 100755 index 0000000..4b723c0 --- /dev/null +++ b/tests/manual/mkspecs/test.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +if [ "$1" == "--help" ]; then + echo "Init a clean git repository somewhere and run this test script from that directory. The first run will" + echo "produce a bunch of specs. This is your baseline. Run 'git add specs' and commit the baseline. Then run" + echo "this script again, after making changes to the mkspecs. You should see any diffs you produced." + exit 0 +fi + + +QMAKE_ARGS="-nocache -d" +SPECS_DIR=$(qmake -query QMAKE_MKSPECS) +SPECS=$(find -L $SPECS_DIR | grep "qmake.conf" | grep -Ev "common|default" | grep "$1") + +SEDI="sed -i" +if [ $(uname) == "Darwin" ]; then + # Mac OS X requires an extension, Linux will barf on it being present + SEDI='sed -i .backup' +fi + +if [ ! -d tmp ]; then + mkdir tmp + touch tmp/empty.pro +fi + +if [ ! -d specs ]; then + mkdir specs +fi + +git checkout -- specs > /dev/null 2>&1 + +cd tmp +for spec in $SPECS; do + spec=$(echo $spec | sed "s|$SPECS_DIR/||" | sed "s|/qmake.conf||") + output_file=$(echo "$spec.txt" | sed "s|/|-|g") + echo "Dumping qmake variables for spec '$spec' to 'specs/$output_file'..." + qmake $QMAKE_ARGS -spec $spec empty.pro 2>&1 | + sed -n '/Dumping all variables/,$p' | + grep -Ev "(QMAKE_INTERNAL_INCLUDED_FILES|DISTFILES) ===" > ../specs/$output_file + + if [ -n $QTDIR ]; then + $SEDI "s|$QTDIR|\$QTDIR|g" ../specs/$output_file + fi + + if [ -n $QTSRCDIR ]; then + $SEDI "s|$QTSRCDIR|\$QTDIR|g" ../specs/$output_file + fi +done +cd .. + +rm -f specs/*.backup + +git diff --exit-code -- specs > /dev/null +exit_code=$? + +if [ $exit_code -eq 0 ]; then + echo -e "\nNo diff produced (you did good)" +else + # Show the resulting diff + git diff -- specs +fi + +exit $exit_code + -- cgit v0.12 From 86636e0c4ab91bfb60be1e18d6daff34d41a5927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Oct 2010 14:09:10 +0200 Subject: Refactor GCC mkspecs to share more configuration options The g++ and llvm mkspecs now share the common parts in common/gcc-base.conf Each top level mkspec includes a platform-specific version of this base, either common/gcc-base-unix.conf or common/gcc-base-mac.conf, and these platform specific bases will include the cross-platform one. The same pattern is then used for the g++ specific configurations, which are split up into common/g++.conf, common/g++-unix.conf and common/g++-mac.conf The qplatformdefs.h for mac was also shared where possible. The test in tests/manual/mkspecs was used to ensure that the final output of all the mkspecs was the same after the refactoring as before. Reviewed-by: ossi --- mkspecs/common/g++-mac.conf | 27 ++++++ mkspecs/common/g++-unix.conf | 14 ++++ mkspecs/common/g++.conf | 56 +++---------- mkspecs/common/gcc-base-mac.conf | 48 +++++++++++ mkspecs/common/gcc-base-unix.conf | 21 +++++ mkspecs/common/gcc-base.conf | 73 ++++++++++++++++ mkspecs/common/llvm.conf | 49 +---------- mkspecs/common/mac-g++.conf | 81 ------------------ mkspecs/common/mac-llvm.conf | 76 ----------------- mkspecs/common/mac/qplatformdefs.h | 97 ++++++++++++++++++++++ mkspecs/freebsd-g++/qmake.conf | 3 +- mkspecs/linux-g++-32/qmake.conf | 3 +- mkspecs/linux-g++-64/qmake.conf | 4 +- mkspecs/linux-g++-maemo/qmake.conf | 3 +- mkspecs/linux-g++/qmake.conf | 3 +- mkspecs/linux-llvm/qmake.conf | 3 +- mkspecs/macx-g++/qmake.conf | 5 +- mkspecs/macx-g++/qplatformdefs.h | 56 +------------ mkspecs/macx-g++40/qmake.conf | 4 +- mkspecs/macx-g++40/qplatformdefs.h | 56 +------------ mkspecs/macx-g++42/qmake.conf | 4 +- mkspecs/macx-g++42/qplatformdefs.h | 56 +------------ mkspecs/macx-icc/qplatformdefs.h | 2 +- mkspecs/macx-llvm/qmake.conf | 4 +- mkspecs/macx-llvm/qplatformdefs.h | 56 +------------ mkspecs/macx-xcode/qmake.conf | 12 ++- mkspecs/macx-xcode/qplatformdefs.h | 56 +------------ mkspecs/qws/linux-arm-g++/qmake.conf | 3 +- mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf | 3 +- mkspecs/qws/linux-armv6-g++/qmake.conf | 3 +- mkspecs/qws/linux-avr32-g++/qmake.conf | 3 +- mkspecs/qws/linux-cellon-g++/qmake.conf | 3 +- mkspecs/qws/linux-dm7000-g++/qmake.conf | 3 +- mkspecs/qws/linux-dm800-g++/qmake.conf | 3 +- mkspecs/qws/linux-generic-g++-32/qmake.conf | 3 +- mkspecs/qws/linux-generic-g++/qmake.conf | 3 +- mkspecs/qws/linux-ipaq-g++/qmake.conf | 3 +- mkspecs/qws/linux-lsb-g++/qmake.conf | 4 +- mkspecs/qws/linux-mips-g++/qmake.conf | 3 +- mkspecs/qws/linux-powerpc-g++/qmake.conf | 3 +- mkspecs/qws/linux-sh-g++/qmake.conf | 3 +- mkspecs/qws/linux-sh4al-g++/qmake.conf | 3 +- mkspecs/qws/linux-sharp-g++/qmake.conf | 3 +- mkspecs/qws/linux-x86-g++/qmake.conf | 3 +- mkspecs/qws/linux-x86_64-g++/qmake.conf | 3 +- mkspecs/qws/linux-zylonite-g++/qmake.conf | 3 +- mkspecs/symbian/linux-gcce/qmake.conf | 3 +- .../unsupported/linux-scratchbox2-g++/qmake.conf | 3 +- mkspecs/unsupported/qnx-g++/qmake.conf | 3 +- mkspecs/unsupported/vxworks-ppc-g++/qmake.conf | 3 +- .../unsupported/vxworks-simpentium-g++/qmake.conf | 3 +- 51 files changed, 383 insertions(+), 562 deletions(-) create mode 100644 mkspecs/common/g++-mac.conf create mode 100644 mkspecs/common/g++-unix.conf create mode 100644 mkspecs/common/gcc-base-mac.conf create mode 100644 mkspecs/common/gcc-base-unix.conf create mode 100644 mkspecs/common/gcc-base.conf delete mode 100644 mkspecs/common/mac-g++.conf delete mode 100644 mkspecs/common/mac-llvm.conf create mode 100644 mkspecs/common/mac/qplatformdefs.h diff --git a/mkspecs/common/g++-mac.conf b/mkspecs/common/g++-mac.conf new file mode 100644 index 0000000..1b8ec6e --- /dev/null +++ b/mkspecs/common/g++-mac.conf @@ -0,0 +1,27 @@ +# +# Qmake configuration for the GNU C++ compiler on Mac OS X +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +include(g++.conf) + +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2 +QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_DWARF2 +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g $$QMAKE_CFLAGS_DWARF2 + +QMAKE_LFLAGS_STATIC_LIB += -all_load + +QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5 +QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5 + +QMAKE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 +QMAKE_CXXFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 +QMAKE_OBJECTIVE_CFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 +QMAKE_OBJECTIVE_CFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 +QMAKE_LFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 +QMAKE_LFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 diff --git a/mkspecs/common/g++-unix.conf b/mkspecs/common/g++-unix.conf new file mode 100644 index 0000000..09b3e90 --- /dev/null +++ b/mkspecs/common/g++-unix.conf @@ -0,0 +1,14 @@ +# +# Qmake configuration for the GNU C++ compiler on *nix-systems +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +include(g++.conf) + +QMAKE_LFLAGS_RELEASE += -Wl,-O1 +QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined diff --git a/mkspecs/common/g++.conf b/mkspecs/common/g++.conf index 0d511fc..cb82180 100644 --- a/mkspecs/common/g++.conf +++ b/mkspecs/common/g++.conf @@ -1,54 +1,18 @@ # -# qmake configuration for common gcc +# Qmake configuration for the GNU C++ compiler +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. # -QMAKE_CC = gcc -QMAKE_CFLAGS += -pipe -QMAKE_CFLAGS_DEPS += -M -QMAKE_CFLAGS_WARN_ON += -Wall -W -QMAKE_CFLAGS_WARN_OFF += -w -QMAKE_CFLAGS_RELEASE += -O2 QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g -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_CXX = g++ -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_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -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 = g++ -QMAKE_LINK_SHLIB = g++ -QMAKE_LINK_C = gcc -QMAKE_LINK_C_SHLIB = gcc -QMAKE_LFLAGS += -QMAKE_LFLAGS_RELEASE += -Wl,-O1 -QMAKE_LFLAGS_DEBUG += -QMAKE_LFLAGS_APP += -QMAKE_LFLAGS_SHLIB += -shared -QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_SONAME += -Wl,-soname, -QMAKE_LFLAGS_THREAD += -QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined -QMAKE_LFLAGS_RPATH = -Wl,-rpath, -QMAKE_PCH_OUTPUT_EXT = .gch +QMAKE_LINK_C = $$QMAKE_CC +QMAKE_LINK_C_SHLIB = $$QMAKE_CC -# -Bsymbolic-functions (ld) support -QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions -QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, +QMAKE_PCH_OUTPUT_EXT = .gch diff --git a/mkspecs/common/gcc-base-mac.conf b/mkspecs/common/gcc-base-mac.conf new file mode 100644 index 0000000..b65cc5e --- /dev/null +++ b/mkspecs/common/gcc-base-mac.conf @@ -0,0 +1,48 @@ +# +# Base qmake configuration for GCC on Mac OS X +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +include(gcc-base.conf) + +QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__ + +QMAKE_CFLAGS_X86 += -arch i386 +QMAKE_CFLAGS_X86_64 += -arch x86_64 +QMAKE_CFLAGS_PPC += -arch ppc +QMAKE_CFLAGS_PPC_64 += -arch ppc64 +QMAKE_CFLAGS_DWARF2 += -gdwarf-2 + +QMAKE_CXXFLAGS_X86 += $$QMAKE_CFLAGS_X86 +QMAKE_CXXFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 +QMAKE_CXXFLAGS_PPC += $$QMAKE_CFLAGS_PPC +QMAKE_CXXFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 +QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 + +QMAKE_OBJECTIVE_CFLAGS_X86 += $$QMAKE_CFLAGS_X86 +QMAKE_OBJECTIVE_CFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 +QMAKE_OBJECTIVE_CFLAGS_PPC += $$QMAKE_CFLAGS_PPC +QMAKE_OBJECTIVE_CFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 + +QMAKE_LFLAGS_X86 += $$QMAKE_CFLAGS_X86 +QMAKE_LFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 +QMAKE_LFLAGS_PPC += $$QMAKE_CFLAGS_PPC +QMAKE_LFLAGS_PPC_64 += $$QMAKE_CFLAGS_PPC_64 + +QMAKE_LFLAGS += -headerpad_max_install_names +QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib +QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_INCREMENTAL += -undefined suppress -flat_namespace +QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} +QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE} +QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE} + +QMAKE_OBJCFLAGS_PRECOMPILE += -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE +QMAKE_OBJCXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/common/gcc-base-unix.conf b/mkspecs/common/gcc-base-unix.conf new file mode 100644 index 0000000..dc8d7e4 --- /dev/null +++ b/mkspecs/common/gcc-base-unix.conf @@ -0,0 +1,21 @@ +# +# Base qmake configuration for GCC on *nix-systems +# +# Before making changes to this file, please read the comment in +# gcc-base.conf, to make sure the change goes in the right place. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +include(gcc-base.conf) + +QMAKE_LFLAGS_SHLIB += -shared +QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_SONAME += -Wl,-soname, +QMAKE_LFLAGS_THREAD += +QMAKE_LFLAGS_RPATH = -Wl,-rpath, + +# -Bsymbolic-functions (ld) support +QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions +QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf new file mode 100644 index 0000000..2afe9d6 --- /dev/null +++ b/mkspecs/common/gcc-base.conf @@ -0,0 +1,73 @@ +# +# This file is used as a basis for the following compilers: +# +# - The GNU C++ compiler (g++) +# - LLVM +# - Clang +# +# Platform-specific options shared by these compilers are put into: +# +# - gcc-base-mac.conf +# - gcc-base-unix.conf +# +# These base files are then combined with configurations for each compiler: +# +# - g++.conf +# - g++-mac.conf +# - g++-unix.conf +# - llvm.conf +# - clang.conf +# +# The combination happens in the top level mkspec, by including a platform- +# specific version of the base-file, for example gcc-base-mac.conf, and then +# a (possibly platform-specific) version of the actual compiler configuration, +# for example g++-mac.conf. +# +# If you are making changes to any of these files, please consider the +# possible effect it may have due to these include-rules, and whether it +# might make more sense to share the rule or make it more specific. +# +# To verify that your change has the desired effect on the final configuration +# you can use the manual test in tests/manual/mkspecs. +# + +# Allow including configurations to override +isEmpty(QMAKE_CC): QMAKE_CC = gcc + +QMAKE_CFLAGS += -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} + +isEmpty(QMAKE_CXX): QMAKE_CXX = g++ + +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 = $$QMAKE_CXX +QMAKE_LINK_SHLIB = $$QMAKE_CXX + +QMAKE_LFLAGS += +QMAKE_LFLAGS_DEBUG += +QMAKE_LFLAGS_APP += +QMAKE_LFLAGS_RELEASE += + diff --git a/mkspecs/common/llvm.conf b/mkspecs/common/llvm.conf index 70f52aa..4e54703 100644 --- a/mkspecs/common/llvm.conf +++ b/mkspecs/common/llvm.conf @@ -1,49 +1,8 @@ # -# qmake configuration for common gcc +# Qmake configuration for LLVM on Linux and Mac # -QMAKE_CC = llvm-gcc -QMAKE_CFLAGS += -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_CC = llvm-gcc +QMAKE_CXX = llvm-g++ -QMAKE_CXX = llvm-g++ -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 = llvm-g++ -QMAKE_LINK_SHLIB = llvm-g++ -QMAKE_LFLAGS += -QMAKE_LFLAGS_RELEASE += -QMAKE_LFLAGS_DEBUG += -QMAKE_LFLAGS_APP += -QMAKE_LFLAGS_SHLIB += -shared -QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_SONAME += -Wl,-soname, -QMAKE_LFLAGS_THREAD += -QMAKE_LFLAGS_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, +QMAKE_PCH_OUTPUT_EXT = .gch diff --git a/mkspecs/common/mac-g++.conf b/mkspecs/common/mac-g++.conf deleted file mode 100644 index 29b7408..0000000 --- a/mkspecs/common/mac-g++.conf +++ /dev/null @@ -1,81 +0,0 @@ -# -# qmake configuration for common gcc on Mac OS X -# - -include(mac.conf) - -QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__ -QMAKE_CFLAGS += -pipe -QMAKE_CFLAGS_DEPS += -M -QMAKE_CFLAGS_WARN_ON += -Wall -W -QMAKE_CFLAGS_WARN_OFF += -w -QMAKE_CFLAGS_RELEASE += -O2 -QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g -gdwarf-2 -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_CFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5 -QMAKE_OBJECTIVE_CFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5 -QMAKE_CFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -QMAKE_OBJECTIVE_CFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -QMAKE_CFLAGS_PPC += -arch ppc -QMAKE_OBJECTIVE_CFLAGS_PPC += -arch ppc -QMAKE_CFLAGS_X86 += -arch i386 -QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386 -QMAKE_CFLAGS_DWARF2 += -gdwarf-2 - -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_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -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_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5 -QMAKE_CXXFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -QMAKE_CXXFLAGS_PPC += -arch ppc -QMAKE_CXXFLAGS_X86 += -arch i386 -QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 -QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE - -QMAKE_LINK = $$QMAKE_CXX -QMAKE_LINK_SHLIB = $$QMAKE_CXX -QMAKE_LINK_C = $$QMAKE_CC -QMAKE_LINK_C_SHLIB = $$QMAKE_CC -QMAKE_LFLAGS += -headerpad_max_install_names -QMAKE_LFLAGS_RELEASE += -QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += -g -gdwarf-2 -QMAKE_LFLAGS_DEBUG += -QMAKE_LFLAGS_APP += -QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib -QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_THREAD += -QMAKE_LFLAGS_INCREMENTAL+= -undefined suppress -flat_namespace -QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5 -QMAKE_LFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -QMAKE_LFLAGS_PPC += -arch ppc -QMAKE_LFLAGS_X86 += -arch i386 -QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE} -# -all_load requred to make Objective-C categories work in static builds. -QMAKE_LFLAGS_STATIC_LIB += -all_load -QMAKE_LFLAGS_RPATH += - -QMAKE_PCH_OUTPUT_EXT = .gch - -QMAKE_OBJCFLAGS_PRECOMPILE += -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE - -QMAKE_OBJCXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/common/mac-llvm.conf b/mkspecs/common/mac-llvm.conf deleted file mode 100644 index 4ff088c..0000000 --- a/mkspecs/common/mac-llvm.conf +++ /dev/null @@ -1,76 +0,0 @@ -# -# qmake configuration for common gcc on Mac OS X -# - -include(mac.conf) - -QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__ -QMAKE_CC = llvm-gcc -QMAKE_CFLAGS += -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_CFLAGS_PPC_64 += -arch ppc64 -QMAKE_OBJECTIVE_CFLAGS_PPC_64 += -arch ppc64 -QMAKE_CFLAGS_X86_64 += -arch x86_64 -QMAKE_OBJECTIVE_CFLAGS_X86_64 += -arch x86_64 -QMAKE_CFLAGS_PPC += -arch ppc -QMAKE_OBJECTIVE_CFLAGS_PPC += -arch ppc -QMAKE_CFLAGS_X86 += -arch i386 -QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386 -QMAKE_CFLAGS_DWARF2 += -gdwarf-2 - -QMAKE_CXX = llvm-g++ -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_PPC_64 += -arch ppc64 -QMAKE_CXXFLAGS_X86_64 += -arch x86_64 -QMAKE_CXXFLAGS_PPC += -arch ppc -QMAKE_CXXFLAGS_X86 += -arch i386 -QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 -QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE - -QMAKE_LINK = $$QMAKE_CXX -QMAKE_LINK_SHLIB = $$QMAKE_CXX -QMAKE_LFLAGS += -headerpad_max_install_names -QMAKE_LFLAGS_RELEASE += -QMAKE_LFLAGS_DEBUG += -QMAKE_LFLAGS_APP += -QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib -QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB -QMAKE_LFLAGS_THREAD += -QMAKE_LFLAGS_INCREMENTAL+= -undefined suppress -flat_namespace -QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_PPC_64 += -arch ppc64 -QMAKE_LFLAGS_X86_64 += -arch x86_64 -QMAKE_LFLAGS_PPC += -arch ppc -QMAKE_LFLAGS_X86 += -arch i386 -QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE} -QMAKE_LFLAGS_RPATH += - -QMAKE_PCH_OUTPUT_EXT = .gch - -QMAKE_OBJCFLAGS_PRECOMPILE += -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE - -QMAKE_OBJCXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} -QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE diff --git a/mkspecs/common/mac/qplatformdefs.h b/mkspecs/common/mac/qplatformdefs.h new file mode 100644 index 0000000..99d64ef --- /dev/null +++ b/mkspecs/common/mac/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 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 +#define QT_NO_LIBRARY_UNLOAD + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef QT_NO_IPV6IFNAME +#include +#endif + +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE + +#define QT_OPEN_LARGEFILE 0 + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif + +#define QT_SIGNAL_IGNORE (void (*)(int))1 + +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf + +#endif // QPLATFORMDEFS_H diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index 9de93d4..9d7c443 100644 --- a/mkspecs/freebsd-g++/qmake.conf +++ b/mkspecs/freebsd-g++/qmake.conf @@ -48,6 +48,7 @@ QMAKE_DEL_FILE = rm -f QMAKE_DEL_DIR = rmdir QMAKE_CHK_DIR_EXISTS = test -d QMAKE_MKDIR = mkdir -p -include(../common/g++.conf) include(../common/unix.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) load(qt_config) diff --git a/mkspecs/linux-g++-32/qmake.conf b/mkspecs/linux-g++-32/qmake.conf index f425c0d..cdf8914 100644 --- a/mkspecs/linux-g++-32/qmake.conf +++ b/mkspecs/linux-g++-32/qmake.conf @@ -12,6 +12,7 @@ QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS = -m32 QMAKE_LFLAGS = -m32 -include(../common/g++.conf) include(../common/linux.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) load(qt_config) diff --git a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf index b8877a9..222f6b7 100644 --- a/mkspecs/linux-g++-64/qmake.conf +++ b/mkspecs/linux-g++-64/qmake.conf @@ -15,8 +15,10 @@ QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS = -m64 QMAKE_LFLAGS = -m64 -include(../common/g++.conf) include(../common/linux.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) + QMAKE_LIBDIR_X11 = /usr/X11R6/lib64 QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib64 diff --git a/mkspecs/linux-g++-maemo/qmake.conf b/mkspecs/linux-g++-maemo/qmake.conf index 8f85c54..d91db07 100644 --- a/mkspecs/linux-g++-maemo/qmake.conf +++ b/mkspecs/linux-g++-maemo/qmake.conf @@ -10,8 +10,9 @@ CONFIG += nostrip QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../common/g++.conf) include(../common/linux.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) # Override the default lib/include directories for scratchbox: diff --git a/mkspecs/linux-g++/qmake.conf b/mkspecs/linux-g++/qmake.conf index d772b5e..00df894 100644 --- a/mkspecs/linux-g++/qmake.conf +++ b/mkspecs/linux-g++/qmake.conf @@ -9,6 +9,7 @@ CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../common/g++.conf) include(../common/linux.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) load(qt_config) diff --git a/mkspecs/linux-llvm/qmake.conf b/mkspecs/linux-llvm/qmake.conf index 77f8d81..17db1bb 100644 --- a/mkspecs/linux-llvm/qmake.conf +++ b/mkspecs/linux-llvm/qmake.conf @@ -9,6 +9,7 @@ CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../common/llvm.conf) include(../common/linux.conf) +include(../common/llvm.conf) +include(../common/gcc-base-unix.conf) load(qt_config) diff --git a/mkspecs/macx-g++/qmake.conf b/mkspecs/macx-g++/qmake.conf index 4464686..fd36b70 100644 --- a/mkspecs/macx-g++/qmake.conf +++ b/mkspecs/macx-g++/qmake.conf @@ -16,6 +16,7 @@ QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CC = gcc QMAKE_CXX = g++ -include(../common/mac-g++.conf) - +include(../common/mac.conf) +include(../common/gcc-base-mac.conf) +include(../common/g++-mac.conf) load(qt_config) diff --git a/mkspecs/macx-g++/qplatformdefs.h b/mkspecs/macx-g++/qplatformdefs.h index 99d64ef..5bdef57 100644 --- a/mkspecs/macx-g++/qplatformdefs.h +++ b/mkspecs/macx-g++/qplatformdefs.h @@ -39,59 +39,5 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H +#include "../common/mac/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 -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++40/qmake.conf b/mkspecs/macx-g++40/qmake.conf index 784f5fc..cfdd724 100644 --- a/mkspecs/macx-g++40/qmake.conf +++ b/mkspecs/macx-g++40/qmake.conf @@ -16,6 +16,8 @@ QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CC = gcc-4.0 QMAKE_CXX = g++-4.0 -include(../common/mac-g++.conf) +include(../common/mac.conf) +include(../common/gcc-base-mac.conf) +include(../common/g++-mac.conf) load(qt_config) diff --git a/mkspecs/macx-g++40/qplatformdefs.h b/mkspecs/macx-g++40/qplatformdefs.h index 99d64ef..5bdef57 100644 --- a/mkspecs/macx-g++40/qplatformdefs.h +++ b/mkspecs/macx-g++40/qplatformdefs.h @@ -39,59 +39,5 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H +#include "../common/mac/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 -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++42/qmake.conf b/mkspecs/macx-g++42/qmake.conf index fb93697..08305ba 100644 --- a/mkspecs/macx-g++42/qmake.conf +++ b/mkspecs/macx-g++42/qmake.conf @@ -16,6 +16,8 @@ QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CC = gcc-4.2 QMAKE_CXX = g++-4.2 -include(../common/mac-g++.conf) +include(../common/mac.conf) +include(../common/gcc-base-mac.conf) +include(../common/g++-mac.conf) load(qt_config) diff --git a/mkspecs/macx-g++42/qplatformdefs.h b/mkspecs/macx-g++42/qplatformdefs.h index 99d64ef..5bdef57 100644 --- a/mkspecs/macx-g++42/qplatformdefs.h +++ b/mkspecs/macx-g++42/qplatformdefs.h @@ -39,59 +39,5 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H +#include "../common/mac/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 -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-icc/qplatformdefs.h b/mkspecs/macx-icc/qplatformdefs.h index d46381c..5bdef57 100644 --- a/mkspecs/macx-icc/qplatformdefs.h +++ b/mkspecs/macx-icc/qplatformdefs.h @@ -39,5 +39,5 @@ ** ****************************************************************************/ -#include "../macx-g++/qplatformdefs.h" +#include "../common/mac/qplatformdefs.h" diff --git a/mkspecs/macx-llvm/qmake.conf b/mkspecs/macx-llvm/qmake.conf index d46baea..0064fb0 100644 --- a/mkspecs/macx-llvm/qmake.conf +++ b/mkspecs/macx-llvm/qmake.conf @@ -13,6 +13,8 @@ CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../common/mac-llvm.conf) +include(../common/mac.conf) +include(../common/llvm.conf) +include(../common/gcc-base-mac.conf) load(qt_config) diff --git a/mkspecs/macx-llvm/qplatformdefs.h b/mkspecs/macx-llvm/qplatformdefs.h index 99d64ef..5bdef57 100644 --- a/mkspecs/macx-llvm/qplatformdefs.h +++ b/mkspecs/macx-llvm/qplatformdefs.h @@ -39,59 +39,5 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H +#include "../common/mac/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 -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-xcode/qmake.conf b/mkspecs/macx-xcode/qmake.conf index 3a4a500..dc79b3d 100755 --- a/mkspecs/macx-xcode/qmake.conf +++ b/mkspecs/macx-xcode/qmake.conf @@ -9,10 +9,16 @@ TEMPLATE = app CONFIG += qt warn_on release lib_version_first incremental plugin_no_soname link_prl app_bundle QT += core gui -include(../common/mac-g++.conf) +include(../common/mac.conf) +include(../common/gcc-base-mac.conf) +include(../common/g++-mac.conf) -QMAKE_CC = -QMAKE_CXX = +QMAKE_CC = +QMAKE_CXX = +QMAKE_LINK = +QMAKE_LINK_C = +QMAKE_LINK_C_SHLIB = +QMAKE_LINK_SHLIB = QMAKE_CFLAGS_HIDESYMS = QMAKE_CFLAGS_PPC_64 = QMAKE_CFLAGS_X86_64 = diff --git a/mkspecs/macx-xcode/qplatformdefs.h b/mkspecs/macx-xcode/qplatformdefs.h index 99d64ef..5bdef57 100644 --- a/mkspecs/macx-xcode/qplatformdefs.h +++ b/mkspecs/macx-xcode/qplatformdefs.h @@ -39,59 +39,5 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H +#include "../common/mac/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 -#define QT_NO_LIBRARY_UNLOAD - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_IPV6IFNAME -#include -#endif - -#include "../common/posix/qplatformdefs.h" - -#undef QT_OPEN_LARGEFILE -#undef QT_SOCKLEN_T -#undef QT_SIGNAL_IGNORE - -#define QT_OPEN_LARGEFILE 0 - -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf - -#endif // QPLATFORMDEFS_H diff --git a/mkspecs/qws/linux-arm-g++/qmake.conf b/mkspecs/qws/linux-arm-g++/qmake.conf index 7e0a3b4..7b37813 100644 --- a/mkspecs/qws/linux-arm-g++/qmake.conf +++ b/mkspecs/qws/linux-arm-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf b/mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf index 3611421..e1ad837 100644 --- a/mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf +++ b/mkspecs/qws/linux-arm-gnueabi-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with arm-none-linux-gnueabi-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-armv6-g++/qmake.conf b/mkspecs/qws/linux-armv6-g++/qmake.conf index cd7ecca..0e2473c 100644 --- a/mkspecs/qws/linux-armv6-g++/qmake.conf +++ b/mkspecs/qws/linux-armv6-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building for ARMv6 devices with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-avr32-g++/qmake.conf b/mkspecs/qws/linux-avr32-g++/qmake.conf index 057c938..32c0444 100644 --- a/mkspecs/qws/linux-avr32-g++/qmake.conf +++ b/mkspecs/qws/linux-avr32-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with avr32-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-cellon-g++/qmake.conf b/mkspecs/qws/linux-cellon-g++/qmake.conf index 363a3ce..ad66c3c 100644 --- a/mkspecs/qws/linux-cellon-g++/qmake.conf +++ b/mkspecs/qws/linux-cellon-g++/qmake.conf @@ -6,8 +6,9 @@ # qmake configuration for building with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-dm7000-g++/qmake.conf b/mkspecs/qws/linux-dm7000-g++/qmake.conf index aea2647..c897091 100644 --- a/mkspecs/qws/linux-dm7000-g++/qmake.conf +++ b/mkspecs/qws/linux-dm7000-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for linux-dm7000-g++, for Dream Multimedia's DM7000S # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-dm800-g++/qmake.conf b/mkspecs/qws/linux-dm800-g++/qmake.conf index fca93b4..002e4c7 100644 --- a/mkspecs/qws/linux-dm800-g++/qmake.conf +++ b/mkspecs/qws/linux-dm800-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for linux-dm800-g++, for Dream Multimedia's DM800 # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-generic-g++-32/qmake.conf b/mkspecs/qws/linux-generic-g++-32/qmake.conf index 81af4ab..249c10aa 100644 --- a/mkspecs/qws/linux-generic-g++-32/qmake.conf +++ b/mkspecs/qws/linux-generic-g++-32/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-generic-g++/qmake.conf b/mkspecs/qws/linux-generic-g++/qmake.conf index a026e88..e803d0d 100644 --- a/mkspecs/qws/linux-generic-g++/qmake.conf +++ b/mkspecs/qws/linux-generic-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) load(qt_config) diff --git a/mkspecs/qws/linux-ipaq-g++/qmake.conf b/mkspecs/qws/linux-ipaq-g++/qmake.conf index 59f4e6e..f9d33b3 100644 --- a/mkspecs/qws/linux-ipaq-g++/qmake.conf +++ b/mkspecs/qws/linux-ipaq-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-lsb-g++/qmake.conf b/mkspecs/qws/linux-lsb-g++/qmake.conf index 8b66228..4b35925 100644 --- a/mkspecs/qws/linux-lsb-g++/qmake.conf +++ b/mkspecs/qws/linux-lsb-g++/qmake.conf @@ -3,10 +3,12 @@ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) + QMAKE_LSB = 1 # modifications to g++.conf diff --git a/mkspecs/qws/linux-mips-g++/qmake.conf b/mkspecs/qws/linux-mips-g++/qmake.conf index 3c55342..1a86078 100644 --- a/mkspecs/qws/linux-mips-g++/qmake.conf +++ b/mkspecs/qws/linux-mips-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with mipsel-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-powerpc-g++/qmake.conf b/mkspecs/qws/linux-powerpc-g++/qmake.conf index e1926b4..6a6310a 100644 --- a/mkspecs/qws/linux-powerpc-g++/qmake.conf +++ b/mkspecs/qws/linux-powerpc-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-sh-g++/qmake.conf b/mkspecs/qws/linux-sh-g++/qmake.conf index 61b57a3..004780a 100644 --- a/mkspecs/qws/linux-sh-g++/qmake.conf +++ b/mkspecs/qws/linux-sh-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building for SH devices with sh3-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-sh4al-g++/qmake.conf b/mkspecs/qws/linux-sh4al-g++/qmake.conf index 9caebdf..71f6b3d 100644 --- a/mkspecs/qws/linux-sh4al-g++/qmake.conf +++ b/mkspecs/qws/linux-sh4al-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building for SH4AL-DSP devices with sh3-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-sharp-g++/qmake.conf b/mkspecs/qws/linux-sharp-g++/qmake.conf index 083e4e8..6a000b9 100644 --- a/mkspecs/qws/linux-sharp-g++/qmake.conf +++ b/mkspecs/qws/linux-sharp-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-x86-g++/qmake.conf b/mkspecs/qws/linux-x86-g++/qmake.conf index 7e28d4e..55011ec 100644 --- a/mkspecs/qws/linux-x86-g++/qmake.conf +++ b/mkspecs/qws/linux-x86-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) load(qt_config) diff --git a/mkspecs/qws/linux-x86_64-g++/qmake.conf b/mkspecs/qws/linux-x86_64-g++/qmake.conf index d4e6189..e18d055 100644 --- a/mkspecs/qws/linux-x86_64-g++/qmake.conf +++ b/mkspecs/qws/linux-x86_64-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/qws/linux-zylonite-g++/qmake.conf b/mkspecs/qws/linux-zylonite-g++/qmake.conf index 97ae600..f50b70f 100644 --- a/mkspecs/qws/linux-zylonite-g++/qmake.conf +++ b/mkspecs/qws/linux-zylonite-g++/qmake.conf @@ -2,8 +2,9 @@ # qmake configuration for building with arm-linux-g++ # -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/qws.conf) # modifications to g++.conf diff --git a/mkspecs/symbian/linux-gcce/qmake.conf b/mkspecs/symbian/linux-gcce/qmake.conf index faac2f1..10d8ffd 100644 --- a/mkspecs/symbian/linux-gcce/qmake.conf +++ b/mkspecs/symbian/linux-gcce/qmake.conf @@ -4,7 +4,8 @@ include(../../common/symbian/symbian-makefile.conf) -include(../../common/g++.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) QMAKE_CC = arm-none-symbianelf-gcc QMAKE_CXX = arm-none-symbianelf-g++ diff --git a/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf b/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf index 28e7754..c362634 100644 --- a/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf +++ b/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf @@ -18,8 +18,9 @@ CONFIG += qt warn_on release incremental link_prl QT += core gui QMAKE_INCREMENTAL_STYLE = sublib -include(../../common/g++.conf) include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) # modifications to g++.conf QMAKE_CC = sb2 gcc diff --git a/mkspecs/unsupported/qnx-g++/qmake.conf b/mkspecs/unsupported/qnx-g++/qmake.conf index dfe9bed..83c4a26 100644 --- a/mkspecs/unsupported/qnx-g++/qmake.conf +++ b/mkspecs/unsupported/qnx-g++/qmake.conf @@ -10,7 +10,8 @@ TEMPLATE = app CONFIG += qt warn_on release link_prl QT += core gui -include(../common/g++.conf) +include(../common/gcc-base-unix.conf) +include(../common/g++-unix.conf) include(../common/unix.conf) QMAKE_CFLAGS_THREAD = -D_REENTRANT diff --git a/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf b/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf index 80b5f3e..7a77c81 100644 --- a/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf +++ b/mkspecs/unsupported/vxworks-ppc-g++/qmake.conf @@ -14,7 +14,8 @@ VXWORKS_ARCH = ppc VXWORKS_CPU = PPC32 VXWORKS_ARCH_MUNCH = ppc -include(../../common/g++.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/linux.conf) QMAKE_CC = cc$$VXWORKS_ARCH_MUNCH diff --git a/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf index 83f46c0..2a96a1a 100644 --- a/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf +++ b/mkspecs/unsupported/vxworks-simpentium-g++/qmake.conf @@ -14,7 +14,8 @@ VXWORKS_ARCH = simlinux VXWORKS_CPU = SIMLINUX VXWORKS_ARCH_MUNCH = pentium -include(../../common/g++.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) include(../../common/linux.conf) QMAKE_CC = cc$$VXWORKS_ARCH_MUNCH -- cgit v0.12 From 133f510ce7e310d3bbd6aeb57de510d491fe6022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Oct 2010 22:48:24 +0200 Subject: configure: Don't assume that QMAKE_CXX will be found at the start of line Change 86636e0c4ab introduced "isEmpty(QMAKE_CXX): QMAKE_CXX = g++" instead of "QMAKE_CXX = g++", which failed when configure was looking for QMAKE_CXX at the beginning of the line. We now allow either the beginning of the line or a space before QMAKE_CXX. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index bf81e26..f6f5cfb 100755 --- a/configure +++ b/configure @@ -3162,7 +3162,7 @@ else CFG_FRAMEWORK=no fi -QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1` +QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "\(^\|\s\)QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1` TEST_COMPILER="$CXX" [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER -- cgit v0.12 From 7f579703df80e54a61404702f854f91e2b33bb73 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 14 Oct 2010 09:46:38 +1000 Subject: Add new behavior example. --- .../declarative/animation/behaviors/wigglytext.qml | 108 +++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 examples/declarative/animation/behaviors/wigglytext.qml diff --git a/examples/declarative/animation/behaviors/wigglytext.qml b/examples/declarative/animation/behaviors/wigglytext.qml new file mode 100644 index 0000000..6cd93ab --- /dev/null +++ b/examples/declarative/animation/behaviors/wigglytext.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** 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:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: container + + property string text: "Drag this text..." + property bool animated: true + + width: 640; height: 480; color: "#474747"; focus: true + + Keys.onPressed: { + if (event.key == Qt.Key_Delete || event.key == Qt.Key_Backspace) + container.remove() + else if (event.text != "") { + container.append(event.text) + } + } + + function append(text) { + container.animated = false + var lastLetter = container.children[container.children.length - 1] + var newLetter = letterComponent.createObject(container) + newLetter.text = text + newLetter.follow = lastLetter + container.animated = true + } + + function remove() { + if (container.children.length) + container.children[container.children.length - 1].destroy() + } + + function doLayout() { + var follow = null + for (var i = 0; i < container.text.length; ++i) { + var newLetter = letterComponent.createObject(container) + newLetter.text = container.text[i] + newLetter.follow = follow + follow = newLetter + } + } + + Component { + id: letterComponent + Text { + id: letter + property variant follow + + x: follow ? follow.x + follow.width : container.width / 3 + y: follow ? follow.y : container.height / 2 + + font.pixelSize: 40; font.bold: true + color: "#999999"; styleColor: "#222222"; style: Text.Raised + + MouseArea { + anchors.fill: parent + drag.target: letter; drag.axis: Drag.XandYAxis + onPressed: letter.color = "#dddddd" + onReleased: letter.color = "#999999" + } + + Behavior on x { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } } + Behavior on y { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } } + } + } + + Component.onCompleted: doLayout() +} -- cgit v0.12 From d2a8898e4d42fcf2c4cb51e9117690ae1616e350 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 14 Oct 2010 10:01:14 +1000 Subject: Make minehunt less cheerful An instance of failure being improperly shown as victory was rectified. Task-number: QT-3956 --- demos/declarative/minehunt/minehunt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demos/declarative/minehunt/minehunt.cpp b/demos/declarative/minehunt/minehunt.cpp index 9c82f30..709d945 100644 --- a/demos/declarative/minehunt/minehunt.cpp +++ b/demos/declarative/minehunt/minehunt.cpp @@ -195,6 +195,7 @@ bool MinehuntGame::flip(int row, int col) won = false; hasWonChanged(); setPlaying(false); + return true; } remaining--; @@ -202,6 +203,7 @@ bool MinehuntGame::flip(int row, int col) won = true; hasWonChanged(); setPlaying(false); + return true; } return true; } @@ -209,7 +211,7 @@ bool MinehuntGame::flip(int row, int col) bool MinehuntGame::flag(int row, int col) { TileData *t = tile(row, col); - if(!t) + if(!t || !playing) return false; t->setHasFlag(!t->hasFlag()); -- cgit v0.12 From 5dc99c2de83860c39abe56f4ad5d445508a25dd3 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 14 Oct 2010 10:08:57 +1000 Subject: Fix samegame tutorial js Turns out that subtraction is not commutative. Who knew? Task-number: QTBUG-13532 --- examples/declarative/tutorials/samegame/samegame4/content/samegame.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index 79ff0c1..ccc3f9d 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -145,7 +145,7 @@ function shuffleDown() { obj = board[index(column, row)]; if (obj == null) continue; - obj.x = (fallDist - column) * gameCanvas.blockSize; + obj.x = (column - fallDist) * gameCanvas.blockSize; board[index(column - fallDist, row)] = obj; board[index(column, row)] = null; } -- cgit v0.12 From 6fb13041677f00884746e7bc36e2c73f3fc5c991 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 14 Oct 2010 13:04:37 +1000 Subject: TextInput autoscroll now scrolls when the cursor moves Previously needed some actual text changes to scroll, which is incorrect Task-number: QTBUG-14230 --- src/declarative/graphicsitems/qdeclarativetextinput.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp index 637dd77..0903427 100644 --- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp @@ -1464,6 +1464,7 @@ void QDeclarativeTextInputPrivate::init() void QDeclarativeTextInput::cursorPosChanged() { Q_D(QDeclarativeTextInput); + d->updateHorizontalScroll(); updateRect();//TODO: Only update rect between pos's updateMicroFocus(); emit cursorPositionChanged(); -- cgit v0.12 From 845aea67f6743c6bd095e68035985a31b56fb810 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 14 Oct 2010 13:48:29 +0100 Subject: Giving Qt a default app server when Avkon is removed Avkon provides a default app server when an app is started as a server app. This allows any app to be started as a server app. The Qt Avkon removal bypassed this, calling the base-class function instead, which prevented apps from starting as server app unless they explictly created a server. Now Qt also creates a default app server, which implements no services, so that any app can be started as a server app, even if Avkon is not present. This allows Symbian^4, configured with -no-s60, to boot. Task-number: QTBUG-14457 Reviewed-by: Jason Barron --- src/gui/s60framework/qs60mainapplication.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp index 74432af..24d2496 100644 --- a/src/gui/s60framework/qs60mainapplication.cpp +++ b/src/gui/s60framework/qs60mainapplication.cpp @@ -47,6 +47,9 @@ #include "qs60mainapplication.h" #include #include +#ifndef Q_WS_S60 +# include +#endif QT_BEGIN_NAMESPACE @@ -152,7 +155,11 @@ CDictionaryStore *QS60MainApplication::OpenIniFileLC(RFs &aFs) const */ void QS60MainApplication::NewAppServerL(CApaAppServer *&aAppServer) { +#ifdef Q_WS_S60 QS60MainApplicationBase::NewAppServerL(aAppServer); +#else + aAppServer = new(ELeave) CEikAppServer; +#endif } QT_END_NAMESPACE -- cgit v0.12 From 2c9ac0221562581b7d14c0b74b3f498725b5dff3 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 15 Oct 2010 11:16:25 +0200 Subject: tst_qdeclarativetext: Regenerate the baselines after the merge. This need to be checked. --- .../declarative/qdeclarativetext/data/alignments_cb.png | Bin 496 -> 529 bytes .../declarative/qdeclarativetext/data/alignments_cc.png | Bin 556 -> 550 bytes .../declarative/qdeclarativetext/data/alignments_ct.png | Bin 533 -> 565 bytes .../declarative/qdeclarativetext/data/alignments_lb.png | Bin 496 -> 522 bytes .../declarative/qdeclarativetext/data/alignments_lc.png | Bin 535 -> 541 bytes .../declarative/qdeclarativetext/data/alignments_lt.png | Bin 514 -> 558 bytes .../declarative/qdeclarativetext/data/alignments_rb.png | Bin 505 -> 530 bytes .../declarative/qdeclarativetext/data/alignments_rc.png | Bin 559 -> 550 bytes .../declarative/qdeclarativetext/data/alignments_rt.png | Bin 539 -> 564 bytes 9 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png index cf6199a..3f143d5 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_cb.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png index f81ccb4..c6e6250 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_cc.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png index 9ba6412..c54058f 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_ct.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png index 1b50a81..11715e9 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_lb.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png index f041b86..c27e5d8 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_lc.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png b/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png index c75e0d1..18694a9 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_lt.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png index b06a5da..010c6ae 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_rb.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png index e468857..2828bbc 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_rc.png differ diff --git a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png b/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png index 576715f..5cf3c03 100644 Binary files a/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png and b/tests/auto/declarative/qdeclarativetext/data/alignments_rt.png differ -- cgit v0.12 From 2e2e6e642494dca10b6d101088b8c5237d05f036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 8 Sep 2010 12:52:18 +0200 Subject: Don't assing 'const Foo*' to a 'Foo*' Reviewed-by: Olivier Goffart --- src/gui/dialogs/qfontdialog_mac.mm | 4 ++-- src/gui/kernel/qcocoamenuloader_mac.mm | 8 ++++---- src/gui/kernel/qcocoaview_mac.mm | 2 +- src/gui/kernel/qt_cocoa_helpers_mac.mm | 8 ++++---- src/gui/kernel/qwidget_mac.mm | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm index 9c63dfa..6fb363b 100644 --- a/src/gui/dialogs/qfontdialog_mac.mm +++ b/src/gui/dialogs/qfontdialog_mac.mm @@ -496,7 +496,7 @@ void QFontDialogPrivate::setFont(void *delegate, const QFont &font) QMacCocoaAutoReleasePool pool; QFontEngine *fe = font.d->engineForScript(QUnicodeTables::Common); NSFontManager *mgr = [NSFontManager sharedFontManager]; - NSFont *nsFont = 0; + const NSFont *nsFont = 0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if (qstrcmp(fe->name(), "CoreText") == 0) { @@ -522,7 +522,7 @@ void QFontDialogPrivate::setFont(void *delegate, const QFont &font) size:fontInfo.pointSize()]; } - [mgr setSelectedFont:nsFont isMultiple:NO]; + [mgr setSelectedFont:const_cast(nsFont) isMultiple:NO]; [static_cast(delegate) setQtFont:font]; } diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm index 8d38f45..6ee4277 100644 --- a/src/gui/kernel/qcocoamenuloader_mac.mm +++ b/src/gui/kernel/qcocoamenuloader_mac.mm @@ -70,13 +70,13 @@ QT_USE_NAMESPACE showAllItem = [[appMenu itemWithTitle:@"Show All"] retain]; // Get the names in the nib to match the app name set by Qt. - NSString *appName = reinterpret_cast(QCFString::toCFStringRef(qAppName())); + const NSString *appName = reinterpret_cast(QCFString::toCFStringRef(qAppName())); [quitItem setTitle:[[quitItem title] stringByReplacingOccurrencesOfString:@"NewApplication" - withString:appName]]; + withString:const_cast(appName)]]; [hideItem setTitle:[[hideItem title] stringByReplacingOccurrencesOfString:@"NewApplication" - withString:appName]]; + withString:const_cast(appName)]]; [aboutItem setTitle:[[aboutItem title] stringByReplacingOccurrencesOfString:@"NewApplication" - withString:appName]]; + withString:const_cast(appName)]]; [appName release]; // Disable the items that don't do anything. If someone associates a QAction with them // They should get synced back in. diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 2016d40..49f7d7f 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1417,7 +1417,7 @@ static int qCocoaViewCount = 0; if (!selectedText.isEmpty()) { QCFString string(selectedText.mid(theRange.location, theRange.length)); const NSString *tmpString = reinterpret_cast((CFStringRef)string); - return [[[NSAttributedString alloc] initWithString:tmpString] autorelease]; + return [[[NSAttributedString alloc] initWithString:const_cast(tmpString)] autorelease]; } else { return nil; } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index cce9daa..5a522f9 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1365,11 +1365,11 @@ QString qt_mac_get_pasteboardString(OSPasteboardRef paste) QMacCocoaAutoReleasePool pool; NSPasteboard *pb = nil; CFStringRef pbname; - if (PasteboardCopyName (paste, &pbname)) { - pb = [NSPasteboard generalPasteboard]; + if (PasteboardCopyName(paste, &pbname) == noErr) { + pb = [NSPasteboard pasteboardWithName:const_cast(reinterpret_cast(pbname))]; + CFRelease(pbname); } else { - pb = [NSPasteboard pasteboardWithName:reinterpret_cast(pbname)]; - CFRelease (pbname); + pb = [NSPasteboard generalPasteboard]; } if (pb) { NSString *text = [pb stringForType:NSStringPboardType]; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 5e41efa..017541c 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3176,7 +3176,7 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset) if (iconButton == nil) { QCFString string(q->windowTitle()); const NSString *tmpString = reinterpret_cast((CFStringRef)string); - [qt_mac_window_for(q) setRepresentedURL:[NSURL fileURLWithPath:tmpString]]; + [qt_mac_window_for(q) setRepresentedURL:[NSURL fileURLWithPath:const_cast(tmpString)]]; iconButton = [qt_mac_window_for(q) standardWindowButton:NSWindowDocumentIconButton]; } if (icon.isNull()) { -- cgit v0.12 From 24e0f64b8a35ddbfeae2f0611d3f1779fb56cdb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 8 Sep 2010 12:52:50 +0200 Subject: Explicitly inherit QNSOpenSavePanelDelegate from NSOpenSavePanelDelegate Reviewed-by: Olivier Goffart --- src/gui/dialogs/qfiledialog_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index 87850a7..0a0ed9e 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -84,7 +84,7 @@ QT_USE_NAMESPACE @class QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate); -@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) : NSObject { +@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) : NSObject { @public NSOpenPanel *mOpenPanel; NSSavePanel *mSavePanel; -- cgit v0.12 From 873065d0c93616e6cda08daf8ba7fbef2ab139b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 8 Sep 2010 12:53:20 +0200 Subject: Don't redeclare voidPtr, it's already declared in CarbonCore's Thread.h Reviewed-by: Olivier Goffart --- src/opengl/qwindowsurface_gl.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 8157b2a..848d3a3 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -355,12 +355,12 @@ void QGLWindowSurface::deleted(QObject *object) QWidgetPrivate *widgetPrivate = widget->d_func(); if (widgetPrivate->extraData()) { - union { QGLContext **ctxPtr; void **voidPtr; }; - voidPtr = &widgetPrivate->extraData()->glContext; - int index = d_ptr->contexts.indexOf(ctxPtr); + union { QGLContext **ctxPtrPtr; void **voidPtrPtr; }; + voidPtrPtr = &widgetPrivate->extraData()->glContext; + int index = d_ptr->contexts.indexOf(ctxPtrPtr); if (index != -1) { - delete *ctxPtr; - *ctxPtr = 0; + delete *ctxPtrPtr; + *ctxPtrPtr = 0; d_ptr->contexts.removeAt(index); } } @@ -398,12 +398,12 @@ void QGLWindowSurface::hijackWindow(QWidget *widget) widgetPrivate->extraData()->glContext = ctx; - union { QGLContext **ctxPtr; void **voidPtr; }; + union { QGLContext **ctxPtrPtr; void **voidPtrPtr; }; connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(deleted(QObject*))); - voidPtr = &widgetPrivate->extraData()->glContext; - d_ptr->contexts << ctxPtr; + voidPtrPtr = &widgetPrivate->extraData()->glContext; + d_ptr->contexts << ctxPtrPtr; qDebug() << "hijackWindow() context created for" << widget << d_ptr->contexts.size(); } -- cgit v0.12 From efa0b410703898cb78d48d62ef7d389be2e87a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 8 Sep 2010 12:50:35 +0200 Subject: Don't use 'id' as variable name, it has special meaning in Objctive-C Reviewed-by: Olivier Goffart --- src/plugins/bearer/corewlan/qcorewlanengine.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 844e38b..db577fd 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -850,7 +850,7 @@ quint64 QCoreWlanEngine::bytesReceived(const QString &id) return getBytes(interfaceStr,true); } -quint64 QCoreWlanEngine::startTime(const QString &id) +quint64 QCoreWlanEngine::startTime(const QString &identifier) { QMutexLocker locker(&mutex); QMacCocoaAutoReleasePool pool; @@ -885,7 +885,7 @@ quint64 QCoreWlanEngine::startTime(const QString &id) for(int i = 0; i < dictSize; i++) { if([ssidStr isEqualToString:keys[i]]) { const QString ident = QString::number(qHash(QLatin1String("corewlan:") + qt_mac_NSStringToQString(objects[i]))); - if(ident == id) { + if(ident == identifier) { ok = true; } } -- cgit v0.12 From 3cba3745ac2f2cf616d341f2982c22e9809e1725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 19 Sep 2010 11:40:32 +0200 Subject: Phonon: Export ObjectDescriptionModel to prevent link errors with Clang Workaround for http://llvm.org/bugs/show_bug.cgi?id=8177 --- src/3rdparty/phonon/phonon/objectdescriptionmodel.h | 3 ++- src/corelib/global/qglobal.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h index 8fd622f..d994600 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h @@ -141,10 +141,11 @@ namespace Phonon /* Required to ensure template class vtables are exported on both symbian and existing builds. */ -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) +#if (defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)) || defined(Q_CC_CLANG) // RVCT compiler (2.2.686) requires the export declaration to be on the class to export vtables // MWC compiler works both ways // GCCE compiler is unknown (it can't compile QtCore yet) +// Clang also requires the export declaration to be on the class to export vtables #define PHONON_TEMPLATE_CLASS_EXPORT PHONON_EXPORT #define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT #else diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1b2a6a8..b983132 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -356,6 +356,7 @@ namespace QT_NAMESPACE {} GCCE - GCCE (Symbian GCCE builds) RVCT - ARM Realview Compiler Suite NOKIAX86 - Nokia x86 (Symbian WINSCW builds) + CLANG - C++ front-end for the LLVM compiler Should be sorted most to least authoritative. @@ -452,6 +453,10 @@ namespace QT_NAMESPACE {} # define Q_CC_INTEL # define Q_NO_TEMPLATE_FRIENDS # endif +# if defined(__clang__) +/* Clang also masquerades as GCC 4.2.1 */ +# define Q_CC_CLANG +# endif # ifdef __APPLE__ # define Q_NO_DEPRECATED_CONSTRUCTORS # endif -- cgit v0.12 From e6b74347dd64b87473a812926379d91786ced972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Oct 2010 20:40:47 +0200 Subject: Don't assign id to NSObject*, use id instead Reviewed-by: Olivier Goffart --- src/gui/kernel/qapplication_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index c3f3e74..e5364d0 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1246,7 +1246,7 @@ void qt_init(QApplicationPrivate *priv, int) qt_redirectNSApplicationSendEvent(); QMacCocoaAutoReleasePool pool; - NSObject *oldDelegate = [cocoaApp delegate]; + id oldDelegate = [cocoaApp delegate]; QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) *newDelegate = [QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate]; Q_ASSERT(newDelegate); [newDelegate setQtPrivate:priv]; -- cgit v0.12 From 08b716363ef16bf31d2d9df103a5904bf15bbb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 8 Sep 2010 12:54:01 +0200 Subject: Rename a few QtScript debugger-classes in anonymouse namespaces Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=8192 Reviewed-by: Kent Hansen Reviewed-by: Olivier Goffart --- src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp | 8 ++++---- src/scripttools/debugging/qscriptdebugoutputwidget.cpp | 8 ++++---- src/scripttools/debugging/qscripterrorlogwidget.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp b/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp index 5db012a..d0559c5 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsolewidget.cpp @@ -163,10 +163,10 @@ private: InputEdit *inputEdit; }; -class OutputEdit : public QPlainTextEdit +class QScriptDebuggerConsoleWidgetOutputEdit : public QPlainTextEdit { public: - OutputEdit(QWidget *parent = 0) + QScriptDebuggerConsoleWidgetOutputEdit(QWidget *parent = 0) : QPlainTextEdit(parent) { setFrameShape(QFrame::NoFrame); @@ -206,7 +206,7 @@ public: void _q_onCompletionTaskFinished(); CommandLine *commandLine; - OutputEdit *outputEdit; + QScriptDebuggerConsoleWidgetOutputEdit *outputEdit; int historyIndex; QString newInput; }; @@ -320,7 +320,7 @@ QScriptDebuggerConsoleWidget::QScriptDebuggerConsoleWidget(QWidget *parent) Q_D(QScriptDebuggerConsoleWidget); d->commandLine = new CommandLine(); d->commandLine->setPrompt(QString::fromLatin1("qsdb>")); - d->outputEdit = new OutputEdit(); + d->outputEdit = new QScriptDebuggerConsoleWidgetOutputEdit(); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setSpacing(0); vbox->setMargin(0); diff --git a/src/scripttools/debugging/qscriptdebugoutputwidget.cpp b/src/scripttools/debugging/qscriptdebugoutputwidget.cpp index 3bca96c..594a9dc 100644 --- a/src/scripttools/debugging/qscriptdebugoutputwidget.cpp +++ b/src/scripttools/debugging/qscriptdebugoutputwidget.cpp @@ -51,10 +51,10 @@ QT_BEGIN_NAMESPACE namespace { -class OutputEdit : public QPlainTextEdit +class QScriptDebugOutputWidgetOutputEdit : public QPlainTextEdit { public: - OutputEdit(QWidget *parent = 0) + QScriptDebugOutputWidgetOutputEdit(QWidget *parent = 0) : QPlainTextEdit(parent) { setReadOnly(true); @@ -85,7 +85,7 @@ public: QScriptDebugOutputWidgetPrivate(); ~QScriptDebugOutputWidgetPrivate(); - OutputEdit *outputEdit; + QScriptDebugOutputWidgetOutputEdit *outputEdit; }; QScriptDebugOutputWidgetPrivate::QScriptDebugOutputWidgetPrivate() @@ -100,7 +100,7 @@ QScriptDebugOutputWidget::QScriptDebugOutputWidget(QWidget *parent) : QScriptDebugOutputWidgetInterface(*new QScriptDebugOutputWidgetPrivate, parent, 0) { Q_D(QScriptDebugOutputWidget); - d->outputEdit = new OutputEdit(); + d->outputEdit = new QScriptDebugOutputWidgetOutputEdit(); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setMargin(0); vbox->setSpacing(0); diff --git a/src/scripttools/debugging/qscripterrorlogwidget.cpp b/src/scripttools/debugging/qscripterrorlogwidget.cpp index 735c546..fd9a939 100644 --- a/src/scripttools/debugging/qscripterrorlogwidget.cpp +++ b/src/scripttools/debugging/qscripterrorlogwidget.cpp @@ -52,10 +52,10 @@ QT_BEGIN_NAMESPACE namespace { -class OutputEdit : public QTextEdit +class QScriptErrorLogWidgetOutputEdit : public QTextEdit { public: - OutputEdit(QWidget *parent = 0) + QScriptErrorLogWidgetOutputEdit(QWidget *parent = 0) : QTextEdit(parent) { setReadOnly(true); @@ -80,7 +80,7 @@ public: QScriptErrorLogWidgetPrivate(); ~QScriptErrorLogWidgetPrivate(); - OutputEdit *outputEdit; + QScriptErrorLogWidgetOutputEdit *outputEdit; }; QScriptErrorLogWidgetPrivate::QScriptErrorLogWidgetPrivate() @@ -95,7 +95,7 @@ QScriptErrorLogWidget::QScriptErrorLogWidget(QWidget *parent) : QScriptErrorLogWidgetInterface(*new QScriptErrorLogWidgetPrivate, parent, 0) { Q_D(QScriptErrorLogWidget); - d->outputEdit = new OutputEdit(); + d->outputEdit = new QScriptErrorLogWidgetOutputEdit(); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setMargin(0); vbox->setSpacing(0); -- cgit v0.12 From 9c93d0de104bfc591def1a2ce8d477ea0a1d62eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 14 Oct 2010 18:22:34 +0200 Subject: Apply WebKit revision 60451 manually to fix Clang build issue https://bugs.webkit.org/show_bug.cgi?id=39945 This revision is already present in QtWebKit 2.1 --- src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.h b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.h index 40f7e40..0df23a2 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.h +++ b/src/3rdparty/webkit/WebCore/bindings/js/JSDOMBinding.h @@ -225,7 +225,7 @@ namespace WebCore { { if (!node) return JSC::jsNull(); - if (JSNode* wrapper = getCachedDOMNodeWrapper(exec, node->document(), node)) + if (JSC::JSCell* wrapper = getCachedDOMNodeWrapper(exec, node->document(), node)) return wrapper; return createDOMNodeWrapper(exec, globalObject, node); } -- cgit v0.12 From dfe9084344d73d59f4569c8be6104ce83ae0df95 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 15 Oct 2010 14:56:03 +0200 Subject: removed obsolete -qt-gif configure option Since "-system-gif" is not offered, offering "-qt-gif" is unnecessary and perhaps misleading. By default the GIF handler is built from code included with Qt, unless suppressed by "-no-gif". Merge-request: 859 Reviewed-by: Oswald Buddenhagen --- configure | 7 ++----- tools/configure/configureapp.cpp | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/configure b/configure index f6f5cfb..5539851 100755 --- a/configure +++ b/configure @@ -1556,8 +1556,7 @@ while [ "$#" -gt 0 ]; do fi ;; gif) - [ "$VAL" = "qt" ] && VAL=auto - if [ "$VAL" = "auto" ] || [ "$VAL" = "no" ]; then + if [ "$VAL" = "no" ]; then CFG_GIF="$VAL" else UNKNOWN_OPT=yes @@ -3541,7 +3540,7 @@ Usage: $relconf [-h] [-prefix ] [-prefix-install] [-bindir ] [-libdir [-accessibility] [-no-stl] [-stl] [-no-sql-] [-sql-] [-plugin-sql-] [-system-sqlite] [-no-qt3support] [-qt3support] [-platform] [-D ] [-I ] [-L ] [-help] - [-qt-zlib] [-system-zlib] [-no-gif] [-qt-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff] + [-qt-zlib] [-system-zlib] [-no-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff] [-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng] [-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make ] [-nomake ] [-R ] [-l ] [-no-rpath] [-rpath] [-continue] @@ -3769,8 +3768,6 @@ Third Party Libraries: See http://www.gzip.org/zlib -no-gif ............ Do not compile GIF reading support. - * -qt-gif ............ Compile GIF reading support. - See also src/gui/image/qgifhandler_p.h -no-libtiff ........ Do not compile TIFF support. -qt-libtiff ........ Use the libtiff bundled with Qt. diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 31c115a..3ca57b4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -590,8 +590,6 @@ void Configure::parseCmdLine() // Image formats -------------------------------------------- else if (configCmdLine.at(i) == "-no-gif") dictionary[ "GIF" ] = "no"; - else if (configCmdLine.at(i) == "-qt-gif") - dictionary[ "GIF" ] = "plugin"; else if (configCmdLine.at(i) == "-no-libtiff") { dictionary[ "TIFF"] = "no"; @@ -1642,7 +1640,7 @@ bool Configure::displayHelp() "[-no-qmake] [-qmake] [-dont-process] [-process]\n" "[-no-style-