Changeset 561 for trunk/tools/qvfb/qvfb.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/qvfb/qvfb.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the tools applications of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 42 42 #include "qvfb.h" 43 43 #include "qvfbview.h" 44 #include "qvfbhdr.h" 44 45 #ifdef Q_WS_X11 45 46 #include "qvfbx11view.h" … … 135 136 static bool copyButtonConfiguration(const QString &prefix, int displayId) 136 137 { 137 const QString destDir = Q String(QLatin1String("/tmp/qtembedded-%1/")).arg(displayId);138 const QString destDir = QT_VFB_DATADIR(displayId).append("/"); 138 139 const QFileInfo src(prefix + QLatin1String("defaultbuttons.conf")); 139 140 const QFileInfo dst(destDir + QLatin1String("defaultbuttons.conf")); … … 218 219 rateDlg = 0; 219 220 refreshRate = 30; 220 #if QT_VERSION >= 0x030000 221 // When compiling with Qt 3 we need to create the menu first to 222 // avoid scroll bars in the main window 221 // Create the menu first to avoid scroll bars in the main window 223 222 createMenu( menuBar() ); 224 223 init( display_id, w, h, d, r, skin ); 225 224 enableCursor( true ); 226 #else227 init( display_id, w, h, d, r, skin );228 createMenu( menuBar() );229 #endif230 225 } 231 226 … … 355 350 view->setContentsMargins( 0, 0, 0, 0 ); 356 351 setCentralWidget(scroller); 357 #if QT_VERSION >= 0x030000358 352 ph += 2; // avoid scrollbar 359 #endif360 353 scroller->show(); 361 354 // delete defaultbuttons.conf if it was left behind... 362 unlink(QFileInfo(QString("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId())).absoluteFilePath().toLatin1().constData());355 unlink(QFileInfo(QT_VFB_DATADIR(view->displayId()).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData()); 363 356 if (secondaryView) 364 unlink(QFileInfo(Q String("/tmp/qtembedded-%1/defaultbuttons.conf").arg(view->displayId()+1)).absoluteFilePath().toLatin1().constData());357 unlink(QFileInfo(QT_VFB_DATADIR(view->displayId() + 1).append("/defaultbuttons.conf")).absoluteFilePath().toLatin1().constData()); 365 358 } 366 359 view->setRate(refreshRate); … … 644 637 config->lcdScreen->setChecked(view->lcdScreenEmulation()); 645 638 chooseDepth(view->displayDepth(), view->displayFormat()); 639 config->rgbSwapped->setChecked(view->rgbSwapped()); 646 640 connect(config->skin, SIGNAL(activated(int)), this, SLOT(skinConfigChosen(int))); 647 641 if ( view->gammaRed() == view->gammaGreen() && view->gammaGreen() == view->gammaBlue() ) { … … 676 670 } else if ( config->size_640_480->isChecked() ) { 677 671 w=640; h=480; 672 } else if ( config->size_800_480->isChecked() ) { 673 w=800; h=480; 678 674 } else if ( config->size_800_600->isChecked() ) { 679 675 w=800; h=600; … … 687 683 if ( config->depth_1->isChecked() ) 688 684 d=1; 685 else if ( config->depth_2gray->isChecked() ) 686 d=2; 689 687 else if ( config->depth_4gray->isChecked() ) 690 688 d=4; … … 717 715 view->setViewFormat(displayFormat); 718 716 view->setTouchscreenEmulation( config->touchScreen->isChecked() ); 717 if (view->rgbSwapped() != config->rgbSwapped->isChecked()) { 718 //### the windowTitle logic is inside init(), and init isn't always invoked 719 QString caption = windowTitle(); 720 if (!config->rgbSwapped->isChecked()) 721 caption.replace(QLatin1String(" BGR"), QString()); 722 else 723 caption.append(QLatin1String(" BGR")); 724 setWindowTitle(caption); 725 view->setRgbSwapped(config->rgbSwapped->isChecked()); 726 } 719 727 bool lcdEmulation = config->lcdScreen->isChecked(); 720 728 view->setLcdScreenEmulation( lcdEmulation ); … … 743 751 config->size_320_240->setChecked(sz == QSize(320,240)); 744 752 config->size_640_480->setChecked(sz == QSize(640,480)); 753 config->size_800_480->setChecked(sz == QSize(800,480)); 745 754 config->size_800_600->setChecked(sz == QSize(800,600)); 746 755 config->size_1024_768->setChecked(sz == QSize(1024,768)); … … 750 759 { 751 760 config->depth_1->setChecked(depth==1); 761 config->depth_2gray->setChecked(depth==2); 752 762 config->depth_4gray->setChecked(depth==4); 753 763 config->depth_8->setChecked(depth==8);
Note:
See TracChangeset
for help on using the changeset viewer.