VirtualBox

Changeset 7220 in vbox


Ignore:
Timestamp:
Feb 29, 2008 3:35:29 PM (17 years ago)
Author:
vboxsync
Message:

Compile VirtualBox with qt4 on linux.

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
60 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk

    r7177 r7220  
    3838DEPTH = ../../../..
    3939include $(PATH_KBUILD)/header.kmk
     40
     41# Disable the debugger for now, this is another story.
     42VBOX_WITH_DEBUGGER_GUI :=
     43DEFS := $(filter-out VBOX_WITH_DEBUGGER_GUI,$(DEFS))
     44
     45# Handmade configuration of qt4
     46VBOX_PATH_QT4 = /usr
     47VBOX_MODULE_QT4 = QtCore QtGui QtNetwork Qt3Support
     48VBOX_DEFS_QT4 = QT_CORE_LIB QT_GUI_LIB QT_NETWORK_LIB QT_QT3SUPPORT_LIB
     49VBOX_INCS_QT4 = $(VBOX_PATH_QT4)/share/qt4/mkspecs/linux-g++ $(foreach mod, $(VBOX_MODULE_QT4), $(join $(VBOX_PATH_QT4)/include/qt4/, $(mod))) $(VBOX_PATH_QT4)/include/qt4/Qt $(VBOX_PATH_QT4)/include/qt4
     50VBOX_LIBS_QT4 = $(VBOX_MODULE_QT4)
     51VBOX_LIBPATH_QT4 =  $(VBOX_MODULE_QT4)/lib
     52
     53# Moc knows ifdefs now
     54VBOX_MOCDEF_QT4 = -DQ_WS_X11
     55
     56# Warn about all what you know about porting qt3->qt4.
     57# Disable this if you like to see something on your screen.
     58VBOX_DEFS_QT4 += QT3_SUPPORT_WARNINGS
     59# Some default defs
     60VBOX_DEFS_QT4 += QT3_SUPPORT QT_SHARED HAVE_CONFIG_H QT_NO_DEBUG
     61
     62VBOX_UIC4      := $(VBOX_PATH_QT4)/bin/uic3
     63VBOX_MOC4      := $(VBOX_PATH_QT4)/bin/moc
     64VBOX_LUPDATE4  := $(VBOX_PATH_QT4)/bin/lupdate
     65VBOX_LRELEASE4 := $(VBOX_PATH_QT4)/bin/lrelease
     66
     67# Template copy from the qt3 stuff. Appended a "4" on the
     68# relevant places.
     69
     70#
     71# Template for building Qt GUI executables.
     72#
     73
     74TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
     75TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS) $(VBOX_DEFS_QT4)
     76TEMPLATE_VBOXQT4GUIEXE_INCS = \
     77        $(VBOX_PATH_SDK)/include \
     78    $(VBOX_INCS_QT4)
     79
     80ifeq ($(BUILD_TARGET),win)
     81 # drag in library configuration (we need QMAKE_PRL_DEFINES)
     82 ifneq ($(LIB_QT_PRL),)
     83  include $(LIB_QT_PRL)
     84 endif
     85 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
     86 TEMPLATE_VBOXQT4GUIEXE_DEFS += \
     87    _WIN32_WINNT=0x0500 UNICODE _UNICODE \
     88    QT_DLL _CRT_SECURE_NO_DEPRECATE \
     89    $(QMAKE_PRL_DEFINES)
     90 ## @todo VCC70 flags?
     91 ifdef VBOX_USE_VCC80
     92  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
     93        -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
     94  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
     95 else
     96  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
     97        -nologo -Zm200 -W3 -MD -Zi -GX
     98  TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
     99 endif
     100 TEMPLATE_VBOXQT4GUIEXE_INCS += \
     101        $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
     102 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
     103        /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
     104        /DELAYLOAD:oleaut32.dll
     105 TEMPLATE_VBOXQT4GUIEXE_SDKS = WINPSDK
     106 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
     107        $(LIB_QT) \
     108        $(LIB_QTMAIN) \
     109        $(LIB_RUNTIME) \
     110        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
     111        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
     112        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
     113        $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
     114        $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
     115 TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
     116
     117else # the gcc guys:
     118 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
     119 TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
     120   
     121 TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
     122
     123 TEMPLATE_VBOXQT4GUIEXE_INCS += \
     124        $(LIB_SDL_INC)
     125 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
     126        -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
     127        -Wno-long-long -fshort-wchar -fno-strict-aliasing \
     128        $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
     129 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
     130 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
     131 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
     132 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
     133 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
     134 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
     135        $(VBOX_LIBS_QT4) \
     136        $(LIB_SDL) \
     137        $(LIB_RUNTIME) \
     138        $(LIB_REM) \
     139        $(LIB_VMM)
     140
     141 ifeq ($(BUILD_TARGET_ARCH),amd64)
     142  TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
     143        $(VBOX_PATH_QT4)/lib64/qt4 $(VBOX_PATH_QT4)/lib/qt4
     144 else
     145  TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
     146        $(VBOX_PATH_QT4)/lib/qt4
     147 endif
     148
     149 ifeq ($(BUILD_TARGET),linux)
     150  TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
     151 else ifeq ($(BUILD_TARGET),darwin)
     152  TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
     153  TEMPLATE_VBOXQT4GUIEXE_LIBS +=
     154  TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
     155 else ifeq ($(BUILD_TARGET),os2)
     156  # drag in library configuration (we need QMAKE_PRL_DEFINES)
     157  ifneq ($(LIB_QT_PRL),)
     158   include $(LIB_QT_PRL)
     159  endif
     160  TEMPLATE_VBOXQT4GUIEXE_DEFS += $(QMAKE_PRL_DEFINES)
     161  TEMPLATE_VBOXQT4GUIEXE_LIBS +=
     162  TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
     163 else
     164  TEMPLATE_VBOXQT4GUIEXE_INCS += \
     165        $(VBOX_XCURSOR_INCS)
     166  TEMPLATE_VBOXQT4GUIEXE_LIBS += \
     167    $(VBOX_XCURSOR_LIBS) \
     168        Xext \
     169        X11 \
     170        m \
     171        $(LIB_PTHREAD)
     172  TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
     173        $(VBOX_LIBPATH_X11)
     174  ifeq ($(BUILD_TARGET),freebsd)
     175   TEMPLATE_VBOXQT4GUIEXE_INCS += \
     176        /usr/include \
     177        /usr/X11R6/include \
     178        /usr/local/include
     179  endif
     180  ifeq ($(BUILD_TARGET),solaris)
     181   TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '-R$$(VBOX_ORIGIN):$$(VBOX_ORIGIN)/qtgcc/lib'
     182   TEMPLATE_VBOXQT4GUIEXE_LIBS += \
     183        rt socket nsl
     184  endif
     185 endif
     186
     187endif
     188
     189# Add COM/XPCOM stuff
     190TEMPLATE_VBOXQT4GUIEXE_LIBS            += \
     191        $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
     192ifdef VBOX_WITH_XPCOM
     193 ## @todo may be worth creating the VBOX_XPCOM SDK def
     194 TEMPLATE_VBOXQT4GUIEXE_DEFS            += VBOX_WITH_XPCOM
     195 TEMPLATE_VBOXQT4GUIEXE_INCS            += \
     196        $(VBOX_XPCOM_INCS)
     197 TEMPLATE_VBOXQT4GUIEXE_LIBS            += \
     198        $(LIB_XPCOM)
     199 VBOX_MOCDEF_QT4 += -DVBOX_WITH_XPCOM
     200endif
     201
     202#
     203# Template for building Qt GUI components.
     204#
     205TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
     206TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
     207TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
     208ifeq ($(BUILD_TARGET),darwin)
     209 TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
     210endif
     211ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
     212 ifneq ($(BUILD_TARGET),win)
     213  TEMPLATE_VBOXQT4GUI_DEFS     = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
     214  TEMPLATE_VBOXQT4GUI_CFLAGS   = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
     215  TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
     216  TEMPLATE_VBOXQT4GUI_LDFLAGS  = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
     217 endif
     218endif
    40219
    41220
     
    120299# VirtualBox - The GUI program.
    121300#
    122 VirtualBox_TEMPLATE = VBOXQTGUIEXE
     301VirtualBox_TEMPLATE = VBOXQT4GUIEXE
    123302VirtualBox_SDKS.win = WINPSDK DXSDK
    124303#ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(BUILD_TARGET)),) - later
     
    199378        $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
    200379        $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
    201         $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
     380#       $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
    202381
    203382# All generated headers. Note: this list MUST be in sync with Qt source
     
    467646        $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
    468647        $$(QUIET)$$(MKDIR) -p $$(@D)
    469         $$(QUIET)$$(VBOX_MOC) $(mochdr) -o $$@
     648        $$(QUIET)$$(VBOX_MOC4) $(VBOX_MOCDEF_QT4) $(mochdr) -o $$@
    470649
    471650endef
     
    488667        $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
    489668        $$(QUIET)$$(MKDIR) -p $$(@D)
    490         $$(QUIET)$$(VBOX_MOC) -i $(mocsrc) -o $$@
     669        $$(QUIET)$$(VBOX_MOC4) $(VBOX_MOCDEF_QT4) -i $(mocsrc) -o $$@
    491670
    492671endef
     
    509688        $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
    510689        $$(QUIET)$$(MKDIR) -p $$(@D)
    511         $$(QUIET)$$(VBOX_MOC) -i $(mocuihdr) -o $$@
     690        $$(QUIET)$$(VBOX_MOC4) $(VBOX_MOCDEF_QT4) -i $(mocuihdr) -o $$@
    512691
    513692endef
     
    528707$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
    529708        $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
    530         $$(QUIET)$$(VBOX_UIC) $(uifile) -o $$@
     709        $$(QUIET)$$(VBOX_UIC4) $(uifile) -o $$@
    531710
    532711$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
    533712        $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
    534         $$(QUIET)$$(VBOX_UIC) $(uifile) -i $(uihdr) -o $$@
     713        $$(QUIET)$$(VBOX_UIC4) -impl $(uihdr) $(uifile) -o $$@
     714
     715#$$(QUIET)$$(VBOX_UIC4) $(uifile) -i $(uihdr) -o $$@
    535716
    536717$(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
    537718        $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
    538         $$(QUIET)$$(VBOX_MOC) $(uihdr) -o $$@
     719        $$(QUIET)$$(VBOX_MOC4) $(VBOX_MOCDEF_QT4) $(uihdr) -o $$@
    539720
    540721endef
     
    558739$(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
    559740        $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
    560         $$(QUIET)$$(VBOX_LRELEASE) -nocompress $(tsfile) -qm $$@
     741        $$(QUIET)$$(VBOX_LRELEASE4) -nocompress $(tsfile) -qm $$@
    561742
    562743endef
     
    612793# static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES
    613794
    614 $(PATH_VirtualBox)/ui/vbox_image_collection.txt: VBoxUI.pro $(VirtualBox_QT_IMAGES)
    615         $(RM) -f $@
    616         $(APPEND) -v $@ VirtualBox_QT_IMAGES
    617 
    618 $(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
    619         $(call MSG_TOOL,uic,VirtualBox,$<,$@)
    620         $(QUIET)$(VBOX_UIC) -o $@ -embed VBoxGUI -f $<
    621 
    622 VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
    623 OTHER_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.txt
     795#$(PATH_VirtualBox)/ui/vbox_image_collection.txt: VBoxUI.pro $(VirtualBox_QT_IMAGES)
     796#       $(RM) -f $@
     797#       $(APPEND) -v $@ VirtualBox_QT_IMAGES
     798#
     799#$(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
     800#       $(call MSG_TOOL,uic,VirtualBox,$<,$@)
     801#       $(QUIET)$(VBOX_UIC4) -o $@ -embed VBoxGUI -f $<
     802#
     803#VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
     804#OTHER_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.txt
    624805
    625806
     
    650831updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
    651832        $(call MSG_L1,lupdate all languages (nls/*.ts))
    652         $(QUIET)$(VBOX_LUPDATE) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
     833        $(QUIET)$(VBOX_LUPDATE4) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
    653834
    654835
  • trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h

    r7207 r7220  
    7979#include <qstring.h>
    8080#include <quuid.h>
    81 #include <qvaluevector.h>
     81#include <q3valuevector.h>
    8282
    8383#include <iprt/memory> // for auto_copy_ptr
     
    225225
    226226    template <typename QT, typename CT>
    227     static void ToSafeArray (const QValueVector <QT> &aVec, com::SafeArray <CT> &aArr)
     227    static void ToSafeArray (const Q3ValueVector <QT> &aVec, com::SafeArray <CT> &aArr)
    228228    {
    229229        AssertMsgFailedReturnVoid (("No conversion!\n"));
     
    231231
    232232    template <typename CT, typename QT>
    233     static void FromSafeArray (const com::SafeArray <CT> &aArr, QValueVector <QT> &aVec)
     233    static void FromSafeArray (const com::SafeArray <CT> &aArr, Q3ValueVector <QT> &aVec)
    234234    {
    235235        AssertMsgFailedReturnVoid (("No conversion!\n"));
     
    237237
    238238    template <typename QT, typename CT>
    239     static void ToSafeArray (const QValueVector <QT *> &aVec, com::SafeArray <CT *> &aArr)
     239    static void ToSafeArray (const Q3ValueVector <QT *> &aVec, com::SafeArray <CT *> &aArr)
    240240    {
    241241        AssertMsgFailedReturnVoid (("No conversion!\n"));
     
    243243
    244244    template <typename CT, typename QT>
    245     static void FromSafeArray (const com::SafeArray <CT *> &aArr, QValueVector <QT *> &aVec)
     245    static void FromSafeArray (const com::SafeArray <CT *> &aArr, Q3ValueVector <QT *> &aVec)
    246246    {
    247247        AssertMsgFailedReturnVoid (("No conversion!\n"));
     
    251251
    252252    template <typename T>
    253     static void ToSafeArray (const QValueVector <T> &aVec, com::SafeArray <T> &aArr)
     253    static void ToSafeArray (const Q3ValueVector <T> &aVec, com::SafeArray <T> &aArr)
    254254    {
    255255        aArr.reset (aVec.size());
    256256        size_t i = 0;
    257         for (typename QValueVector <T>::const_iterator it = aVec.begin();
     257        for (typename Q3ValueVector <T>::const_iterator it = aVec.begin();
    258258             it != aVec.end(); ++ it, ++ i)
    259259            aArr [i] = *it;
     
    261261
    262262    template <typename T>
    263     static void FromSafeArray (const com::SafeArray <T> &aArr, QValueVector <T> &aVec)
    264     {
    265         aVec = QValueVector <T> (aArr.size());
     263    static void FromSafeArray (const com::SafeArray <T> &aArr, Q3ValueVector <T> &aVec)
     264    {
     265        aVec = Q3ValueVector <T> (aArr.size());
    266266        size_t i = 0;
    267         for (typename QValueVector <T>::iterator it = aVec.begin();
     267        for (typename Q3ValueVector <T>::iterator it = aVec.begin();
    268268             it != aVec.end(); ++ it, ++ i)
    269269            *it = aArr [i];
     
    272272    /* Arrays of strings */
    273273
    274     static void ToSafeArray (const QValueVector <QString> &aVec,
     274    static void ToSafeArray (const Q3ValueVector <QString> &aVec,
    275275                             com::SafeArray <BSTR> &aArr);
    276276    static void FromSafeArray (const com::SafeArray <BSTR> &aArr,
    277                                QValueVector <QString> &aVec);
     277                               Q3ValueVector <QString> &aVec);
    278278
    279279    /* Arrays of interface pointers. Note: we need a separate pair of names
     
    287287
    288288    template <class CI, class I>
    289     static void ToSafeIfaceArray (const QValueVector <CI> &aVec,
     289    static void ToSafeIfaceArray (const Q3ValueVector <CI> &aVec,
    290290                                  com::SafeIfaceArray <I> &aArr)
    291291    {
    292292        aArr.reset (aVec.size());
    293293        size_t i = 0;
    294         for (typename QValueVector <CI>::const_iterator it = aVec.begin();
     294        for (typename Q3ValueVector <CI>::const_iterator it = aVec.begin();
    295295             it != aVec.end(); ++ it, ++ i)
    296296        {
     
    303303    template <class I, class CI>
    304304    static void FromSafeIfaceArray (const com::SafeIfaceArray <I> &aArr,
    305                                     QValueVector <CI> &aVec)
    306     {
    307         aVec = QValueVector <CI> (aArr.size());
     305                                    Q3ValueVector <CI> &aVec)
     306    {
     307        aVec = Q3ValueVector <CI> (aArr.size());
    308308        size_t i = 0;
    309         for (typename QValueVector <CI>::iterator it = aVec.begin();
     309        for (typename Q3ValueVector <CI>::iterator it = aVec.begin();
    310310             it != aVec.end(); ++ it, ++ i)
    311311            (*it).attach (aArr [i]);
  • trunk/src/VBox/Frontends/VirtualBox4/include/COMWrappers.xsl

    r7216 r7220  
    234234      (//param[@safearray='yes' and not(../@internal='yes') and @type=current()/@name])
    235235    ">
    236       <xsl:text>typedef QValueVector &lt;C</xsl:text>
     236      <xsl:text>typedef Q3ValueVector &lt;C</xsl:text>
    237237      <xsl:value-of select="substring(@name,2)"/>
    238238      <xsl:text>&gt; C</xsl:text>
     
    11501150    <xsl:otherwise>
    11511151      <xsl:if test="../@safearray">
    1152         <xsl:text>QValueVector &lt;</xsl:text>
     1152        <xsl:text>Q3ValueVector &lt;</xsl:text>
    11531153      </xsl:if>
    11541154      <xsl:choose>
     
    15511551          <xsl:if test="(name()='attribute' and $isSetter) or
    15521552                        (name()='param' and @dir='in')">
    1553             <!-- convert QValueVector to SafeArray -->
     1553            <!-- convert Q3ValueVector to SafeArray -->
    15541554            <xsl:choose>
    15551555              <!-- interface types need special treatment here -->
     
    15771577          <xsl:if test="(name()='attribute' and not($isSetter)) or
    15781578                        (name()='param' and (@dir='out' or @dir='return'))">
    1579             <!-- convert SafeArray to QValueVector -->
     1579            <!-- convert SafeArray to Q3ValueVector -->
    15801580            <xsl:choose>
    15811581              <!-- interface types need special treatment here -->
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIHotKeyEdit.h

    r5999 r7220  
    2121
    2222#include <qlabel.h>
     23//Added by qt3to4:
     24#include <QPalette>
     25#include <QFocusEvent>
    2326#if defined(Q_WS_X11)
    2427#include <qmap.h>
     
    6164
    6265#if defined (Q_WS_PM) || defined (Q_WS_X11)
    63     static void languageChange();
     66    static void languageChange_qt3();
    6467#endif
    6568    static QString keyName (int aKeyVal);
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIMessageBox.h

    r5999 r7220  
    2121
    2222#include <qdialog.h>
    23 #include <qvbox.h>
     23#include <q3vbox.h>
    2424#include <qmessagebox.h>
    2525#include <qcheckbox.h>
    26 #include <qtextedit.h>
     26#include <q3textedit.h>
     27//Added by qt3to4:
     28#include <QLabel>
    2729
    2830class QIRichLabel;
     
    6163                  Icon aIcon, int aButton0, int aButton1 = 0, int aButton2 = 0,
    6264                  QWidget *aParent = 0, const char *aName = 0, bool aModal = TRUE,
    63                   WFlags aFlags = WStyle_DialogBorder);
     65                  Qt::WFlags aFlags = Qt::WStyle_DialogBorder);
    6466
    6567    QString buttonText (int aButton) const;
     
    100102    QIRichLabel *mTextLabel;
    101103    QPushButton *mButton0PB, *mButton1PB, *mButton2PB;
    102     QVBox *mMessageVBox;
     104    Q3VBox *mMessageVBox;
    103105    QCheckBox *mFlagCB, *mFlagCB_Main, *mFlagCB_Details;
    104     QVBox *mDetailsVBox;
    105     QTextEdit *mDetailsText;
     106    Q3VBox *mDetailsVBox;
     107    Q3TextEdit *mDetailsText;
    106108    QSpacerItem *mSpacer;
    107109};
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIRichLabel.h

    r5999 r7220  
    2424#define __QIRichLabel_h__
    2525
    26 #include "qframe.h"
     26#include "q3frame.h"
     27//Added by qt3to4:
     28#include <Q3Accel>
     29#include <Q3Picture>
     30#include <QPixmap>
     31#include <QResizeEvent>
     32#include <QMouseEvent>
     33#include <QContextMenuEvent>
     34#include <QKeyEvent>
     35#include <Q3PopupMenu>
     36#include <QFocusEvent>
    2737
    28 class QSimpleRichText;
     38class Q3SimpleRichText;
    2939class QLabelPrivate;
    3040class QAction;
    31 class QPopupMenu;
     41class Q3PopupMenu;
    3242
    33 class QIRichLabel : public QFrame
     43class QIRichLabel : public Q3Frame
    3444{
    3545   Q_OBJECT
    3646      Q_PROPERTY( QString text READ text WRITE setText )
    37       Q_PROPERTY( TextFormat textFormat READ textFormat WRITE setTextFormat )
     47      Q_PROPERTY( Qt::TextFormat textFormat READ textFormat WRITE setTextFormat )
    3848      Q_PROPERTY( QPixmap pixmap READ pixmap WRITE setPixmap )
    3949      Q_PROPERTY( bool scaledContents READ hasScaledContents WRITE setScaledContents )
    40       Q_PROPERTY( Alignment alignment READ alignment WRITE setAlignment )
     50//      Q_PROPERTY( Qt::Alignment alignment READ alignment WRITE setAlignment )
    4151      Q_PROPERTY( int indent READ indent WRITE setIndent )
    42       Q_OVERRIDE( BackgroundMode backgroundMode DESIGNABLE true )
     52      Q_OVERRIDE( Qt::BackgroundMode backgroundMode DESIGNABLE true )
    4353
    4454public:
    45    QIRichLabel (QWidget *parent, const char* name=0, WFlags f=0);
     55   QIRichLabel (QWidget *parent, const char* name=0, Qt::WFlags f=0);
    4656   QIRichLabel (const QString &text, QWidget *parent, const char* name=0,
    47               WFlags f=0);
     57              Qt::WFlags f=0);
    4858   QIRichLabel (QWidget *buddy, const QString &,
    49               QWidget *parent, const char* name=0, WFlags f=0 );
     59              QWidget *parent, const char* name=0, Qt::WFlags f=0 );
    5060   ~QIRichLabel();
    5161
    5262   QString      text()    const   { return ltext; }
    5363   QPixmap     *pixmap()  const   { return lpixmap; }
    54    QPicture    *picture() const   { return lpicture; }
     64   Q3Picture    *picture() const   { return lpicture; }
    5565   QMovie      *movie()   const;
    5666
    57    TextFormat   textFormat() const;
    58    void         setTextFormat( TextFormat );
     67   Qt::TextFormat   textFormat() const;
     68   void         setTextFormat( Qt::TextFormat );
    5969
    6070   int          alignment() const  { return align; }
     
    8191   virtual void setText( const QString &);
    8292   virtual void setPixmap( const QPixmap & );
    83    virtual void setPicture( const QPicture & );
     93   virtual void setPicture( const Q3Picture & );
    8494   virtual void setMovie( const QMovie & );
    8595   virtual void setNum( int );
     
    120130   bool        mIsMainTip;
    121131   QPixmap    *lpixmap;
    122    QPicture   *lpicture;
     132   Q3Picture   *lpicture;
    123133   QMovie     *lmovie;
    124    QPopupMenu *popupMenu;
     134   Q3PopupMenu *popupMenu;
    125135   QString     popupBuffer;
    126136   QWidget    *lbuddy;
     
    130140   uint        scaledcontents :1;
    131141   uint        baseheight;
    132    TextFormat  textformat;
    133    QAccel     *accel;
     142   Qt::TextFormat  textformat;
     143   Q3Accel     *accel;
    134144   QLabelPrivate *d;
    135    QSimpleRichText *doc;
     145   Q3SimpleRichText *doc;
    136146   bool        mMaxHeightMode;
    137147
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIStateIndicator.h

    r5999 r7220  
    2020#define __QIStateIndicator_h__
    2121
    22 #include <qframe.h>
     22#include <q3frame.h>
    2323#include <qpixmap.h>
    2424
    25 #include <qintdict.h>
     25#include <q3intdict.h>
     26//Added by qt3to4:
     27#include <QMouseEvent>
     28#include <QContextMenuEvent>
    2629
    27 class QIStateIndicator : public QFrame
     30class QIStateIndicator : public Q3Frame
    2831{
    2932    Q_OBJECT
     
    3336    QIStateIndicator (int aState,
    3437                      QWidget *aParent, const char *aName = 0,
    35                       WFlags aFlags = 0);
     38                      Qt::WFlags aFlags = 0);
    3639
    3740    virtual QSize sizeHint() const;
     
    8285    };
    8386
    84     QIntDict <Icon> mStateIcons;
     87    Q3IntDict <Icon> mStateIcons;
    8588};
    8689
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIStatusBar.h

    r5999 r7220  
    2121
    2222#include <qstatusbar.h>
     23//Added by qt3to4:
     24#include <QPaintEvent>
    2325
    2426class QPaintEvent;
  • trunk/src/VBox/Frontends/VirtualBox4/include/QIWidgetValidator.h

    r5999 r7220  
    2424#include <qobject.h>
    2525#include <qvalidator.h>
    26 #include <qvaluelist.h>
     26#include <q3valuelist.h>
    2727
    2828class QIWidgetValidator : public QObject
     
    7474    };
    7575
    76     QValueList <Watched> mWatched;
     76    Q3ValueList <Watched> mWatched;
    7777    Watched mLastInvalid;
    7878
     
    8787
    8888    QIULongValidator (QObject *aParent, const char *aName = 0)
    89         : QValidator (aParent, aName)
     89        : QValidator (aParent)
    9090        , mBottom (0), mTop (ULONG_MAX) {}
    9191
    9292    QIULongValidator (ulong aMinimum, ulong aMaximum,
    9393                      QObject *aParent, const char *aName = 0)
    94         : QValidator (aParent, aName)
     94        : QValidator (aParent)
    9595        , mBottom (aMinimum), mTop (aMaximum) {}
    9696
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxAquaStyle.h

    r5999 r7220  
    2121
    2222#include <qstyle.h>
     23//Added by qt3to4:
     24#include <QPixmap>
     25#include <Q3PopupMenu>
    2326
    2427/**
     
    4649    virtual void unPolish( QApplication *app );
    4750    virtual void polish( QPalette &p );
    48     virtual void polishPopupMenu( QPopupMenu *m );
     51    virtual void polishPopupMenu( Q3PopupMenu *m );
    4952    virtual QRect itemRect( QPainter *p, const QRect &r, int flags, bool enabled, const QPixmap *pixmap,
    5053                            const QString &text, int len = -1 ) const;
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h

    r7207 r7220  
    2626
    2727#include <qdatetime.h>
    28 #include <qscrollview.h>
     28#include <q3scrollview.h>
    2929#include <qpixmap.h>
    3030#include <qimage.h>
    3131
    3232#include <qkeysequence.h>
     33//Added by qt3to4:
     34#include <QTimerEvent>
     35#include <QPaintEvent>
     36#include <QLabel>
     37#include <QEvent>
    3338
    3439#if defined (Q_WS_PM)
     
    5257class QMenuData;
    5358
    54 class VBoxConsoleView : public QScrollView
     59class VBoxConsoleView : public Q3ScrollView
    5560{
    5661    Q_OBJECT
     
    7075                     const CConsole &console,
    7176                     VBoxDefs::RenderMode rm,
    72                      QWidget *parent = 0, const char *name = 0, WFlags f = 0);
     77                     QWidget *parent = 0, const char *name = 0, Qt::WFlags f = 0);
    7378    ~VBoxConsoleView();
    7479
     
    144149                   wchar_t *aUniKey = NULL);
    145150    bool mouseEvent (int aType, const QPoint &aPos, const QPoint &aGlobalPos,
    146                      ButtonState aButton,
    147                      ButtonState aState, ButtonState aStateAfter,
    148                      int aWheelDelta, Orientation aWheelDir);
     151                     Qt::ButtonState aButton,
     152                     Qt::ButtonState aState, Qt::ButtonState aStateAfter,
     153                     int aWheelDelta, Qt::Orientation aWheelDir);
    149154
    150155    void emitKeyboardStateChanged()
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h

    r7207 r7220  
    2222#include "COMDefs.h"
    2323
    24 #include <qmainwindow.h>
     24#include <q3mainwindow.h>
    2525
    2626#include <qmap.h>
    27 #include <qobjectlist.h>
     27#include <qobject.h>
    2828#include <qcolor.h>
    2929#include <qdialog.h>
     30//Added by qt3to4:
     31#include <QContextMenuEvent>
     32#include <QLabel>
     33#include <Q3PopupMenu>
     34#include <QEvent>
     35#include <Q3ActionGroup>
     36#include <QShowEvent>
     37#include <QCloseEvent>
    3038
    3139#ifdef VBOX_WITH_DEBUGGER_GUI
     
    3947
    4048class QAction;
    41 class QActionGroup;
    42 class QHBox;
     49class Q3ActionGroup;
     50class Q3HBox;
    4351class QLabel;
    4452class QSpacerItem;
     
    5058class VBoxSwitchMenu;
    5159
    52 class VBoxConsoleWnd : public QMainWindow
     60class VBoxConsoleWnd : public Q3MainWindow
    5361{
    5462    Q_OBJECT
     
    5866    VBoxConsoleWnd (VBoxConsoleWnd **aSelf,
    5967                     QWidget* aParent = 0, const char* aName = 0,
    60                      WFlags aFlags = WType_TopLevel);
     68                     Qt::WFlags aFlags = Qt::WType_TopLevel);
    6169    virtual ~VBoxConsoleWnd();
    6270
     
    194202
    195203    /** Popup version of the main menu */
    196     QPopupMenu *mMainMenu;
    197 
    198     QActionGroup *mRunningActions;
    199     QActionGroup *mRunningOrPausedActions;
     204    Q3PopupMenu *mMainMenu;
     205
     206    Q3ActionGroup *mRunningActions;
     207    Q3ActionGroup *mRunningOrPausedActions;
    200208
    201209    // Machine actions
     
    243251
    244252    // Devices popup menus
    245     QPopupMenu *devicesMenu;
    246     QPopupMenu *devicesMountFloppyMenu;
    247     QPopupMenu *devicesMountDVDMenu;
    248     QPopupMenu *devicesSFMenu;
    249     QPopupMenu *devicesNetworkMenu;
     253    Q3PopupMenu *devicesMenu;
     254    Q3PopupMenu *devicesMountFloppyMenu;
     255    Q3PopupMenu *devicesMountDVDMenu;
     256    Q3PopupMenu *devicesSFMenu;
     257    Q3PopupMenu *devicesNetworkMenu;
    250258    VBoxUSBMenu *devicesUSBMenu;
    251259    VBoxSwitchMenu *devicesVRDPMenu;
     
    266274#ifdef VBOX_WITH_DEBUGGER_GUI
    267275    // Debugger popup menu
    268     QPopupMenu *dbgMenu;
     276    Q3PopupMenu *dbgMenu;
    269277#endif
    270278
     
    291299    QIStateIndicator *autoresize_state;
    292300    QIStateIndicator *vrdp_state;
    293     QHBox *hostkey_hbox;
     301    Q3HBox *hostkey_hbox;
    294302    QLabel *hostkey_name;
    295303
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDownloaderWgt.h

    r5999 r7220  
    2222#include "HappyHttp.h"
    2323#include "qwidget.h"
    24 #include "qurl.h"
     24#include "q3url.h"
    2525#include "qmutex.h"
     26//Added by qt3to4:
     27#include <QEvent>
    2628class QStatusBar;
    2729class QAction;
    28 class QProgressBar;
     30class Q3ProgressBar;
    2931class QToolButton;
    3032class QThread;
     
    8688    void abortConnection();
    8789
    88     QUrl mUrl;
     90    Q3Url mUrl;
    8991    QString mTarget;
    9092    QStatusBar *mStatusBar;
    9193    QAction *mAction;
    92     QProgressBar *mProgressBar;
     94    Q3ProgressBar *mProgressBar;
    9395    QToolButton *mCancelButton;
    9496    bool mIsChecking;
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFrameBuffer.h

    r6794 r7220  
    2121
    2222#include "COMDefs.h"
     23//Added by qt3to4:
     24#include <QMoveEvent>
     25#include <QPaintEvent>
    2326
    2427class VBoxConsoleView;
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r7207 r7220  
    2626#include <qapplication.h>
    2727#include <qpixmap.h>
    28 #include <qiconset.h>
     28#include <qicon.h>
    2929#include <qcolor.h>
    3030#include <quuid.h>
    3131#include <qthread.h>
    32 #include <qpopupmenu.h>
     32#include <q3popupmenu.h>
    3333#include <qtooltip.h>
    3434
    35 #include <qptrvector.h>
    36 #include <qvaluevector.h>
    37 #include <qvaluelist.h>
    38 #include <qdict.h>
    39 #include <qintdict.h>
     35#include <q3ptrvector.h>
     36#include <q3valuevector.h>
     37#include <q3valuelist.h>
     38#include <q3dict.h>
     39#include <q3intdict.h>
     40//Added by qt3to4:
     41#include <QLabel>
     42#include <QEvent>
    4043
    4144class QAction;
     
    6164};
    6265
    63 typedef QValueList <VBoxMedia> VBoxMediaList;
     66typedef Q3ValueList <VBoxMedia> VBoxMediaList;
    6467
    6568// VirtualBox callback events
     
    477480    static void loadLanguage (const QString &aLangId = QString::null);
    478481
    479     static QIconSet iconSet (const char *aNormal,
     482    static QIcon iconSet (const char *aNormal,
    480483                             const char *aDisabled = 0,
    481484                             const char *aActive = 0);
    482     static QIconSet iconSetEx (const char *aNormal, const char *aSmallNormal,
     485    static QIcon iconSetEx (const char *aNormal, const char *aSmallNormal,
    483486                               const char *aDisabled = 0, const char *aSmallDisabled = 0,
    484487                               const char *aActive = 0, const char *aSmallActive = 0);
     
    615618    CVirtualBoxCallback callback;
    616619
    617     typedef QValueVector <QString> QStringVector;
     620    typedef Q3ValueVector <QString> QStringVector;
    618621
    619622    QString verString;
    620623
    621     QValueVector <CGuestOSType> vm_os_types;
    622     QDict <QPixmap> vm_os_type_icons;
    623     QPtrVector <QColor> vm_state_color;
    624 
    625     QIntDict <QPixmap> mStateIcons;
     624    Q3ValueVector <CGuestOSType> vm_os_types;
     625    Q3Dict <QPixmap> vm_os_type_icons;
     626    Q3PtrVector <QColor> vm_state_color;
     627
     628    Q3IntDict <QPixmap> mStateIcons;
    626629    QPixmap mOfflineSnapshotIcon, mOnlineSnapshotIcon;
    627630
     
    695698 *  This class provides the list of USB devices attached to the host.
    696699 */
    697 class VBoxUSBMenu : public QPopupMenu
     700class VBoxUSBMenu : public Q3PopupMenu
    698701{
    699702    Q_OBJECT
     
    726729 *  This class provides enable/disable menu items.
    727730 */
    728 class VBoxSwitchMenu : public QPopupMenu
     731class VBoxSwitchMenu : public Q3PopupMenu
    729732{
    730733    Q_OBJECT
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxMediaComboBox.h

    r5999 r7220  
    2323
    2424#include <qcombobox.h>
     25//Added by qt3to4:
     26#include <QPixmap>
    2527
    26 class QListBoxItem;
     28class Q3ListBoxItem;
    2729
    2830class VBoxMediaComboBox : public QComboBox
     
    5153    void mediaUpdated (const VBoxMedia &);
    5254    void mediaRemoved (VBoxDefs::DiskType, const QUuid &);
    53     void processOnItem (QListBoxItem *);
     55    void processOnItem (Q3ListBoxItem *);
    5456    void processActivated (int);
    5557
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxNetworkFramework.h

    r5999 r7220  
    2323#include <qobject.h>
    2424#include <qthread.h>
     25//Added by qt3to4:
     26#include <QEvent>
     27#include <QDataStream>
    2528typedef happyhttp::Connection HConnect;
    2629
     
    3639
    3740    VBoxNetworkFramework()
    38         : mDataStream (mDataArray, IO_ReadWrite)
     41        : mDataStream (&mDataArray, QIODevice::ReadWrite)
    3942        , mNetworkThread (0) {}
    4043
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h

    r7207 r7220  
    2525#include <qobject.h>
    2626
    27 class QProcess;
     27class Q3Process;
    2828
    2929class VBoxProblemReporter : public QObject
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h

    r6932 r7220  
    2525
    2626#include <qapplication.h>
    27 #include <qmainwindow.h>
    28 #include <qlistbox.h>
    29 #include <qgroupbox.h>
     27#include <q3mainwindow.h>
     28#include <q3listbox.h>
     29#include <q3groupbox.h>
    3030#include <qaction.h>
    3131
    32 #include <qvaluelist.h>
     32#include <q3valuelist.h>
     33//Added by qt3to4:
     34#include <QEvent>
     35#include <QLabel>
     36#include <Q3PopupMenu>
    3337
    3438class VBoxVMListBox;
     
    3943
    4044class QLabel;
    41 class QTextBrowser;
     45class Q3TextBrowser;
    4246class QTabWidget;
    4347struct QUuid;
    4448
    45 class VBoxSelectorWnd : public QMainWindow
     49class VBoxSelectorWnd : public Q3MainWindow
    4650{
    4751    Q_OBJECT
     
    5155    VBoxSelectorWnd (VBoxSelectorWnd **aSelf,
    5256                     QWidget* aParent = 0, const char* aName = 0,
    53                      WFlags aFlags = WType_TopLevel);
     57                     Qt::WFlags aFlags = Qt::WType_TopLevel);
    5458    virtual ~VBoxSelectorWnd();
    5559
     
    7781                                          bool aDescription);
    7882
    79     void showContextMenu (QListBoxItem *, const QPoint &);
     83    void showContextMenu (Q3ListBoxItem *, const QPoint &);
    8084
    8185protected:
     
    110114
    111115    /** VM list context menu */
    112     QPopupMenu *mVMCtxtMenu;
     116    Q3PopupMenu *mVMCtxtMenu;
    113117
    114118    /* actions */
     
    137141    VBoxVMDescriptionPage *vmDescriptionPage;
    138142
    139     QValueList <CSession> sessions;
     143    Q3ValueList <CSession> sessions;
    140144
    141145    QPoint normal_pos;
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxToolBar.h

    r5999 r7220  
    2020#define __VBoxToolBar_h__
    2121
    22 #include <qtoolbar.h>
     22#include <q3toolbar.h>
    2323#include <qtoolbutton.h>
    24 #include <qmainwindow.h>
    25 #include <qobjectlist.h>
     24#include <q3mainwindow.h>
     25#include <qobject.h>
     26//Added by qt3to4:
     27#include <QContextMenuEvent>
    2628#ifdef Q_WS_MAC
    2729# include "VBoxAquaStyle.h"
     
    3234 *  its built-in context menu and add some default behavior we need.
    3335 */
    34 class VBoxToolBar : public QToolBar
     36class VBoxToolBar : public Q3ToolBar
    3537{
    3638public:
    3739
    38     VBoxToolBar (QMainWindow *mainWindow, QWidget *parent, const char *name)
    39         : QToolBar (QString::null, mainWindow, parent, FALSE, name)
     40    VBoxToolBar (Q3MainWindow *mainWindow, QWidget *parent, const char *name)
     41        : Q3ToolBar (QString::null, mainWindow, parent, FALSE, name)
    4042    {
    4143        setResizeEnabled (false);
     
    5658        else
    5759        {
    58             QObjectList *list = queryList ("QToolButton");
    59             QObjectListIt it (*list);
     60            QObjectList list = queryList ("QToolButton");
    6061            QObject *obj;
    61             while ((obj = it.current()) != 0)
     62            foreach(obj, list)
    6263            {
    63                 QToolButton *btn = ::qt_cast <QToolButton *> (obj);
     64                QToolButton *btn = qobject_cast<QToolButton *> (obj);
    6465                btn->setUsesBigPixmap (enable);
    65                 ++ it;
    6666            }
    67             delete list;
    6867        }
    6968    }
     
    7574        else
    7675        {
    77             QObjectList *list = queryList ("QToolButton");
    78             QObjectListIt it (*list);
     76            QObjectList list = queryList ("QToolButton");
    7977            QObject *obj;
    80             while ((obj = it.current()) != 0)
     78            foreach(obj, list)
    8179            {
    82                 QToolButton *btn = ::qt_cast <QToolButton *> (obj);
     80                QToolButton *btn = qobject_cast<QToolButton *> (obj);
    8381                btn->setUsesTextLabel (enable);
    84                 ++ it;
    8582            }
    86             delete list;
    8783        }
    8884    }
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r6812 r7220  
    2222#include <qobject.h>
    2323#include <qevent.h>
    24 #include <qlistview.h>
    25 #include <qtextedit.h>
     24#include <q3listview.h>
     25#include <q3textedit.h>
    2626#include <qlabel.h>
    2727#include <qlayout.h>
     28//Added by qt3to4:
     29#include <QPixmap>
     30#include <QResizeEvent>
     31#include <QMouseEvent>
     32#include <QKeyEvent>
    2833
    2934/**
     
    3641public:
    3742
    38     QIListViewSelectionPreserver (QObject *parent, QListView *alv)
     43    QIListViewSelectionPreserver (QObject *parent, Q3ListView *alv)
    3944        : QObject (parent), lv (alv)
    4045    {
     
    6065private:
    6166
    62     QListView *lv;
     67    Q3ListView *lv;
    6368};
    6469
     
    7277public:
    7378
    74     QIKeyFilter (QObject *aParent, Key aKey) : QObject (aParent), mKey (aKey) {}
     79    QIKeyFilter (QObject *aParent, Qt::Key aKey) : QObject (aParent), mKey (aKey) {}
    7580
    7681    void watchOn (QObject *o) { o->installEventFilter (this); }
     
    9499    }
    95100
    96     Key mKey;
     101    Qt::Key mKey;
    97102};
    98103
     
    171176 *  for getting more compact layout.
    172177 */
    173 class QITextEdit : public QTextEdit
     178class QITextEdit : public Q3TextEdit
    174179{
    175180    Q_OBJECT
     
    178183
    179184    QITextEdit (QWidget *aParent)
    180         : QTextEdit (aParent) {}
     185        : Q3TextEdit (aParent) {}
    181186
    182187    QSize sizeHint() const
     
    210215                                    0, 0,
    211216                                    sizePolicy().hasHeightForWidth()));
    212         setAlignment (int (QLabel::WordBreak | QLabel::AlignTop));
     217        setAlignment (int (Qt::AlignTop));
    213218        /* install show-parent-widget watcher */
    214219        aParent->topLevelWidget()->installEventFilter (this);
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMListBox.h

    r7207 r7220  
    2525#include "VBoxGlobal.h"
    2626
    27 #include <qlistbox.h>
     27#include <q3listbox.h>
    2828#include <qfont.h>
    2929#include <qdatetime.h>
     30//Added by qt3to4:
     31#include <QFocusEvent>
    3032
    3133struct QUuid;
     
    4345 *  class.
    4446 */
    45 class VBoxVMListBox : public QListBox
     47class VBoxVMListBox : public Q3ListBox
    4648{
    4749    Q_OBJECT
     
    5052
    5153    VBoxVMListBox (QWidget *aParent = 0, const char *aName = NULL,
    52                    WFlags aFlags = 0);
     54                   Qt::WFlags aFlags = 0);
    5355
    5456    virtual ~VBoxVMListBox();
     
    9799 *  get an access to various VM data.
    98100 */
    99 class VBoxVMListBoxItem : public QListBoxItem
     101class VBoxVMListBoxItem : public Q3ListBoxItem
    100102{
    101103public:
     
    118120    QString toolTipText() const;
    119121
    120     int height (const QListBox *) const;
    121     int width (const QListBox *) const;
     122    int height (const Q3ListBox *) const;
     123    int width (const Q3ListBox *) const;
    122124
    123125    QUuid id() const { return mId; }
  • trunk/src/VBox/Frontends/VirtualBox4/src/COMDefs.cpp

    r6851 r7220  
    183183
    184184/* static */
    185 void COMBase::ToSafeArray (const QValueVector <QString> &aVec,
     185void COMBase::ToSafeArray (const Q3ValueVector <QString> &aVec,
    186186                           com::SafeArray <BSTR> &aArr)
    187187{
    188188    aArr.reset (aVec.size());
    189189    size_t i = 0;
    190     for (QValueVector <QString>::const_iterator it = aVec.begin();
     190    for (Q3ValueVector <QString>::const_iterator it = aVec.begin();
    191191         it != aVec.end(); ++ it, ++ i)
    192192        aArr [i] = SysAllocString ((const OLECHAR *) (*it).ucs2());
     
    195195/* static */
    196196void COMBase::FromSafeArray (const com::SafeArray <BSTR> &aArr,
    197                              QValueVector <QString> &aVec)
    198 {
    199     aVec = QValueVector <QString> (aArr.size());
     197                             Q3ValueVector <QString> &aVec)
     198{
     199    aVec = Q3ValueVector <QString> (aArr.size());
    200200    size_t i = 0;
    201     for (QValueVector <QString>::iterator it = aVec.begin();
     201    for (Q3ValueVector <QString>::iterator it = aVec.begin();
    202202         it != aVec.end(); ++ it, ++ i)
    203203        *it = QString::fromUcs2 (aArr [i]);
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIHotKeyEdit.cpp

    r5999 r7220  
    1818
    1919#include "QIHotKeyEdit.h"
     20//Added by qt3to4:
     21#include <QLabel>
     22#include <QFocusEvent>
    2023
    2124#include "VBoxDefs.h"
     
    114117    clear();
    115118
    116     setFrameStyle (LineEditPanel | Sunken);
    117     setAlignment (AlignHCenter | AlignBottom);
    118     setFocusPolicy (StrongFocus);
     119    setFrameStyle (QFrame::StyledPanel | Sunken);
     120    setAlignment (Qt::AlignHCenter | Qt::AlignBottom);
     121    setFocusPolicy (Qt::StrongFocus);
    119122
    120123    QPalette p = palette();
     
    203206    int w = fm.width( 'x' ) * 17; // "some"
    204207    int m = frameWidth() * 2;
    205     return (style().sizeFromContents (QStyle::CT_LineEdit, this,
    206                                       QSize (w + m, h + m)
    207                                       .expandedTo(QApplication::globalStrut())));
     208#warning port me
     209//    return (style()->sizeFromContents (QStyle::CT_LineEdit, this,
     210//                                      QSize (w + m, h + m)
     211//                                      .expandedTo(QApplication::globalStrut())));
     212    QSize(10,10);
    208213}
    209214
     
    278283 */
    279284/* static */
    280 void QIHotKeyEdit::languageChange()
     285void QIHotKeyEdit::languageChange_qt3()
    281286{
    282287    /* Note: strings for the same key must match strings in languageChange()
     
    333338 */
    334339/* static */
    335 void QIHotKeyEdit::languageChange()
     340void QIHotKeyEdit::languageChange_qt3()
    336341{
    337342    /* Note: strings for the same key must match strings in languageChange()
     
    726731void QIHotKeyEdit::drawContents (QPainter * p)
    727732{
    728     QLabel::drawContents (p);
    729     if (hasFocus())
    730     {
    731         style().drawPrimitive (
    732             QStyle::PE_FocusRect, p, contentsRect(), colorGroup(),
    733             QStyle::Style_Default,
    734             QStyleOption( colorGroup().background()));
    735     }
     733#warning port me
     734//    QLabel::drawContents (p);
     735//    if (hasFocus())
     736//    {
     737//        style().drawPrimitive (
     738//            QStyle::PE_FocusRect, p, contentsRect(), colorGroup(),
     739//            QStyle::State_None,
     740//            QStyleOption( colorGroup().background()));
     741//    }
    736742}
    737743
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIMessageBox.cpp

    r5999 r7220  
    1818
    1919#include "QIMessageBox.h"
     20//Added by qt3to4:
     21#include <Q3HBoxLayout>
     22#include <q3mimefactory.h>
     23#include <Q3VBoxLayout>
    2024#include "VBoxDefs.h"
    2125#include "QIRichLabel.h"
     
    2428#include <qlabel.h>
    2529#include <qpushbutton.h>
    26 #include <qhbox.h>
     30#include <q3hbox.h>
    2731#include <qlayout.h>
    2832
     
    4549                            Icon aIcon, int aButton0, int aButton1, int aButton2,
    4650                            QWidget *aParent, const char *aName, bool aModal,
    47                             WFlags aFlags)
     51                            Qt::WFlags aFlags)
    4852    : QDialog (aParent, aName, aModal,
    49                aFlags | WStyle_Customize | WStyle_NormalBorder |
    50                         WStyle_Title | WStyle_SysMenu)
     53               aFlags | Qt::WStyle_Customize | Qt::WStyle_NormalBorder |
     54                        Qt::WStyle_Title | Qt::WStyle_SysMenu)
    5155{
    5256    setCaption (aCaption);
     
    5660    mButton2 = aButton2;
    5761
    58     QVBoxLayout *layout = new QVBoxLayout (this);
     62    Q3VBoxLayout *layout = new Q3VBoxLayout (this);
    5963    /* setAutoAdd() behavior is really poor (it messes up with the order
    6064     * of widgets), never use it: layout->setAutoAdd (true); */
    6165    layout->setMargin (11);
    6266    layout->setSpacing (10);
    63     layout->setResizeMode (QLayout::Minimum);
    64 
    65     QHBox *main = new QHBox (this);
     67    layout->setResizeMode (QLayout::SetMinimumSize);
     68
     69    Q3HBox *main = new Q3HBox (this);
    6670    main->setMargin (0);
    6771    main->setSpacing (10);
     
    7276        mIconLabel->setPixmap (QMessageBox::standardIcon ((QMessageBox::Icon) aIcon));
    7377    else if (aIcon == GuruMeditation)
    74         mIconLabel->setPixmap (QPixmap::fromMimeSource ("meditation_32px.png"));
     78        mIconLabel->setPixmap (qPixmapFromMimeSource ("meditation_32px.png"));
    7579    mIconLabel->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
    76     mIconLabel->setAlignment (AlignHCenter | AlignTop);
    77 
    78     mMessageVBox = new QVBox (main);
     80    mIconLabel->setAlignment (Qt::AlignHCenter | Qt::AlignTop);
     81
     82    mMessageVBox = new Q3VBox (main);
    7983    mMessageVBox->setMargin (0);
    8084    mMessageVBox->setSpacing (10);
    8185
    8286    mTextLabel = new QIRichLabel (aText, mMessageVBox);
    83     mTextLabel->setAlignment (AlignAuto | AlignTop | ExpandTabs | WordBreak);
     87    mTextLabel->setAlignment (Qt::AlignLeft | Qt::AlignTop | Qt::TextExpandTabs | Qt::TextWordWrap);
    8488    mTextLabel->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred, true);
    8589    mTextLabel->setMinimumWidth (mTextLabel->sizeHint().width());
     
    8892    mFlagCB_Main->hide();
    8993
    90     mDetailsVBox = new QVBox (this);
     94    mDetailsVBox = new Q3VBox (this);
    9195    mDetailsVBox->setMargin (0);
    9296    mDetailsVBox->setSpacing (10);
    9397    layout->addWidget (mDetailsVBox);
    9498
    95     mDetailsText = new QTextEdit (mDetailsVBox);
     99    mDetailsText = new Q3TextEdit (mDetailsVBox);
    96100    {
    97101        /* calculate the minimum size dynamically, approx. for 40 chars and
     
    101105    }
    102106    mDetailsText->setReadOnly (true);
    103     mDetailsText->setWrapPolicy (QTextEdit::AtWordOrDocumentBoundary);
     107    mDetailsText->setWrapPolicy (Q3TextEdit::AtWordOrDocumentBoundary);
    104108    mDetailsText->setSizePolicy (QSizePolicy::Expanding,
    105109                                 QSizePolicy::MinimumExpanding);
     
    111115    layout->addItem (mSpacer);
    112116
    113     QHBoxLayout *buttons = new QHBoxLayout (new QWidget (this));
     117    Q3HBoxLayout *buttons = new Q3HBoxLayout (new QWidget (this));
    114118    layout->addWidget (buttons->mainWidget());
    115119    buttons->setAutoAdd (true);
     
    128132        connect (mButton2PB, SIGNAL (clicked()), SLOT (done2()));
    129133
    130     buttons->setAlignment (AlignHCenter);
     134    buttons->setAlignment (Qt::AlignHCenter);
    131135
    132136    /* this call is a must -- it initializes mFlagCB and mSpacer */
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIRichLabel.cpp

    r5999 r7220  
    2424
    2525#include <qpainter.h>
    26 #include <qaccel.h>
     26#include <q3accel.h>
    2727#include <qmovie.h>
    2828#include <qimage.h>
    29 #include <qpicture.h>
     29#include <q3picture.h>
    3030#include <qapplication.h>
    31 #include <qsimplerichtext.h>
    32 #include <qstylesheet.h>
     31#include <q3simplerichtext.h>
     32#include <q3stylesheet.h>
    3333#include <qstyle.h>
    3434#include <qregexp.h>
    35 #include <qfocusdata.h>
     35//#include <qfocusdata.h>
    3636#include <qtooltip.h>
    37 #include <qpopupmenu.h>
     37#include <q3popupmenu.h>
    3838#include <qaction.h>
    3939#include <qclipboard.h>
    4040#include <qcursor.h>
     41//Added by qt3to4:
     42#include <QContextMenuEvent>
     43#include <QKeyEvent>
     44#include <QPixmap>
     45#include <QBitmap>
     46#include <Q3Frame>
     47#include <QResizeEvent>
     48#include <QFocusEvent>
     49#include <QMouseEvent>
    4150
    4251class QLabelPrivate
     
    5463
    5564
    56 QIRichLabel::QIRichLabel (QWidget *parent, const char *name, WFlags f)
    57 : QFrame (parent, name, f | WMouseNoMask)
     65QIRichLabel::QIRichLabel (QWidget *parent, const char *name, Qt::WFlags f)
     66: Q3Frame (parent, name, f | Qt::WMouseNoMask)
    5867{
    5968   init();
     
    6271
    6372QIRichLabel::QIRichLabel (const QString &text, QWidget *parent, const char *name,
    64                           WFlags f)
    65                           : QFrame (parent, name, f | WMouseNoMask)
     73                          Qt::WFlags f)
     74                          : Q3Frame (parent, name, f | Qt::WMouseNoMask)
    6675{
    6776   init();
     
    7180
    7281QIRichLabel::QIRichLabel (QWidget *buddy,  const QString &text,
    73                           QWidget *parent, const char *name, WFlags f)
    74                           : QFrame (parent, name, f | WMouseNoMask)
     82                          QWidget *parent, const char *name, Qt::WFlags f)
     83                          : Q3Frame (parent, name, f | Qt::WMouseNoMask)
    7584{
    7685   init();
     
    98107   lpixmap = 0;
    99108   lpicture = 0;
    100    align = AlignAuto | AlignVCenter | ExpandTabs;
     109   align = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextExpandTabs;
    101110   extraMargin = -1;
    102111   autoresize = FALSE;
     
    112121   copyAction->setMenuText (tr ("Copy to clipboard"));
    113122
    114    popupMenu = new QPopupMenu (this, "contextMenu");
     123   popupMenu = new Q3PopupMenu (this, "contextMenu");
    115124   copyAction->addTo (popupMenu);
    116125
     
    122131{
    123132    baseheight = aHeight;
    124     QFrame::setFixedHeight (baseheight);
     133    Q3Frame::setFixedHeight (baseheight);
    125134}
    126135
     
    136145   ltext = text;
    137146
    138    bool useRichText = (textformat == RichText ||
    139       ((textformat == AutoText) && QStyleSheet::mightBeRichText (ltext)));
     147   bool useRichText = (textformat == Qt::RichText ||
     148      ((textformat == Qt::AutoText) && Q3StyleSheet::mightBeRichText (ltext)));
    140149
    141150   // ### Setting accelerators for rich text labels will not work.
     
    143152   // not intended.
    144153   if (!useRichText) {
    145       int p = QAccel::shortcutKey (ltext);
     154      int p = Q3Accel::shortcutKey (ltext);
    146155      if (p) {
    147156         if (!accel)
    148             accel = new QAccel (this, "accel label accel");
     157            accel = new Q3Accel (this, "accel label accel");
    149158         accel->connectItem (accel->insertItem (p),
    150159            this, SLOT (acceleratorSlot()));
     
    154163   if (useRichText) {
    155164      if (!hadRichtext)
    156          align |= WordBreak;
     165         align |= Qt::TextWordWrap;
    157166      QString t = ltext;
    158       if (align & AlignRight)
     167      if (align & Qt::AlignRight)
    159168         t.prepend ("<div align=\"right\">");
    160       else if (align & AlignHCenter)
     169      else if (align & Qt::AlignHCenter)
    161170         t.prepend ("<div align=\"center\">");
    162       if ((align & WordBreak) == 0)
     171      if ((align & Qt::TextWordWrap) == 0)
    163172         t.prepend ("<nobr>");
    164       doc = new QSimpleRichText (compressText(0), font());
     173      doc = new Q3SimpleRichText (compressText(0), font());
    165174   }
    166175
     
    170179   {
    171180       baseheight = heightForWidth (width());
    172        QFrame::setFixedHeight (baseheight);
     181       Q3Frame::setFixedHeight (baseheight);
    173182   }
    174183}
     
    197206
    198207
    199 void QIRichLabel::setPicture (const QPicture &picture)
     208void QIRichLabel::setPicture (const Q3Picture &picture)
    200209{
    201210   QSize osh = sizeHint();
    202211   clearContents();
    203    lpicture = new QPicture (picture);
     212   lpicture = new Q3Picture (picture);
    204213
    205214   updateLabel (osh);
     
    230239
    231240   if (lbuddy)
    232       align = alignment | ShowPrefix;
     241      align = alignment | Qt::TextShowMnemonic;
    233242   else
    234243      align = alignment;
     
    271280   QRect br;
    272281   QPixmap *pix = pixmap();
    273    QPicture *pic = picture();
     282   Q3Picture *pic = picture();
    274283   QMovie *mov = movie();
    275284
     
    283292         m = xw / 2 - margin();
    284293      if (m >= 0) {
    285          int horizAlign = QApplication::horizontalAlignment( align );
    286          if ((horizAlign & AlignLeft) || (horizAlign & AlignRight))
     294          Qt::Alignment horizAlign = QApplication::horizontalAlignment( (Qt::Alignment)align );
     295         if ((horizAlign & Qt::AlignLeft) || (horizAlign & Qt::AlignRight))
    287296            hextra += m;
    288          if ((align & AlignTop) || (align & AlignBottom))
     297         if ((align & Qt::AlignTop) || (align & Qt::AlignBottom))
    289298            vextra += m;
    290299      }
     
    299308   else if (doc) {
    300309      int oldW = doc->width();
    301       if ( align & WordBreak ) {
     310      if ( align & Qt::TextWordWrap ) {
    302311         if (w < 0)
    303312            doc->adjustSize();
     
    309318   }
    310319   else {
    311       bool tryWidth = (w < 0) && (align & WordBreak);
     320      bool tryWidth = (w < 0) && (align & Qt::TextWordWrap);
    312321      if (tryWidth)
    313322         w = xw * 80;
     
    332341   if (
    333342      doc ||
    334       (align & WordBreak))
     343      (align & Qt::TextWordWrap))
    335344      return sizeForWidth (w).height();
    336345   return QWidget::heightForWidth(w);
     
    358367   if (
    359368      !doc &&
    360       (align & WordBreak) == 0) {
     369      (align & Qt::TextWordWrap) == 0) {
    361370      sz = d->sh;
    362371   } else {
     
    385394        if (mIsMainTip)
    386395        {
    387             mTipText = QToolTip::textFor (this);
     396#warning port me
     397//            mTipText = QToolTip::textFor (this);
    388398            QToolTip::remove (this);
    389399            QToolTip::add (this, link);
     
    411421    QString link = doc->anchorAt (aEvent->pos());
    412422    /* Check for mouse left button clicked on the link */
    413     if (!link.isEmpty() && aEvent->button() == LeftButton)
     423    if (!link.isEmpty() && aEvent->button() == Qt::LeftButton)
    414424        emit clickedOnLink (link);
    415425}
     
    418428void QIRichLabel::resizeEvent (QResizeEvent *e)
    419429{
    420    QFrame::resizeEvent (e);
     430   Q3Frame::resizeEvent (e);
    421431
    422432   static const bool doc = FALSE;
    423433
    424434   // optimize for standard labels
    425    if (frameShape() == NoFrame && (align & WordBreak) == 0 && !doc &&
    426        (e->oldSize().width() >= e->size().width() && (align & AlignLeft) == AlignLeft)
    427        && (e->oldSize().height() >= e->size().height() && (align & AlignTop) == AlignTop)) {
    428       setWFlags (WResizeNoErase);
     435   if (frameShape() == NoFrame && (align & Qt::TextWordWrap) == 0 && !doc &&
     436       (e->oldSize().width() >= e->size().width() && (align & Qt::AlignLeft) == Qt::AlignLeft)
     437       && (e->oldSize().height() >= e->size().height() && (align & Qt::AlignTop) == Qt::AlignTop)) {
     438#warning port me
     439//      setWFlags (Qt::WResizeNoErase);
    429440      return;
    430441   }
    431442
    432    clearWFlags (WResizeNoErase);
     443#warning port me
     444//   clearWFlags (Qt::WResizeNoErase);
    433445   QRect cr = contentsRect();
    434446   if ( !lpixmap ||  !cr.isValid() ||
    435447      // masked pixmaps can only reduce flicker when being top/left
    436448      // aligned and when we do not perform scaled contents
    437       (lpixmap->hasAlpha() && (scaledcontents || ((align & (AlignLeft|AlignTop)) != (AlignLeft|AlignTop)))))
     449      (lpixmap->hasAlpha() && (scaledcontents || ((align & (Qt::AlignLeft|Qt::AlignTop)) != (Qt::AlignLeft|Qt::AlignTop)))))
    438450      return;
    439451
    440    setWFlags (WResizeNoErase);
     452#warning port me
     453//   setWFlags (Qt::WResizeNoErase);
    441454
    442455   if (!scaledcontents) {
     
    473486void QIRichLabel::focusInEvent (QFocusEvent *aEvent)
    474487{
    475    QFrame::focusInEvent (aEvent);
     488   Q3Frame::focusInEvent (aEvent);
    476489   repaint();
    477490}
     
    480493void QIRichLabel::keyPressEvent (QKeyEvent *aEvent)
    481494{
    482    switch (aEvent->key())
    483    {
    484    case Qt::Key_Up:
    485       focusData()->home();
    486       focusData()->prev()->setFocus();
    487       break;
    488    case Qt::Key_Down:
    489       focusData()->home();
    490       focusData()->next()->setFocus();
    491       break;
    492    default:
    493       aEvent->ignore();
    494    }
     495#warning port me
     496//   switch (aEvent->key())
     497//   {
     498//   case Qt::Key_Up:
     499//      focusData()->home();
     500//      focusData()->prev()->setFocus();
     501//      break;
     502//   case Qt::Key_Down:
     503//      focusData()->home();
     504//      focusData()->next()->setFocus();
     505//      break;
     506//   default:
     507//      aEvent->ignore();
     508//   }
    495509}
    496510
     
    578592
    579593   QPixmap *pix = pixmap();
    580    QPicture *pic = picture();
     594   Q3Picture *pic = picture();
    581595   QMovie *mov = movie();
    582596
     
    586600         m = fontMetrics().width ('x') / 2 - margin();
    587601      if (m > 0) {
    588          int hAlign = QApplication::horizontalAlignment (align);
    589          if (hAlign & AlignLeft)
     602         int hAlign = QApplication::horizontalAlignment ((Qt::Alignment)align);
     603         if (hAlign & Qt::AlignLeft)
    590604            cr.setLeft (cr.left() + m);
    591          if (hAlign & AlignRight)
     605         if (hAlign & Qt::AlignRight)
    592606            cr.setRight (cr.right() - m);
    593          if (align & AlignTop)
     607         if (align & Qt::AlignTop)
    594608            cr.setTop (cr.top() + m);
    595          if (align & AlignBottom)
     609         if (align & Qt::AlignBottom)
    596610            cr.setBottom (cr.bottom() - m);
    597611      }
     
    599613
    600614   if (mov) {
     615#warning port me
    601616      // ### should add movie to qDrawItem
    602       QRect r = style().itemRect (p, cr, align, isEnabled(), &(mov->framePixmap()),
    603          QString::null);
     617//      QRect r = style()->itemRect (p, cr, align, isEnabled(), &(mov->framePixmap()),
     618//         QString::null);
    604619      // ### could resize movie frame at this point
    605       p->drawPixmap (r.x(), r.y(), mov->framePixmap());
     620//      p->drawPixmap (r.x(), r.y(), mov->framePixmap());
    606621   }
    607622   else
     
    610625         QToolTip::remove (this);
    611626         QString filteredText = compressText();
    612          doc = new QSimpleRichText (filteredText, font());
     627         doc = new Q3SimpleRichText (filteredText, font());
    613628         /* focus indent */
    614629         doc->setWidth (p, cr.width() - 2*3);
    615630         int rh = doc->height();
    616631         int yo = 0;
    617          if (align & AlignVCenter)
     632         if (align & Qt::AlignVCenter)
    618633            yo = (cr.height()-rh)/2;
    619          else if (align & AlignBottom)
     634         else if (align & Qt::AlignBottom)
    620635            yo = cr.height()-rh;
    621          if (! isEnabled() &&
    622             style().styleHint (QStyle::SH_EtchDisabledText, this)) {
    623             QColorGroup cg = colorGroup();
    624             cg.setColor (QColorGroup::Text, cg.light());
    625             doc->draw (p, cr.x()+1, cr.y()+yo+1, cr, cg, 0);
    626          }
     636#warning port me
     637//         if (! isEnabled() &&
     638//            style().styleHint (QStyle::SH_EtchDisabledText, this)) {
     639//            QColorGroup cg = colorGroup();
     640//            cg.setColor (QColorGroup::Text, cg.light());
     641//            doc->draw (p, cr.x()+1, cr.y()+yo+1, cr, cg, 0);
     642//         }
    627643
    628644         // QSimpleRichText always draws with QColorGroup::Text as with
     
    640656                  standartGroup.color (QColorGroup::HighlightedText));
    641657               paper.setColor (standartGroup.color (QColorGroup::Highlight));
    642                paper.setStyle (QBrush::SolidPattern);
     658               paper.setStyle (Qt::SolidPattern);
    643659            }
    644660            else
     
    647663
    648664         doc->draw (p, cr.x()+3, cr.y()+yo, cr, cg, &paper);
    649          if (hasFocus())
    650             style().drawPrimitive (QStyle::PE_FocusRect, p, cr, cg,
    651             QStyle::Style_FocusAtBorder,
    652             cg.highlight());
     665#warning port me
     666//         if (hasFocus())
     667//            style().drawPrimitive (QStyle::PE_FocusRect, p, cr, cg,
     668//            QStyle::State_FocusAtBorder,
     669//            cg.highlight());
    653670
    654671         if (filteredText != ltext)
     
    668685               int xo = 0;
    669686               int yo = 0;
    670                if (align & AlignVCenter)
     687               if (align & Qt::AlignVCenter)
    671688                  yo = (cr.height()-rh)/2;
    672                else if (align & AlignBottom)
     689               else if (align & Qt::AlignBottom)
    673690                  yo = cr.height()-rh;
    674                if (align & AlignRight)
     691               if (align & Qt::AlignRight)
    675692                  xo = cr.width()-rw;
    676                else if (align & AlignHCenter)
     693               else if (align & Qt::AlignHCenter)
    677694                  xo = (cr.width()-rw)/2;
    678695               p->drawPicture (cr.x()+xo-br.x(), cr.y()+yo-br.y(), *pic);
     
    691708            }
    692709            int alignment = align;
    693             if ((align & ShowPrefix) && !style().styleHint(QStyle::SH_UnderlineAccelerator, this))
    694                alignment |= NoAccel;
     710#warning port me
     711//            if ((align & Qt::TextShowMnemonic) && !style().styleHint(QStyle::SH_UnderlineShortcut, this))
     712//               alignment |= Qt::TextHideMnemonic;
    695713            // ordinary text or pixmap label
    696             style().drawItem ( p, cr, alignment, colorGroup(), isEnabled(),
    697                pix, ltext );
     714//            style().drawItem ( p, cr, alignment, colorGroup(), isEnabled(),
     715//               pix, ltext );
    698716         }
    699717}
     
    704722   d->valid_hints = -1;
    705723   QSizePolicy policy = sizePolicy();
    706    bool wordBreak = align & WordBreak;
     724   bool wordBreak = align & Qt::TextWordWrap;
    707725   policy.setHeightForWidth (wordBreak);
    708726   if (policy != sizePolicy())
     
    729747       w->isEnabled() &&
    730748       w->isVisible() &&
    731        w->focusPolicy() != NoFocus) {
    732       QFocusEvent::setReason (QFocusEvent::Shortcut);
     749       w->focusPolicy() != Qt::NoFocus) {
     750#warning port me
     751//      QFocusEvent::setReason (QFocusEvent::Shortcut);
    733752      w->setFocus();
    734       QFocusEvent::resetReason();
     753#warning port me
     754//      QFocusEvent::resetReason();
    735755   }
    736756}
     
    746766{
    747767   if (buddy)
    748       setAlignment (alignment() | ShowPrefix);
     768      setAlignment (alignment() | Qt::TextShowMnemonic);
    749769   else
    750       setAlignment (alignment() & ~ShowPrefix);
     770      setAlignment (alignment() & ~Qt::TextShowMnemonic);
    751771
    752772   if (lbuddy)
     
    758778      return;
    759779
    760    if (!( textformat == RichText || (textformat == AutoText &&
    761       QStyleSheet::mightBeRichText(ltext))))
     780   if (!( textformat == Qt::RichText || (textformat == Qt::AutoText &&
     781      Q3StyleSheet::mightBeRichText(ltext))))
    762782   {
    763       int p = QAccel::shortcutKey (ltext);
     783      int p = Q3Accel::shortcutKey (ltext);
    764784      if (p) {
    765785         if (!accel)
    766             accel = new QAccel (this, "accel label accel");
     786            accel = new Q3Accel (this, "accel label accel");
    767787         accel->connectItem (accel->insertItem (p),
    768788            this, SLOT (acceleratorSlot()));
     
    785805   if (mov && !mov->isNull()) {
    786806      QRect r = contentsRect();
    787       r = style().itemRect (0, r, align, isEnabled(), &(mov->framePixmap()),
    788          QString::null);
     807#warning port me
     808//      r = style().itemRect (0, r, align, isEnabled(), &(mov->framePixmap()),
     809//         QString::null);
    789810      r.moveBy (rect.x(), rect.y());
    790811      r.setWidth (QMIN (r.width(), rect.width()));
    791812      r.setHeight (QMIN (r.height(), rect.height()));
    792       repaint (r, mov->framePixmap().mask() != 0);
     813#warning port me
     814//      repaint (r, mov->framePixmap().mask() != 0);
    793815   }
    794816}
     
    807829void QIRichLabel::setMovie (const QMovie &movie)
    808830{
    809    QSize osh = sizeHint();
    810    clearContents();
    811 
    812    lmovie = new QMovie (movie);
    813    lmovie->connectResize (this, SLOT (movieResized (const QSize&)));
    814    lmovie->connectUpdate (this, SLOT (movieUpdated (const QRect&)));
    815 
    816    if (!lmovie->running())   // Assume that if the movie is running,
    817       updateLabel (osh); // resize/update signals will come soon enough
     831#warning port me
     832//   QSize osh = sizeHint();
     833//   clearContents();
     834//
     835//   lmovie = new QMovie (movie);
     836//   lmovie->connectResize (this, SLOT (movieResized (const QSize&)));
     837//   lmovie->connectUpdate (this, SLOT (movieUpdated (const QRect&)));
     838//
     839//   if (!lmovie->running())   // Assume that if the movie is running,
     840//      updateLabel (osh); // resize/update signals will come soon enough
    818841}
    819842
     
    842865
    843866   if (lmovie) {
    844       lmovie->disconnectResize (this, SLOT (movieResized (const QSize&)));
    845       lmovie->disconnectUpdate (this, SLOT (movieUpdated (const QRect&)));
     867#warning port me
     868//      lmovie->disconnectResize (this, SLOT (movieResized (const QSize&)));
     869//      lmovie->disconnectUpdate (this, SLOT (movieUpdated (const QRect&)));
    846870      delete lmovie;
    847871      lmovie = 0;
     
    908932void QIRichLabel::setFont (const QFont &f)
    909933{
    910    QFrame::setFont (f);
    911 }
     934   Q3Frame::setFont (f);
     935}
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp

    r5999 r7220  
    2020
    2121#include <qpainter.h>
     22//Added by qt3to4:
     23#include <QPixmap>
     24#include <QMouseEvent>
     25#include <Q3Frame>
     26#include <QContextMenuEvent>
    2227
    2328/** @clas QIStateIndicator
     
    3641QIStateIndicator::QIStateIndicator (int aState,
    3742                                    QWidget *aParent, const char *aName,
    38                                     WFlags aFlags)
    39     : QFrame (aParent, aName, aFlags | WStaticContents | WMouseNoMask)
     43                                    Qt::WFlags aFlags)
     44    : Q3Frame (aParent, aName, aFlags | Qt::WStaticContents | Qt::WMouseNoMask)
    4045{
    4146    mState = aState;
     
    99104    else
    100105    {
    101         if (testWFlags (WNoAutoErase))
     106//        if (testAttribute (Qt::WNoAutoErase))
     107#warning port me
     108        if(0)
    102109        {
    103110            QColor bgColor = paletteBackgroundColor();
     
    130137                }
    131138                /* paint the icon on top of the widget background sample */
    132                 bitBlt (&icon->cached, 0, 0, &icon->pixmap,
    133                         0, 0, w, h, CopyROP, false);
     139#warning port me
     140//                bitBlt (&icon->cached, 0, 0, &icon->pixmap,
     141//                        0, 0, w, h, CopyROP, false);
    134142                /* store the new values */
    135143                icon->bgColor = bgColor;
     
    159167        aEv->accept();
    160168    else
    161         QFrame::mousePressEvent (aEv);
     169        Q3Frame::mousePressEvent (aEv);
    162170}
    163171#endif /* Q_WS_MAC */
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIStatusBar.cpp

    r5999 r7220  
    2121#include <qpainter.h>
    2222#include <qsizegrip.h>
     23//Added by qt3to4:
     24#include <QPaintEvent>
    2325
    2426/** @clas QIStatusLine
     
    5759    if (!message.isEmpty()) {
    5860        p.setPen (colorGroup().foreground());
    59         p.drawText (6, 0, psx, height(), AlignVCenter | SingleLine, message);
     61        p.drawText (6, 0, psx, height(), Qt::AlignVCenter | Qt::TextSingleLine, message);
    6062    }
    6163}
  • trunk/src/VBox/Frontends/VirtualBox4/src/QIWidgetValidator.cpp

    r5999 r7220  
    1919#include "QIWidgetValidator.h"
    2020
    21 #include <qobjectlist.h>
     21#include <qobject.h>
    2222#include <qlineedit.h>
    2323#include <qcombobox.h>
    2424#include <qlabel.h>
     25//Added by qt3to4:
     26#include <Q3ValueList>
    2527
    2628#include <iprt/assert.h>
     
    152154    QValidator::State state = QValidator::Acceptable;
    153155
    154     for (QValueList <Watched>::ConstIterator it = mWatched.begin();
     156    for (Q3ValueList <Watched>::ConstIterator it = mWatched.begin();
    155157         it != mWatched.end(); ++ it)
    156158    {
     
    212214    Watched watched;
    213215
    214     QObjectList *list = mWidget->queryList();
     216    QObjectList list = mWidget->queryList();
    215217    QObject *obj;
    216218
    217219    /* detect all widgets that support validation */
    218     QObjectListIterator it (*list);
    219     while ((obj = it.current()) != 0)
     220    QListIterator<QObject*> it (list);
     221    while (it.hasNext())
    220222    {
    221         ++ it;
     223        obj = it.next();
    222224        if (obj->inherits ("QLineEdit"))
    223225        {
     
    247249        /* try to find a buddy widget in order to determine the title for
    248250         * the watched widget which is used in the warning text */
    249         QObjectListIterator it2 (*list);
    250         while ((obj = it2.current()) != 0)
    251         {
    252             ++ it2;
     251        QListIterator<QObject*> it2 (list);
     252        while (it2.hasNext())
     253        {
     254            obj = it2.next();
    253255            if (obj->inherits ("QLabel"))
    254256            {
     
    265267        mWatched << watched;
    266268    }
    267 
    268     /* don't forget to delete the list */
    269     delete list;
    270269}
    271270
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r7207 r7220  
    4141#include <qmenudata.h>
    4242#include <qmenubar.h>
    43 #include <qwidgetlist.h>
     43#include <qwidget.h>
    4444#include <qtimer.h>
     45//Added by qt3to4:
     46#include <QDesktopWidget>
     47#include <QTimerEvent>
     48#include <QMoveEvent>
     49#include <QWheelEvent>
     50#include <QMouseEvent>
     51#include <QKeyEvent>
     52#include <QEvent>
     53#include <QPaintEvent>
    4554
    4655#ifdef Q_WS_WIN
     
    5463
    5564#ifdef Q_WS_X11
     65#include <QX11Info>
    5666// We need to capture some X11 events directly which
    5767// requires the XEvent structure to be defined. However,
     
    594604                                  const CConsole &console,
    595605                                  VBoxDefs::RenderMode rm,
    596                                   QWidget *parent, const char *name, WFlags f)
    597     : QScrollView (parent, name, f | WStaticContents | WNoAutoErase)
     606                                  QWidget *parent, const char *name, Qt::WFlags f)
     607    : Q3ScrollView (parent, name, f | Qt::WStaticContents | Qt::WNoAutoErase)
    598608    , mMainWnd (mainWnd)
    599609    , mConsole (console)
     
    746756    AssertWrapperOk (mConsole);
    747757
    748     viewport()->setEraseColor (black);
     758    viewport()->setEraseColor (Qt::black);
    749759
    750760    setSizePolicy (QSizePolicy (QSizePolicy::Maximum, QSizePolicy::Maximum));
    751761    setMaximumSize (sizeHint());
    752762
    753     setFocusPolicy (WheelFocus);
     763    setFocusPolicy (Qt::WheelFocus);
    754764
    755765#if defined (VBOX_GUI_DEBUG) && defined (VBOX_GUI_FRAMEBUF_STAT)
     
    970980     * no the required API. */
    971981    if (enabled)
    972         viewport()->setCursor (QCursor (BlankCursor));
     982        viewport()->setCursor (QCursor (Qt::BlankCursor));
    973983
    974984    mMouseIntegration = enabled;
     
    10791089                resizeContents (re->width(), re->height());
    10801090                /* let our toplevel widget calculate its sizeHint properly */
    1081                 QApplication::sendPostedEvents (0, QEvent::LayoutHint);
     1091                QApplication::sendPostedEvents (0, QEvent::LayoutRequest);
    10821092
    10831093                normalizeGeometry (true /* adjustPosition */);
     
    12131223            {
    12141224                ActivateMenuEvent *ame = (ActivateMenuEvent *) e;
    1215                 ame->menuData()->activateItemAt (ame->index());
     1225#warning port me
     1226//                ame->menuData()->activateItemAt (ame->index());
    12161227
    12171228                /*
     
    12211232                 *  destroyed widgets.
    12221233                 */
    1223                 QWidgetList *list = QApplication::topLevelWidgets();
    1224                 bool destroyed = list->find (mMainWnd) < 0;
    1225                 delete list;
     1234                QWidgetList list = QApplication::topLevelWidgets();
     1235                bool destroyed = list.indexOf (mMainWnd) < 0;
    12261236                if (!destroyed && mMainWnd->statusBar())
    12271237                    mMainWnd->statusBar()->clear();
     
    13021312                    const bool kShift = (gs.hostKey() == VK_SHIFT ||
    13031313                                        gs.hostKey() == VK_LSHIFT) &&
    1304                                         (ke->state() & ShiftButton);
     1314                                        (ke->state() & Qt::ShiftModifier);
    13051315                    /* define hot keys according to the Shift state */
    1306                     const int kAltTab      = kShift ? Key_Exclam     : Key_1;
    1307                     const int kAltShiftTab = kShift ? Key_At         : Key_2;
    1308                     const int kCtrlEsc     = kShift ? Key_AsciiTilde : Key_QuoteLeft;
     1316                    const int kAltTab      = kShift ? Qt::Key_Exclam     : Qt::Key_1;
     1317                    const int kAltShiftTab = kShift ? Qt::Key_At         : Qt::Key_2;
     1318                    const int kCtrlEsc     = kShift ? Qt::Key_AsciiTilde : Qt::Key_QuoteLeft;
    13091319
    13101320                    /* Simulate Alt+Tab on Host+1 and Alt+Shift+Tab on Host+2 */
     
    13701380                if (mIsHostkeyPressed && e->type() == QEvent::KeyPress)
    13711381                {
    1372                     if (ke->key() >= Key_F1 && ke->key() <= Key_F12)
     1382                    if (ke->key() >= Qt::Key_F1 && ke->key() <= Qt::Key_F12)
    13731383                    {
    13741384                        LONG combo [6];
     
    13771387                        combo [4] = 0xb8; /* Alt  up   */
    13781388                        combo [5] = 0x9d; /* Ctrl up   */
    1379                         if (ke->key() >= Key_F1 && ke->key() <= Key_F10)
     1389                        if (ke->key() >= Qt::Key_F1 && ke->key() <= Qt::Key_F10)
    13801390                        {
    1381                             combo [2] = 0x3b + (ke->key() - Key_F1); /* F1-F10 down */
    1382                             combo [3] = 0xbb + (ke->key() - Key_F1); /* F1-F10 up   */
     1391                            combo [2] = 0x3b + (ke->key() - Qt::Key_F1); /* F1-F10 down */
     1392                            combo [3] = 0xbb + (ke->key() - Qt::Key_F1); /* F1-F10 up   */
    13831393                        }
    13841394                        /* some scan slice */
    1385                         else if (ke->key() >= Key_F11 && ke->key() <= Key_F12)
     1395                        else if (ke->key() >= Qt::Key_F11 && ke->key() <= Qt::Key_F12)
    13861396                        {
    1387                             combo [2] = 0x57 + (ke->key() - Key_F11); /* F11-F12 down */
    1388                             combo [3] = 0xd7 + (ke->key() - Key_F11); /* F11-F12 up   */
     1397                            combo [2] = 0x57 + (ke->key() - Qt::Key_F11); /* F11-F12 down */
     1398                            combo [3] = 0xd7 + (ke->key() - Qt::Key_F11); /* F11-F12 up   */
    13891399                        }
    13901400                        else
     
    13941404                        keyboard.PutScancodes (combo, 6);
    13951405                    }
    1396                     else if (ke->key() == Key_Home)
     1406                    else if (ke->key() == Qt::Key_Home)
    13971407                    {
    13981408                        /* activate the main menu */
     
    14061416                        /* process hot keys not processed in keyEvent()
    14071417                         * (as in case of non-alphanumeric keys) */
    1408                         processHotKey (QKeySequence (ke->key()),
    1409                                        mMainWnd->menuBar());
     1418#warning port me
     1419//                        processHotKey (QKeySequence (ke->key()),
     1420//                                       mMainWnd->menuBar());
    14101421                    }
    14111422                }
     
    14521463    }
    14531464
    1454     return QScrollView::event (e);
     1465    return Q3ScrollView::event (e);
    14551466}
    14561467
     
    14691480                if (mouseEvent (me->type(), me->pos(), me->globalPos(),
    14701481                                me->button(), me->state(), me->stateAfter(),
    1471                                 0, Horizontal))
     1482                                0, Qt::Horizontal))
    14721483                    return true; /* stop further event handling */
    14731484                break;
     
    14771488                QWheelEvent *we = (QWheelEvent *) e;
    14781489                if (mouseEvent (we->type(), we->pos(), we->globalPos(),
    1479                                 NoButton, we->state(), we->state(),
     1490                                Qt::NoButton, we->state(), we->state(),
    14801491                                we->delta(), we->orientation()))
    14811492                    return true; /* stop further event handling */
     
    15731584            {
    15741585                QKeyEvent *ke = (QKeyEvent *) e;
    1575                 if (ke->key() == Key_Escape && !(ke->state() & KeyButtonMask))
     1586                if (ke->key() == Qt::Key_Escape && !(ke->state() & Qt::KeyboardModifierMask))
    15761587                    if (mMainWnd->menuBar()->hasFocus())
    15771588                        setFocus();
     
    15831594    }
    15841595
    1585     return QScrollView::eventFilter (watched, e);
     1596    return Q3ScrollView::eventFilter (watched, e);
    15861597}
    15871598
     
    21652176
    21662177    uKeyMaskCaps          = LockMask;
    2167     XModifierKeymap* map  = XGetModifierMapping(qt_xdisplay());
    2168     KeyCode keyCodeNum    = XKeysymToKeycode(qt_xdisplay(), XK_Num_Lock);
    2169     KeyCode keyCodeScroll = XKeysymToKeycode(qt_xdisplay(), XK_Scroll_Lock);
     2178    XModifierKeymap* map  = XGetModifierMapping(QX11Info::display());
     2179    KeyCode keyCodeNum    = XKeysymToKeycode(QX11Info::display(), XK_Num_Lock);
     2180    KeyCode keyCodeScroll = XKeysymToKeycode(QX11Info::display(), XK_Scroll_Lock);
    21702181
    21712182    for (int i = 0; i < 8; i++)
     
    21782189            uKeyMaskScroll = 1 << i;
    21792190    }
    2180     XQueryPointer(qt_xdisplay(), DefaultRootWindow(qt_xdisplay()), &wDummy1, &wDummy2,
     2191    XQueryPointer(QX11Info::display(), DefaultRootWindow(QX11Info::display()), &wDummy1, &wDummy2,
    21812192                  &iDummy3, &iDummy4, &iDummy5, &iDummy6, &uMask);
    21822193    XFreeModifiermap(map);
     
    24892500                ch = 0;
    24902501            if (ch)
    2491                 processed = processHotKey (QKeySequence (UNICODE_ACCEL +
     2502                processed = processHotKey (QKeySequence (Qt::UNICODE_ACCEL +
    24922503                                                QChar (ch).upper().unicode()),
    24932504                                           mMainWnd->menuBar());
     
    25092520            {
    25102521                QChar c = QString::fromLocal8Bit (&ch, 1) [0];
    2511                 processed = processHotKey (QKeySequence (UNICODE_ACCEL +
    2512                                                 c.upper().unicode()),
    2513                                            mMainWnd->menuBar());
     2522#warning port me
     2523//                processed = processHotKey (QKeySequence (Qt::UNICODE_ACCEL +
     2524//                                                c.upper().unicode()),
     2525//                                           mMainWnd->menuBar());
    25142526            }
    25152527        }
    25162528#elif defined (Q_WS_MAC)
    25172529        if (aUniKey && aUniKey [0] && !aUniKey [1])
    2518             processed = processHotKey (QKeySequence (UNICODE_ACCEL +
     2530            processed = processHotKey (QKeySequence (Qt::UNICODE_ACCEL +
    25192531                                                     QChar (aUniKey [0]).upper().unicode()),
    25202532                                       mMainWnd->menuBar());
     
    25702582 */
    25712583bool VBoxConsoleView::mouseEvent (int aType, const QPoint &aPos,
    2572                                   const QPoint &aGlobalPos, ButtonState aButton,
    2573                                   ButtonState aState, ButtonState aStateAfter,
    2574                                   int aWheelDelta, Orientation aWheelDir)
     2584                                  const QPoint &aGlobalPos, Qt::ButtonState aButton,
     2585                                  Qt::ButtonState aState, Qt::ButtonState aStateAfter,
     2586                                  int aWheelDelta, Qt::Orientation aWheelDir)
    25752587{
    25762588#if 0
     
    25882600
    25892601    int state = 0;
    2590     if (aStateAfter & LeftButton)
     2602    if (aStateAfter & Qt::LeftButton)
    25912603        state |= KMouseButtonState_LeftButton;
    2592     if (aStateAfter & RightButton)
     2604    if (aStateAfter & Qt::RightButton)
    25932605        state |= KMouseButtonState_RightButton;
    2594     if (aStateAfter & MidButton)
     2606    if (aStateAfter & Qt::MidButton)
    25952607        state |= KMouseButtonState_MiddleButton;
    25962608
    25972609    int wheel = 0;
    2598     if (aWheelDir == Vertical)
     2610    if (aWheelDir == Qt::Vertical)
    25992611    {
    26002612        /* the absolute value of wheel delta is 120 units per every wheel
     
    28872899                setMaximumSize (sizeHint());
    28882900                /* let our toplevel widget calculate its sizeHint properly */
    2889                 QApplication::sendPostedEvents (0, QEvent::LayoutHint);
     2901                QApplication::sendPostedEvents (0, QEvent::LayoutRequest);
    28902902                normalizeGeometry();
    28912903            }
     
    29152927            /* draw a part of vbuf */
    29162928            const QRect &r = pe->rect();
    2917             ::bitBlt (viewport(), r.x(), r.y(),
    2918                       &pm, r.x() + contentsX(), r.y() + contentsY(),
    2919                       r.width(), r.height(),
    2920                       CopyROP, TRUE);
     2929#warning port me
     2930//            ::bitBlt (viewport(), r.x(), r.y(),
     2931//                      &pm, r.x() + contentsX(), r.y() + contentsY(),
     2932//                      r.width(), r.height(),
     2933//                      CopyROP, TRUE);
    29212934        }
    29222935        else
     
    30503063        mCapturedPos = QCursor::pos();
    30513064#ifdef Q_WS_WIN32
    3052         viewport()->setCursor (QCursor (BlankCursor));
     3065        viewport()->setCursor (QCursor (Qt::BlankCursor));
    30533066        /* move the mouse to the center of the visible area */
    30543067        QCursor::setPos (mapToGlobal (visibleRect().center()));
     
    30993112     */
    31003113
    3101     for (uint i = 0; i < data->count(); i++)
    3102     {
    3103         int id = data->idAt (i);
    3104         QMenuItem *item = data->findItem (id);
    3105         if (item->popup())
    3106         {
    3107             if (processHotKey (key, item->popup()))
    3108                 return true;
    3109         }
    3110         else
    3111         {
    3112             QStringList list = QStringList::split ("\tHost+", data->text (id));
    3113             if (list.count() == 2)
    3114             {
    3115                 if (key.matches (QKeySequence (list[1])) == Identical)
    3116                 {
    3117                     /*
    3118                      *  we asynchronously post a special event instead of calling
    3119                      *  data->activateItemAt (i) directly, to let key presses
    3120                      *  and releases be processed correctly by Qt first.
    3121                      *  Note: we assume that nobody will delete the menu item
    3122                      *  corresponding to the key sequence, so that the pointer to
    3123                      *  menu data posted along with the event will remain valid in
    3124                      *  the event handler, at least until the main window is closed.
    3125                      */
    3126 
    3127                     QApplication::postEvent (this,
    3128                                              new ActivateMenuEvent (data, i));
    3129                     return true;
    3130                 }
    3131             }
    3132         }
    3133     }
     3114#warning port me
     3115//    for (uint i = 0; i < data->count(); i++)
     3116//    {
     3117//        int id = data->idAt (i);
     3118//        QMenuItem *item = data->findItem (id);
     3119//        if (item->popup())
     3120//        {
     3121//            if (processHotKey (key, item->popup()))
     3122//                return true;
     3123//        }
     3124//        else
     3125//        {
     3126//            QStringList list = QStringList::split ("\tHost+", data->text (id));
     3127//            if (list.count() == 2)
     3128//            {
     3129//                if (key.matches (QKeySequence (list[1])) == Identical)
     3130//                {
     3131//                    /*
     3132//                     *  we asynchronously post a special event instead of calling
     3133//                     *  data->activateItemAt (i) directly, to let key presses
     3134//                     *  and releases be processed correctly by Qt first.
     3135//                     *  Note: we assume that nobody will delete the menu item
     3136//                     *  corresponding to the key sequence, so that the pointer to
     3137//                     *  menu data posted along with the event will remain valid in
     3138//                     *  the event handler, at least until the main window is closed.
     3139//                     */
     3140//
     3141//                    QApplication::postEvent (this,
     3142//                                             new ActivateMenuEvent (data, i));
     3143//                    return true;
     3144//                }
     3145//            }
     3146//        }
     3147//    }
    31343148
    31353149    return false;
     
    32423256    if (mMouseCaptured)
    32433257    {
    3244         viewport()->setCursor (QCursor (BlankCursor));
     3258        viewport()->setCursor (QCursor (Qt::BlankCursor));
    32453259#ifdef Q_WS_WIN32
    32463260        QRect r = viewport()->rect();
     
    35093523        else
    35103524        {
    3511             viewport()->setCursor (QCursor::BlankCursor);
     3525            viewport()->setCursor (Qt::BlankCursor);
    35123526        }
    35133527    }
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r7207 r7220  
    3232#include <qaction.h>
    3333#include <qmenubar.h>
    34 #include <qbuttongroup.h>
     34#include <q3buttongroup.h>
    3535#include <qradiobutton.h>
    3636#include <qfile.h>
     
    4141#include <qeventloop.h>
    4242#include <qregexp.h>
     43//Added by qt3to4:
     44#include <QDesktopWidget>
     45#include <QResizeEvent>
     46#include <QContextMenuEvent>
     47#include <QLabel>
     48#include <QCloseEvent>
     49#include <Q3GridLayout>
     50#include <QShowEvent>
     51#include <q3mimefactory.h>
     52#include <Q3HBoxLayout>
     53#include <QEvent>
     54#include <Q3VBoxLayout>
     55#include <Q3Frame>
     56#include <Q3PopupMenu>
     57#include <Q3ActionGroup>
    4358
    4459#include <VBox/VBoxGuest.h>
     
    7994
    8095#ifdef RT_OS_DARWIN
    81 class QHttp;
    82 class QHttpResponseHeader;
     96class Q3Http;
     97class Q3HttpResponseHeader;
    8398#endif
    8499
     
    102117VBoxConsoleWnd::
    103118VBoxConsoleWnd (VBoxConsoleWnd **aSelf, QWidget* aParent, const char* aName,
    104                 WFlags aFlags)
    105     : QMainWindow (aParent, aName, aFlags)
     119                Qt::WFlags aFlags)
     120    : Q3MainWindow (aParent, aName, aFlags)
    106121    , mMainMenu (0)
    107122#ifdef VBOX_WITH_DEBUGGER_GUI
     
    116131    , mIsSeamless (false)
    117132    , mIsSeamlessSupported (false)
    118     , normal_wflags (getWFlags())
     133#warning port me
     134//    , normal_wflags (getWFlags())
    119135    , was_max (false)
    120136    , console_style (0)
     
    140156    /* default application icon (will change to the VM-specific icon in
    141157     * openView()) */
    142     setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
     158    setIcon (qPixmapFromMimeSource ("ico40x01.png"));
    143159
    144160    /* ensure status bar is created */
     
    150166     * Note that only actions whose enabled state depends exclusively on the
    151167     * execution state of the VM are added to this group. */
    152     mRunningActions = new QActionGroup (this);
     168    mRunningActions = new Q3ActionGroup (this);
    153169    mRunningActions->setExclusive (false);
    154170
     
    156172     * paused. Note that only actions whose enabled state depends exclusively
    157173     * on the execution state of the VM are added to this group. */
    158     mRunningOrPausedActions = new QActionGroup (this);
     174    mRunningOrPausedActions = new Q3ActionGroup (this);
    159175    mRunningOrPausedActions->setExclusive (false);
    160176
     
    281297    ///// Menubar ///////////////////////////////////////////////////////////
    282298
    283     mMainMenu = new QPopupMenu (this, "mMainMenu");
     299    mMainMenu = new Q3PopupMenu (this, "mMainMenu");
    284300
    285301    /* Machine submenu */
    286302
    287     QPopupMenu *vmMenu = new QPopupMenu (this, "vmMenu");
     303    Q3PopupMenu *vmMenu = new Q3PopupMenu (this, "vmMenu");
    288304
    289305    /* dynamic & status line popup menus */
     
    319335    /* Devices submenu */
    320336
    321     devicesMenu = new QPopupMenu (this, "devicesMenu");
     337    devicesMenu = new Q3PopupMenu (this, "devicesMenu");
    322338
    323339    /* dynamic & statusline popup menus */
    324     devicesMountFloppyMenu = new QPopupMenu (devicesMenu, "devicesMountFloppyMenu");
    325     devicesMountDVDMenu = new QPopupMenu (devicesMenu, "devicesMountDVDMenu");
    326     devicesSFMenu = new QPopupMenu (devicesMenu, "devicesSFMenu");
    327     devicesNetworkMenu = new QPopupMenu (devicesMenu, "devicesNetworkMenu");
     340    devicesMountFloppyMenu = new Q3PopupMenu (devicesMenu, "devicesMountFloppyMenu");
     341    devicesMountDVDMenu = new Q3PopupMenu (devicesMenu, "devicesMountDVDMenu");
     342    devicesSFMenu = new Q3PopupMenu (devicesMenu, "devicesSFMenu");
     343    devicesNetworkMenu = new Q3PopupMenu (devicesMenu, "devicesNetworkMenu");
    328344    devicesUSBMenu = new VBoxUSBMenu (devicesMenu);
    329345    devicesVRDPMenu = new VBoxSwitchMenu (devicesMenu, devicesSwitchVrdpAction);
     
    368384    if (vboxGlobal().isDebuggerEnabled())
    369385    {
    370         dbgMenu = new QPopupMenu (this, "dbgMenu");
     386        dbgMenu = new Q3PopupMenu (this, "dbgMenu");
    371387        dbgStatisticsAction->addTo (dbgMenu);
    372388        dbgCommandLineAction->addTo (dbgMenu);
     
    380396    /* Help submenu */
    381397
    382     QPopupMenu *helpMenu = new QPopupMenu( this, "helpMenu" );
     398    Q3PopupMenu *helpMenu = new Q3PopupMenu( this, "helpMenu" );
    383399
    384400    helpContentsAction->addTo (helpMenu);
     
    399415    ///// Status bar ////////////////////////////////////////////////////////
    400416
    401     QHBox *indicatorBox = new QHBox (0, "indicatorBox");
     417    Q3HBox *indicatorBox = new Q3HBox (0, "indicatorBox");
    402418    indicatorBox->setSpacing (5);
    403419    /* i/o devices */
    404     hd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "hd_light", WNoAutoErase);
    405     hd_light->setStateIcon (KDeviceActivity_Idle, QPixmap::fromMimeSource ("hd_16px.png"));
    406     hd_light->setStateIcon (KDeviceActivity_Reading, QPixmap::fromMimeSource ("hd_read_16px.png"));
    407     hd_light->setStateIcon (KDeviceActivity_Writing, QPixmap::fromMimeSource ("hd_write_16px.png"));
    408     hd_light->setStateIcon (KDeviceActivity_Null, QPixmap::fromMimeSource ("hd_disabled_16px.png"));
    409     cd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "cd_light", WNoAutoErase);
    410     cd_light->setStateIcon (KDeviceActivity_Idle, QPixmap::fromMimeSource ("cd_16px.png"));
    411     cd_light->setStateIcon (KDeviceActivity_Reading, QPixmap::fromMimeSource ("cd_read_16px.png"));
    412     cd_light->setStateIcon (KDeviceActivity_Writing, QPixmap::fromMimeSource ("cd_write_16px.png"));
    413     cd_light->setStateIcon (KDeviceActivity_Null, QPixmap::fromMimeSource ("cd_disabled_16px.png"));
    414     fd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "fd_light", WNoAutoErase);
    415     fd_light->setStateIcon (KDeviceActivity_Idle, QPixmap::fromMimeSource ("fd_16px.png"));
    416     fd_light->setStateIcon (KDeviceActivity_Reading, QPixmap::fromMimeSource ("fd_read_16px.png"));
    417     fd_light->setStateIcon (KDeviceActivity_Writing, QPixmap::fromMimeSource ("fd_write_16px.png"));
    418     fd_light->setStateIcon (KDeviceActivity_Null, QPixmap::fromMimeSource ("fd_disabled_16px.png"));
    419     net_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "net_light", WNoAutoErase);
    420     net_light->setStateIcon (KDeviceActivity_Idle, QPixmap::fromMimeSource ("nw_16px.png"));
    421     net_light->setStateIcon (KDeviceActivity_Reading, QPixmap::fromMimeSource ("nw_read_16px.png"));
    422     net_light->setStateIcon (KDeviceActivity_Writing, QPixmap::fromMimeSource ("nw_write_16px.png"));
    423     net_light->setStateIcon (KDeviceActivity_Null, QPixmap::fromMimeSource ("nw_disabled_16px.png"));
    424     usb_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "usb_light", WNoAutoErase);
    425     usb_light->setStateIcon (KDeviceActivity_Idle, QPixmap::fromMimeSource ("usb_16px.png"));
    426     usb_light->setStateIcon (KDeviceActivity_Reading, QPixmap::fromMimeSource ("usb_read_16px.png"));
    427     usb_light->setStateIcon (KDeviceActivity_Writing, QPixmap::fromMimeSource ("usb_write_16px.png"));
    428     usb_light->setStateIcon (KDeviceActivity_Null, QPixmap::fromMimeSource ("usb_disabled_16px.png"));
    429     sf_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "sf_light", WNoAutoErase);
    430     sf_light->setStateIcon (KDeviceActivity_Idle, QPixmap::fromMimeSource ("shared_folder_16px.png"));
    431     sf_light->setStateIcon (KDeviceActivity_Reading, QPixmap::fromMimeSource ("shared_folder_read_16px.png"));
    432     sf_light->setStateIcon (KDeviceActivity_Writing, QPixmap::fromMimeSource ("shared_folder_write_16px.png"));
    433     sf_light->setStateIcon (KDeviceActivity_Null, QPixmap::fromMimeSource ("shared_folder_disabled_16px.png"));
    434 
    435     (new QFrame (indicatorBox))->setFrameStyle (QFrame::VLine | QFrame::Sunken);
     420    hd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "hd_light", Qt::WNoAutoErase);
     421    hd_light->setStateIcon (KDeviceActivity_Idle, qPixmapFromMimeSource ("hd_16px.png"));
     422    hd_light->setStateIcon (KDeviceActivity_Reading, qPixmapFromMimeSource ("hd_read_16px.png"));
     423    hd_light->setStateIcon (KDeviceActivity_Writing, qPixmapFromMimeSource ("hd_write_16px.png"));
     424    hd_light->setStateIcon (KDeviceActivity_Null, qPixmapFromMimeSource ("hd_disabled_16px.png"));
     425    cd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "cd_light", Qt::WNoAutoErase);
     426    cd_light->setStateIcon (KDeviceActivity_Idle, qPixmapFromMimeSource ("cd_16px.png"));
     427    cd_light->setStateIcon (KDeviceActivity_Reading, qPixmapFromMimeSource ("cd_read_16px.png"));
     428    cd_light->setStateIcon (KDeviceActivity_Writing, qPixmapFromMimeSource ("cd_write_16px.png"));
     429    cd_light->setStateIcon (KDeviceActivity_Null, qPixmapFromMimeSource ("cd_disabled_16px.png"));
     430    fd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "fd_light", Qt::WNoAutoErase);
     431    fd_light->setStateIcon (KDeviceActivity_Idle, qPixmapFromMimeSource ("fd_16px.png"));
     432    fd_light->setStateIcon (KDeviceActivity_Reading, qPixmapFromMimeSource ("fd_read_16px.png"));
     433    fd_light->setStateIcon (KDeviceActivity_Writing, qPixmapFromMimeSource ("fd_write_16px.png"));
     434    fd_light->setStateIcon (KDeviceActivity_Null, qPixmapFromMimeSource ("fd_disabled_16px.png"));
     435    net_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "net_light", Qt::WNoAutoErase);
     436    net_light->setStateIcon (KDeviceActivity_Idle, qPixmapFromMimeSource ("nw_16px.png"));
     437    net_light->setStateIcon (KDeviceActivity_Reading, qPixmapFromMimeSource ("nw_read_16px.png"));
     438    net_light->setStateIcon (KDeviceActivity_Writing, qPixmapFromMimeSource ("nw_write_16px.png"));
     439    net_light->setStateIcon (KDeviceActivity_Null, qPixmapFromMimeSource ("nw_disabled_16px.png"));
     440    usb_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "usb_light", Qt::WNoAutoErase);
     441    usb_light->setStateIcon (KDeviceActivity_Idle, qPixmapFromMimeSource ("usb_16px.png"));
     442    usb_light->setStateIcon (KDeviceActivity_Reading, qPixmapFromMimeSource ("usb_read_16px.png"));
     443    usb_light->setStateIcon (KDeviceActivity_Writing, qPixmapFromMimeSource ("usb_write_16px.png"));
     444    usb_light->setStateIcon (KDeviceActivity_Null, qPixmapFromMimeSource ("usb_disabled_16px.png"));
     445    sf_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "sf_light", Qt::WNoAutoErase);
     446    sf_light->setStateIcon (KDeviceActivity_Idle, qPixmapFromMimeSource ("shared_folder_16px.png"));
     447    sf_light->setStateIcon (KDeviceActivity_Reading, qPixmapFromMimeSource ("shared_folder_read_16px.png"));
     448    sf_light->setStateIcon (KDeviceActivity_Writing, qPixmapFromMimeSource ("shared_folder_write_16px.png"));
     449    sf_light->setStateIcon (KDeviceActivity_Null, qPixmapFromMimeSource ("shared_folder_disabled_16px.png"));
     450
     451    (new Q3Frame (indicatorBox))->setFrameStyle (Q3Frame::VLine | Q3Frame::Sunken);
    436452
    437453#if 0 // do not show these indicators, information overload
    438454    /* vrdp state */
    439     vrdp_state = new QIStateIndicator (0, indicatorBox, "vrdp_state", WNoAutoErase);
    440     vrdp_state->setStateIcon (0, QPixmap::fromMimeSource ("vrdp_disabled_16px.png"));
    441     vrdp_state->setStateIcon (1, QPixmap::fromMimeSource ("vrdp_16px.png"));
     455    vrdp_state = new QIStateIndicator (0, indicatorBox, "vrdp_state", Qt::WNoAutoErase);
     456    vrdp_state->setStateIcon (0, qPixmapFromMimeSource ("vrdp_disabled_16px.png"));
     457    vrdp_state->setStateIcon (1, qPixmapFromMimeSource ("vrdp_16px.png"));
    442458    /* auto resize state */
    443     autoresize_state = new QIStateIndicator (1, indicatorBox, "autoresize_state", WNoAutoErase);
    444     autoresize_state->setStateIcon (0, QPixmap::fromMimeSource ("auto_resize_off_disabled_16px.png"));
    445     autoresize_state->setStateIcon (1, QPixmap::fromMimeSource ("auto_resize_off_16px.png"));
    446     autoresize_state->setStateIcon (2, QPixmap::fromMimeSource ("auto_resize_on_disabled_16px.png"));
    447     autoresize_state->setStateIcon (3, QPixmap::fromMimeSource ("auto_resize_on_16px.png"));
     459    autoresize_state = new QIStateIndicator (1, indicatorBox, "autoresize_state", Qt::WNoAutoErase);
     460    autoresize_state->setStateIcon (0, qPixmapFromMimeSource ("auto_resize_off_disabled_16px.png"));
     461    autoresize_state->setStateIcon (1, qPixmapFromMimeSource ("auto_resize_off_16px.png"));
     462    autoresize_state->setStateIcon (2, qPixmapFromMimeSource ("auto_resize_on_disabled_16px.png"));
     463    autoresize_state->setStateIcon (3, qPixmapFromMimeSource ("auto_resize_on_16px.png"));
    448464#endif
    449465
    450466    /* mouse */
    451     mouse_state = new QIStateIndicator (0, indicatorBox, "mouse_state", WNoAutoErase);
    452     mouse_state->setStateIcon (0, QPixmap::fromMimeSource ("mouse_disabled_16px.png"));
    453     mouse_state->setStateIcon (1, QPixmap::fromMimeSource ("mouse_16px.png"));
    454     mouse_state->setStateIcon (2, QPixmap::fromMimeSource ("mouse_seamless_16px.png"));
    455     mouse_state->setStateIcon (3, QPixmap::fromMimeSource ("mouse_can_seamless_16px.png"));
    456     mouse_state->setStateIcon (4, QPixmap::fromMimeSource ("mouse_can_seamless_uncaptured_16px.png"));
     467    mouse_state = new QIStateIndicator (0, indicatorBox, "mouse_state", Qt::WNoAutoErase);
     468    mouse_state->setStateIcon (0, qPixmapFromMimeSource ("mouse_disabled_16px.png"));
     469    mouse_state->setStateIcon (1, qPixmapFromMimeSource ("mouse_16px.png"));
     470    mouse_state->setStateIcon (2, qPixmapFromMimeSource ("mouse_seamless_16px.png"));
     471    mouse_state->setStateIcon (3, qPixmapFromMimeSource ("mouse_can_seamless_16px.png"));
     472    mouse_state->setStateIcon (4, qPixmapFromMimeSource ("mouse_can_seamless_uncaptured_16px.png"));
    457473    /* host key */
    458     hostkey_hbox = new QHBox (indicatorBox, "hostkey_hbox");
     474    hostkey_hbox = new Q3HBox (indicatorBox, "hostkey_hbox");
    459475    hostkey_hbox->setSpacing (3);
    460476    hostkey_state = new QIStateIndicator (0, hostkey_hbox, "hostkey_state");
    461     hostkey_state->setStateIcon (0, QPixmap::fromMimeSource ("hostkey_16px.png"));
    462     hostkey_state->setStateIcon (1, QPixmap::fromMimeSource ("hostkey_captured_16px.png"));
    463     hostkey_state->setStateIcon (2, QPixmap::fromMimeSource ("hostkey_pressed_16px.png"));
    464     hostkey_state->setStateIcon (3, QPixmap::fromMimeSource ("hostkey_captured_pressed_16px.png"));
     477    hostkey_state->setStateIcon (0, qPixmapFromMimeSource ("hostkey_16px.png"));
     478    hostkey_state->setStateIcon (1, qPixmapFromMimeSource ("hostkey_captured_16px.png"));
     479    hostkey_state->setStateIcon (2, qPixmapFromMimeSource ("hostkey_pressed_16px.png"));
     480    hostkey_state->setStateIcon (3, qPixmapFromMimeSource ("hostkey_captured_pressed_16px.png"));
    465481    hostkey_name = new QLabel (QIHotKeyEdit::keyName (vboxGlobal().settings().hostKey()),
    466482                               hostkey_hbox, "hostkey_name");
     
    594610    SetApplicationDockTileImage (dockImgOS);
    595611#endif
    596     mMaskShift.scale (0, 0, QSize::ScaleFree);
     612    mMaskShift.scale (0, 0, Qt::IgnoreAspectRatio);
    597613}
    598614
     
    639655    {
    640656        setCentralWidget (new QWidget (this, "centralWidget"));
    641         QGridLayout *pMainLayout = new QGridLayout(centralWidget(), 3, 3, 0, 0);
     657        Q3GridLayout *pMainLayout = new Q3GridLayout(centralWidget(), 3, 3, 0, 0);
    642658        mShiftingSpacerLeft = new QSpacerItem (0, 0,
    643659                                               QSizePolicy::Fixed,
     
    670686    activateUICustomizations();
    671687
    672     static_cast<QGridLayout*>(centralWidget()->layout())->addWidget(console, 1, 1, AlignVCenter | AlignHCenter);
     688    static_cast<Q3GridLayout*>(centralWidget()->layout())->addWidget(console, 1, 1, Qt::AlignVCenter | Qt::AlignHCenter);
    673689
    674690    CMachine cmachine = csession.GetMachine();
     
    713729        /* maximize if needed */
    714730        if (max)
    715             setWindowState (windowState() | WindowMaximized);
     731            setWindowState (windowState() | Qt::WindowMaximized);
    716732        was_max = max;
    717733
     
    11641180    }
    11651181
    1166     return QMainWindow::event (e);
     1182    return Q3MainWindow::event (e);
    11671183}
    11681184
     
    19621978        ULONG64 usedBits = screen.width() /* display width */
    19631979                         * screen.height() /* display height */
    1964                          * QColor::numBitPlanes(); /* bit per pixel */
     1980#warning port me: check this
     1981                         * depth(); /* bit per pixel */
     1982//                         * QColor::numBitPlanes(); /* bit per pixel */
    19651983        if (aOn && (availBits < usedBits))
    19661984        {
    19671985            vboxProblem().cannotEnterSeamlessMode (screen.width(),
    1968                 screen.height(), QColor::numBitPlanes());
     1986#warning port me: check this
     1987                screen.height(), depth());
     1988//                screen.height(), QColor::numBitPlanes());
    19691989            return false;
    19701990        }
     
    20692089
    20702090        /* Hide all but the central widget containing the console view. */
    2071         QObjectList *list = queryList (NULL, NULL, false, false);
    2072         for (QObject *obj = list->first(); obj != NULL; obj = list->next())
     2091        QObjectList list = queryList (NULL, NULL, false, false);
     2092        foreach (QObject *obj, list)
    20732093        {
    20742094            if (obj->isWidgetType() && obj != centralWidget())
     
    20822102            }
    20832103        }
    2084         delete list;
    20852104
    20862105#ifdef Q_WS_MAC
     
    20962115        /* Adjust colors and appearance. */
    20972116        mEraseColor = centralWidget()->eraseColor();
    2098         centralWidget()->setEraseColor (black);
     2117        centralWidget()->setEraseColor (Qt::black);
    20992118        console_style = console->frameStyle();
    2100         console->setFrameStyle (QFrame::NoFrame);
     2119        console->setFrameStyle (Q3Frame::NoFrame);
    21012120        console->setMaximumSize (scrGeo.size());
    2102         console->setVScrollBarMode (QScrollView::AlwaysOff);
    2103         console->setHScrollBarMode (QScrollView::AlwaysOff);
     2121        console->setVScrollBarMode (Q3ScrollView::AlwaysOff);
     2122        console->setHScrollBarMode (Q3ScrollView::AlwaysOff);
    21042123
    21052124        /* Going fullscreen */
    2106         setWindowState (windowState() ^ WindowFullScreen);
     2125        setWindowState (windowState() ^ Qt::WindowFullScreen);
    21072126#ifdef Q_WS_MAC /* setMask seems to not include the far border pixels. */
    21082127//        QRect maskRect = dtw->screenGeometry (this);
     
    21862205        console->setFrameStyle (console_style);
    21872206        console->setMaximumSize (console->sizeHint());
    2188         console->setVScrollBarMode (QScrollView::Auto);
    2189         console->setHScrollBarMode (QScrollView::Auto);
     2207        console->setVScrollBarMode (Q3ScrollView::Auto);
     2208        console->setHScrollBarMode (Q3ScrollView::Auto);
    21902209
    21912210        /* Show everything hidden when going fullscreen. */
    2192         for (QObject *obj = hidden_children.first(); obj != NULL;
    2193              obj = hidden_children.next())
     2211        foreach (QObject *obj, hidden_children)
    21942212            ((QWidget *) obj)->show();
    21952213        hidden_children.clear();
    21962214
    21972215        /* Going normal || maximized */
    2198         setWindowState (windowState() ^ WindowFullScreen);
     2216        setWindowState (windowState() ^ Qt::WindowFullScreen);
    21992217
    22002218        qApp->processEvents();
     
    22422260        QRect sRect = dtw->screenGeometry (this);
    22432261        QRect aRect (aTargetRect);
    2244         mMaskShift.scale (aTargetRect.left(), aTargetRect.top(), QSize::ScaleFree);
     2262        mMaskShift.scale (aTargetRect.left(), aTargetRect.top(), Qt::IgnoreAspectRatio);
    22452263#ifdef Q_WS_MAC
    22462264        /* On mac os x this isn't necessary cause the screen starts
     
    24702488    if (!console) return;
    24712489
    2472     VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg", WType_Dialog | WShowModal);
     2490    VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg", Qt::WType_Dialog | Qt::WShowModal);
    24732491    QUuid id = csession.GetMachine().GetId();
    24742492    dlg.setup (VBoxDefs::FD, true, &id);
     
    25142532    if (!console) return;
    25152533
    2516     VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg", WType_Dialog | WShowModal);
     2534    VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg", Qt::WType_Dialog | Qt::WShowModal);
    25172535    QUuid id = csession.GetMachine().GetId();
    25182536    dlg.setup (VBoxDefs::CD, true, &id);
     
    27282746    }
    27292747#else
    2730     QMainWindow::setMask (region);
     2748    Q3MainWindow::setMask (region);
    27312749#endif
    27322750}
     
    30483066        devicesSFMenu->exec (e->globalPos());
    30493067#else
    3050         if (devicesSFDialogAction->isEnabled())
    3051             devicesSFDialogAction->activate();
     3068#warning port me
     3069//        if (devicesSFDialogAction->isEnabled())
     3070//            devicesSFDialogAction->activate();
    30523071#endif
    30533072    }
     
    32993318void VBoxConsoleWnd::tryClose()
    33003319{
    3301     LogFlowFunc (("eventLoopLevel=%d\n", qApp->eventLoop()->loopLevel()));
    3302 
    3303     if (qApp->eventLoop()->loopLevel() > 1)
    3304     {
    3305         if (QApplication::activeModalWidget())
    3306             QApplication::activeModalWidget()->close();
    3307         else if (QApplication::activePopupWidget())
    3308             QApplication::activePopupWidget()->close();
    3309         else
    3310         {
     3320#warning port me
     3321//    LogFlowFunc (("eventLoopLevel=%d\n", qApp->eventLoop()->loopLevel()));
     3322//
     3323//    if (qApp->eventLoop()->loopLevel() > 1)
     3324//    {
     3325//        if (QApplication::activeModalWidget())
     3326//            QApplication::activeModalWidget()->close();
     3327//        else if (QApplication::activePopupWidget())
     3328//            QApplication::activePopupWidget()->close();
     3329//        else
     3330//        {
    33113331            /// @todo (r=dmik) in general, the following is not that correct
    33123332            //  because some custom modal event loop may not expect to be
     
    33143334            //  flags before calling exitLoop()). The alternative is to do
    33153335            //  nothing but wait keeping to post singleShot timers.
    3316             qApp->eventLoop()->exitLoop();
    3317         }
    3318 
    3319         QTimer::singleShot (0, this, SLOT (tryClose()));
    3320     }
    3321     else
    3322         close();
     3336//            qApp->eventLoop()->exitLoop();
     3337//        }
     3338//
     3339//        QTimer::singleShot (0, this, SLOT (tryClose()));
     3340//    }
     3341//    else
     3342//        close();
    33233343}
    33243344
     
    34033423VBoxSFDialog::VBoxSFDialog (QWidget  *aParent, CSession &aSession)
    34043424    : QDialog (aParent, "VBoxSFDialog", true /* modal */,
    3405                WType_Dialog | WShowModal)
     3425               Qt::WType_Dialog | Qt::WShowModal)
    34063426    , mSettings (0), mSession (aSession)
    34073427{
    34083428    /* Setup Dialog's options */
    34093429    setCaption (tr ("Shared Folders"));
    3410     setIcon (QPixmap::fromMimeSource ("select_file_16px.png"));
     3430    setIcon (qPixmapFromMimeSource ("select_file_16px.png"));
    34113431    setSizeGripEnabled (true);
    34123432
    34133433    /* Setup main dialog's layout */
    3414     QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10, "mainLayout");
     3434    Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 10, 10, "mainLayout");
    34153435
    34163436    /* Setup settings layout */
     
    34233443
    34243444    /* Setup button's layout */
    3425     QHBoxLayout *buttonLayout = new QHBoxLayout (mainLayout, 10, "buttonLayout");
     3445    Q3HBoxLayout *buttonLayout = new Q3HBoxLayout (mainLayout, 10, "buttonLayout");
    34263446    QPushButton *pbHelp = new QPushButton (tr ("Help"), this, "pbHelp");
    34273447    QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDownloaderWgt.cpp

    r5999 r7220  
    2323
    2424#include "qaction.h"
    25 #include "qprogressbar.h"
     25#include "q3progressbar.h"
    2626#include "qtoolbutton.h"
    2727#include "qlayout.h"
     
    2929#include "qdir.h"
    3030#include "qtimer.h"
     31//Added by qt3to4:
     32#include <Q3HBoxLayout>
     33#include <QEvent>
    3134
    3235/* These notifications are used to notify the GUI thread about different
     
    129132    , mConn (new HConnect (mUrl.host(), 80))
    130133    , mRequestThread (0)
    131     , mDataStream (mDataArray, IO_WriteOnly)
     134    , mDataStream (&mDataArray, QIODevice::WriteOnly)
    132135    , mTimeout (new QTimer (this))
    133136{
     
    140143    setFixedHeight (16);
    141144
    142     mProgressBar = new QProgressBar (this);
     145    mProgressBar = new Q3ProgressBar (this);
    143146    mProgressBar->setFixedWidth (100);
    144147    mProgressBar->setPercentageVisible (true);
     
    147150    mCancelButton = new QToolButton (this);
    148151    mCancelButton->setAutoRaise (true);
    149     mCancelButton->setFocusPolicy (TabFocus);
     152    mCancelButton->setFocusPolicy (Qt::TabFocus);
    150153    connect (mCancelButton, SIGNAL (clicked()),
    151154             this, SLOT (processAbort()));
    152155
    153     QHBoxLayout *mainLayout = new QHBoxLayout (this);
     156    Q3HBoxLayout *mainLayout = new Q3HBoxLayout (this);
    154157    mainLayout->addWidget (mProgressBar);
    155158    mainLayout->addWidget (mCancelButton);
     
    241244            {
    242245                QFile file (mTarget);
    243                 if (file.open (IO_WriteOnly))
     246                if (file.open (QIODevice::WriteOnly))
    244247                {
    245248                    file.writeBlock (mDataArray);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFBDDRAW.cpp

    r7207 r7220  
    2424
    2525#include <qapplication.h>
     26//Added by qt3to4:
     27#include <QMoveEvent>
     28#include <QPaintEvent>
    2629
    2730#include <iprt/param.h>
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFBQuartz2D.cpp

    r7207 r7220  
    2929/* Qt includes */
    3030#include <qapplication.h>
    31 #include <qmainwindow.h>
     31#include <q3mainwindow.h>
    3232#include <qstatusbar.h>
     33//Added by qt3to4:
     34#include <QPaintEvent>
     35#include <Q3MemArray>
    3336
    3437/** @class VBoxQuartz2DFrameBuffer
     
    237240        /* Ok, for more performance we set a clipping path of the
    238241         * regions given by this paint event. */
    239         QMemArray <QRect> a = pe->region().rects();
     242        Q3MemArray <QRect> a = pe->region().rects();
    240243        if (a.size() > 0)
    241244        {
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxFrameBuffer.cpp

    r7207 r7220  
    2424
    2525#include <qapplication.h>
     26//Added by qt3to4:
     27#include <QPaintEvent>
    2628
    2729//
     
    341343                                         r.width(), r.height()));
    342344
    343         ::bitBlt (mView->viewport(), r.x(), r.y(),
    344                   &mPM, 0, 0,
    345                   r.width(), r.height(),
    346                   Qt::CopyROP, TRUE);
     345#warning port me
     346//        ::bitBlt (mView->viewport(), r.x(), r.y(),
     347//                  &mPM, 0, 0,
     348//                  r.width(), r.height(),
     349//                  Qt::CopyROP, TRUE);
    347350    }
    348351    else
     
    353356                                      0, 0, QImage::LittleEndian));
    354357
    355         ::bitBlt (mView->viewport(), r.x(), r.y(),
    356                   &mPM, r.x() + mView->contentsX(), 0,
    357                   r.width(), r.height(),
    358                   Qt::CopyROP, TRUE);
     358#warning port me
     359//        ::bitBlt (mView->viewport(), r.x(), r.y(),
     360//                  &mPM, r.x() + mView->contentsX(), 0,
     361//                  r.width(), r.height(),
     362//                  Qt::CopyROP, TRUE);
    359363    }
    360364
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r7207 r7220  
    2424#include "VBoxProblemReporter.h"
    2525#include "QIHotKeyEdit.h"
     26//Added by qt3to4:
     27#include <QDesktopWidget>
     28#include <Q3CString>
     29#include <q3mimefactory.h>
     30#include <QTranslator>
     31#include <Q3VBoxLayout>
     32#include <Q3Frame>
     33#include <QEvent>
     34#include <QShowEvent>
     35#include <Q3PopupMenu>
     36#include <Q3HBoxLayout>
    2637
    2738#ifdef VBOX_WITH_REGISTRATION
     
    3243#include <qmessagebox.h>
    3344#include <qpixmap.h>
    34 #include <qiconset.h>
    35 #include <qwidgetlist.h>
    36 #include <qfiledialog.h>
     45#include <qicon.h>
     46#include <qwidget.h>
     47#include <q3filedialog.h>
    3748#include <qimage.h>
    3849#include <qlabel.h>
     
    4051
    4152#ifdef Q_WS_X11
    42 #include <qtextbrowser.h>
     53#include <q3textbrowser.h>
    4354#include <qpushbutton.h>
    4455#include <qlayout.h>
     
    5061#include <qregexp.h>
    5162#include <qlocale.h>
    52 #include <qprocess.h>
     63#include <q3process.h>
    5364
    5465#if defined (Q_WS_MAC)
     
    415426    {
    416427        winfilters += *it;
    417         winfilters += QChar::null;
     428        winfilters += QChar::Null;
    418429        winfilters += extractFilter (*it);
    419         winfilters += QChar::null;
    420     }
    421     winfilters += QChar::null;
     430        winfilters += QChar::Null;
     431    }
     432    winfilters += QChar::Null;
    422433    return winfilters;
    423434}
     
    557568    {
    558569        setCaption ("VirtualBox License");
    559         setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
    560 
    561         mLicenseText = new QTextBrowser (this);
     570        setIcon (qPixmapFromMimeSource ("ico40x01.png"));
     571
     572        mLicenseText = new Q3TextBrowser (this);
    562573        mAgreeButton = new QPushButton (tr ("I &Agree"), this);
    563574        mDisagreeButton = new QPushButton (tr ("I &Disagree"), this);
     
    570581        connect (mDisagreeButton, SIGNAL (clicked()), SLOT (reject()));
    571582
    572         QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10);
     583        Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 10, 10);
    573584        mainLayout->addWidget (mLicenseText);
    574585
    575         QHBoxLayout *buttonLayout = new QHBoxLayout (mainLayout, 10);
     586        Q3HBoxLayout *buttonLayout = new Q3HBoxLayout (mainLayout, 10);
    576587        buttonLayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding,
    577588                                                      QSizePolicy::Preferred));
     
    590601        /* read & show the license file */
    591602        QFile file (mFilePath);
    592         if (file.open (IO_ReadOnly))
     603        if (file.open (QIODevice::ReadOnly))
    593604        {
    594605            mLicenseText->setText (file.readAll());
     
    622633        QDialog::showEvent (aEvent);
    623634        bool isScrollBarHidden = mLicenseText->verticalScrollBar()->isHidden()
    624                                  && !(windowState() & WindowMinimized);
     635                                 && !(windowState() & Qt::WindowMinimized);
    625636        mAgreeButton->setEnabled (isScrollBarHidden);
    626637        mDisagreeButton->setEnabled (isScrollBarHidden);
     
    633644            case QEvent::Hide:
    634645                if (aObject == mLicenseText->verticalScrollBar() &&
    635                     (windowState() & WindowActive))
     646                    (windowState() & Qt::WindowActive))
    636647                    unlockButtons();
    637648            default:
     
    642653
    643654    QString       mFilePath;
    644     QTextBrowser *mLicenseText;
     655    Q3TextBrowser *mLicenseText;
    645656    QPushButton  *mAgreeButton;
    646657    QPushButton  *mDisagreeButton;
     
    14291440            if (device == KDeviceType_Null)
    14301441                continue;
    1431             if (bootOrder)
     1442            if (!bootOrder.isEmpty())
    14321443                bootOrder += ", ";
    14331444            bootOrder += toString (device);
    14341445        }
    1435         if (!bootOrder)
     1446        if (bootOrder.isEmpty())
    14361447            bootOrder = toString (KDeviceType_Null);
    14371448
     
    23052316     * human readable key names, we keep a table of them, which must be
    23062317     * updated when the language is changed. */
    2307     QIHotKeyEdit::languageChange();
     2318#warning port me
     2319    QIHotKeyEdit::languageChange_qt3();
    23082320#endif
    23092321}
     
    23432355    AssertReturnVoid (aLabel);
    23442356
    2345     QPixmap *pix = aLabel->pixmap();
     2357    const QPixmap *pix = aLabel->pixmap();
    23462358    QImage img = pix->convertToImage();
    23472359    QRgb rgbBack = img.pixel (img.width() - 1, img.height() - 1);
    23482360    QRgb rgbFrame = img.pixel (img.width() - 1, 0);
    23492361
    2350     aLabel->setAlignment (AlignTop);
     2362    aLabel->setAlignment (Qt::AlignTop);
    23512363
    23522364    aLabel->setPaletteBackgroundColor (QColor (rgbBack));
    2353     aLabel->setFrameShadow (QFrame::Plain);
    2354     aLabel->setFrameShape (QFrame::Box);
     2365    aLabel->setFrameShadow (Q3Frame::Plain);
     2366    aLabel->setFrameShape (Q3Frame::Box);
    23552367    aLabel->setPaletteForegroundColor (QColor (rgbFrame));
    23562368}
     
    23722384    {
    23732385        QFile file (aFileName);
    2374         if (!file.open (IO_ReadOnly))
     2386        if (!file.open (QIODevice::ReadOnly))
    23752387            return false;
    23762388        mData = file.readAll();
     
    25352547
    25362548/* static */
    2537 QIconSet VBoxGlobal::iconSet (const char *aNormal,
     2549QIcon VBoxGlobal::iconSet (const char *aNormal,
    25382550                              const char *aDisabled /* = 0 */,
    25392551                              const char *aActive /* = 0 */)
     
    25412553    Assert (aNormal);
    25422554
    2543     QIconSet iconSet;
    2544 
    2545     iconSet.setPixmap (QPixmap::fromMimeSource (aNormal),
    2546                        QIconSet::Automatic, QIconSet::Normal);
     2555    QIcon iconSet;
     2556
     2557    iconSet.setPixmap (qPixmapFromMimeSource (aNormal),
     2558                       QIcon::Automatic, QIcon::Normal);
    25472559    if (aDisabled)
    2548         iconSet.setPixmap (QPixmap::fromMimeSource (aDisabled),
    2549                            QIconSet::Automatic, QIconSet::Disabled);
     2560        iconSet.setPixmap (qPixmapFromMimeSource (aDisabled),
     2561                           QIcon::Automatic, QIcon::Disabled);
    25502562    if (aActive)
    2551         iconSet.setPixmap (QPixmap::fromMimeSource (aActive),
    2552                            QIconSet::Automatic, QIconSet::Active);
     2563        iconSet.setPixmap (qPixmapFromMimeSource (aActive),
     2564                           QIcon::Automatic, QIcon::Active);
    25532565    return iconSet;
    25542566}
    25552567
    25562568/* static */
    2557 QIconSet VBoxGlobal::
     2569QIcon VBoxGlobal::
    25582570iconSetEx (const char *aNormal, const char *aSmallNormal,
    25592571           const char *aDisabled /* = 0 */, const char *aSmallDisabled /* = 0 */,
     
    25632575    Assert (aSmallNormal);
    25642576
    2565     QIconSet iconSet;
    2566 
    2567     iconSet.setPixmap (QPixmap::fromMimeSource (aNormal),
    2568                        QIconSet::Large, QIconSet::Normal);
    2569     iconSet.setPixmap (QPixmap::fromMimeSource (aSmallNormal),
    2570                        QIconSet::Small, QIconSet::Normal);
     2577    QIcon iconSet;
     2578
     2579    iconSet.setPixmap (qPixmapFromMimeSource (aNormal),
     2580                       QIcon::Large, QIcon::Normal);
     2581    iconSet.setPixmap (qPixmapFromMimeSource (aSmallNormal),
     2582                       QIcon::Small, QIcon::Normal);
    25712583    if (aSmallDisabled)
    25722584    {
    2573         iconSet.setPixmap (QPixmap::fromMimeSource (aDisabled),
    2574                            QIconSet::Large, QIconSet::Disabled);
    2575         iconSet.setPixmap (QPixmap::fromMimeSource (aSmallDisabled),
    2576                            QIconSet::Small, QIconSet::Disabled);
     2585        iconSet.setPixmap (qPixmapFromMimeSource (aDisabled),
     2586                           QIcon::Large, QIcon::Disabled);
     2587        iconSet.setPixmap (qPixmapFromMimeSource (aSmallDisabled),
     2588                           QIcon::Small, QIcon::Disabled);
    25772589    }
    25782590    if (aSmallActive)
    25792591    {
    2580         iconSet.setPixmap (QPixmap::fromMimeSource (aActive),
    2581                            QIconSet::Large, QIconSet::Active);
    2582         iconSet.setPixmap (QPixmap::fromMimeSource (aSmallActive),
    2583                            QIconSet::Small, QIconSet::Active);
     2592        iconSet.setPixmap (qPixmapFromMimeSource (aActive),
     2593                           QIcon::Large, QIcon::Active);
     2594        iconSet.setPixmap (qPixmapFromMimeSource (aSmallActive),
     2595                           QIcon::Small, QIcon::Active);
    25842596    }
    25852597
     
    26062618
    26072619    /* remember the icon set as setText() will kill it */
    2608     QIconSet iset = aToolButton->iconSet();
     2620    QIcon iset = aToolButton->iconSet();
    26092621    /* re-use the setText() method to detect and set the accelerator */
    26102622    aToolButton->setText (aTextLabel);
     
    27012713    int extraw = 0, extrah = 0;
    27022714
    2703     QWidgetList *list = QApplication::topLevelWidgets();
    2704     QWidgetListIt it (*list);
    2705     while ((extraw == 0 || extrah == 0) && it.current() != 0)
     2715    QWidgetList list = QApplication::topLevelWidgets();
     2716    QListIterator<QWidget*> it (list);
     2717    while ((extraw == 0 || extrah == 0) && it.hasNext())
    27062718    {
    27072719        int framew, frameh;
    2708         QWidget *current = it.current();
    2709         ++ it;
     2720        QWidget *current = it.next();
    27102721        if (!current->isVisible())
    27112722            continue;
     
    27172728        extrah = QMAX (extrah, frameh);
    27182729    }
    2719     delete list;
    27202730
    27212731    /// @todo (r=dmik) not sure if we really need this
     
    31403150#else
    31413151
    3142     return QFileDialog::getExistingDirectory (aDir, aParent, aName, aCaption,
     3152    return Q3FileDialog::getExistingDirectory (aDir, aParent, aName, aCaption,
    31433153                                              aDirOnly, aResolveSymlinks);
    31443154
     
    32823292#else
    32833293
    3284     return QFileDialog::getOpenFileName (aStartWith, aFilters, aParent, aName,
     3294    return Q3FileDialog::getOpenFileName (aStartWith, aFilters, aParent, aName,
    32853295                                         aCaption, aSelectedFilter, aResolveSymlinks);
    32863296
     
    34963506    if (aParent == NULL)
    34973507    {
    3498         QWidgetList *list = QApplication::topLevelWidgets();
    3499         QWidgetListIt it (*list);
    3500         QWidget *w = NULL;
    3501         for (; (w = it.current()) != NULL; ++ it)
     3508        QWidgetList list = QApplication::topLevelWidgets();
     3509        QWidget* w = NULL;
     3510        foreach(w, list)
    35023511        {
    35033512            if ((!aName || strcmp (w->name(), aName) == 0) &&
     
    35113520            }
    35123521        }
    3513         delete list;
    35143522        return w;
    35153523    }
    35163524
    3517     QObjectList *list = aParent->queryList (aName, aClassName, false, true);
    3518     QObjectListIt it (*list);
     3525    QObjectList list = aParent->queryList (aName, aClassName, false, true);
    35193526    QObject *obj = NULL;
    3520     for (; (obj = it.current()) != NULL; ++ it)
     3527    foreach(obj, list)
    35213528    {
    35223529        if (obj->isWidgetType())
    35233530            break;
    35243531    }
    3525     delete list;
    35263532    return (QWidget *) obj;
    35273533}
     
    35793585        QStringList args = QStringList::split (':', commands [i]);
    35803586        args += aURL;
    3581         QProcess cmd (args);
     3587        Q3Process cmd (args);
    35823588        if (cmd.start())
    35833589            return true;
     
    36013607    {
    36023608        ConstStr255Param hint (0x0);
    3603         QCString cs = aURL.local8Bit();
     3609        Q3CString cs = aURL.local8Bit();
    36043610        const char* data = cs.data();
    36053611        long length = cs.length();
     
    36353641    {
    36363642        /* Show the already opened registration dialog */
    3637         mRegDlg->setWindowState (mRegDlg->windowState() & ~WindowMinimized);
     3643        mRegDlg->setWindowState (mRegDlg->windowState() & ~Qt::WindowMinimized);
    36383644        mRegDlg->raise();
    36393645        mRegDlg->setActiveWindow();
     
    36533659        {
    36543660            /* We've got the "mutex", create a new registration dialog */
    3655             VBoxRegistrationDlg *dlg =
    3656                 new VBoxRegistrationDlg (0, 0, false, WDestructiveClose);
    3657             dlg->setup (&mRegDlg);
    3658             Assert (dlg == mRegDlg);
    3659             mRegDlg->show();
     3661#warning port me
     3662//            VBoxRegistrationDlg *dlg =
     3663//                new VBoxRegistrationDlg (0, 0, false, Qt::WDestructiveClose);
     3664//            dlg->setup (&mRegDlg);
     3665//            Assert (dlg == mRegDlg);
     3666//            mRegDlg->show();
    36603667        }
    36613668    }
     
    37633770         * order to invalidate cached string resources (like the details view
    37643771         * templates) that may be used by other widgets. */
    3765         QWidgetList *list = QApplication::topLevelWidgets();
    3766         if (list->first() == aObject)
     3772        QWidgetList list = QApplication::topLevelWidgets();
     3773        if (list.first() == aObject)
    37673774        {
    37683775            /* call this only once per every language change (see
     
    37703777            languageChange();
    37713778        }
    3772         delete list;
    37733779    }
    37743780
     
    38473853    {
    38483854        vm_os_type_icons.insert (osTypeIcons [n][0],
    3849             new QPixmap (QPixmap::fromMimeSource (osTypeIcons [n][1])));
     3855            new QPixmap (qPixmapFromMimeSource (osTypeIcons [n][1])));
    38503856    }
    38513857
     
    38753881    {
    38763882        mStateIcons.insert (vmStateIcons [n].state,
    3877             new QPixmap (QPixmap::fromMimeSource (vmStateIcons [n].name)));
     3883            new QPixmap (qPixmapFromMimeSource (vmStateIcons [n].name)));
    38783884    }
    38793885
    38803886    // online/offline snapshot icons
    3881     mOfflineSnapshotIcon = QPixmap::fromMimeSource ("offline_snapshot_16px.png");
    3882     mOnlineSnapshotIcon = QPixmap::fromMimeSource ("online_snapshot_16px.png");
     3887    mOfflineSnapshotIcon = qPixmapFromMimeSource ("offline_snapshot_16px.png");
     3888    mOnlineSnapshotIcon = qPixmapFromMimeSource ("online_snapshot_16px.png");
    38833889
    38843890    // initialize state colors vector
    38853891    // no ownership of elements, we're passing pointers to existing objects
    3886     vm_state_color.insert (KMachineState_Null,           &Qt::red);
    3887     vm_state_color.insert (KMachineState_PoweredOff,     &Qt::gray);
    3888     vm_state_color.insert (KMachineState_Saved,          &Qt::yellow);
    3889     vm_state_color.insert (KMachineState_Aborted,        &Qt::darkRed);
    3890     vm_state_color.insert (KMachineState_Running,        &Qt::green);
    3891     vm_state_color.insert (KMachineState_Paused,         &Qt::darkGreen);
    3892     vm_state_color.insert (KMachineState_Stuck,          &Qt::darkMagenta);
    3893     vm_state_color.insert (KMachineState_Starting,       &Qt::green);
    3894     vm_state_color.insert (KMachineState_Stopping,       &Qt::green);
    3895     vm_state_color.insert (KMachineState_Saving,         &Qt::green);
    3896     vm_state_color.insert (KMachineState_Restoring,      &Qt::green);
    3897     vm_state_color.insert (KMachineState_Discarding,     &Qt::green);
     3892    vm_state_color.insert (KMachineState_Null,           new QColor(Qt::red));
     3893    vm_state_color.insert (KMachineState_PoweredOff,     new QColor(Qt::gray));
     3894    vm_state_color.insert (KMachineState_Saved,          new QColor(Qt::yellow));
     3895    vm_state_color.insert (KMachineState_Aborted,        new QColor(Qt::darkRed));
     3896    vm_state_color.insert (KMachineState_Running,        new QColor(Qt::green));
     3897    vm_state_color.insert (KMachineState_Paused,         new QColor(Qt::darkGreen));
     3898    vm_state_color.insert (KMachineState_Stuck,          new QColor(Qt::darkMagenta));
     3899    vm_state_color.insert (KMachineState_Starting,       new QColor(Qt::green));
     3900    vm_state_color.insert (KMachineState_Stopping,       new QColor(Qt::green));
     3901    vm_state_color.insert (KMachineState_Saving,         new QColor(Qt::green));
     3902    vm_state_color.insert (KMachineState_Restoring,      new QColor(Qt::green));
     3903    vm_state_color.insert (KMachineState_Discarding,     new QColor(Qt::green));
    38983904
    38993905    qApp->installEventFilter (this);
     
    39883994     *  QToolButton::sizeHint()).
    39893995     */
    3990     QIconSet::setIconSize (QIconSet::Small, QSize (16, 16));
    3991     QIconSet::setIconSize (QIconSet::Large, QSize (22, 22));
     3996#warning port me
     3997//    QIcon::setIconSize (QIcon::Small, QSize (16, 16));
     3998//    QIcon::setIconSize (QIcon::Large, QSize (22, 22));
    39923999
    39934000    mValid = true;
     
    40644071 *  This class provides the list of USB devices attached to the host.
    40654072 */
    4066 VBoxUSBMenu::VBoxUSBMenu (QWidget *aParent) : QPopupMenu (aParent)
     4073VBoxUSBMenu::VBoxUSBMenu (QWidget *aParent) : Q3PopupMenu (aParent)
    40674074{
    40684075    connect (this, SIGNAL (aboutToShow()),
     
    41494156VBoxSwitchMenu::VBoxSwitchMenu (QWidget *aParent, QAction *aAction,
    41504157                                bool aInverted)
    4151     : QPopupMenu (aParent), mAction (aAction), mInverted (aInverted)
     4158    : Q3PopupMenu (aParent), mAction (aAction), mInverted (aInverted)
    41524159{
    41534160    /* this menu works only with toggle action */
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxMediaComboBox.cpp

    r6823 r7220  
    2525#include <qfile.h>
    2626#include <qtooltip.h>
    27 #include <qlistbox.h>
     27#include <q3listbox.h>
     28//Added by qt3to4:
     29#include <QPixmap>
    2830
    2931VBoxMediaComboBox::VBoxMediaComboBox (QWidget *aParent, const char *aName,
     
    5153
    5254    /* in some qt themes embedded list-box is not used by default, so create it */
    53     if (!listBox())
    54         setListBox (new QListBox (this));
    55     if (listBox())
    56         connect (listBox(), SIGNAL (onItem (QListBoxItem*)),
    57                  this, SLOT (processOnItem (QListBoxItem*)));
     55#warning port me
     56//    if (!listBox())
     57//        setListBox (new Q3ListBox (this));
     58//    if (listBox())
     59//        connect (listBox(), SIGNAL (onItem (Q3ListBoxItem*)),
     60//                 this, SLOT (processOnItem (Q3ListBoxItem*)));
    5861
    5962    /* cache pixmaps as class members */
     
    237240}
    238241
    239 void VBoxMediaComboBox::processOnItem (QListBoxItem* aItem)
     242void VBoxMediaComboBox::processOnItem (Q3ListBoxItem* aItem)
    240243{
    241244    /* combobox item's tooltip attaching */
    242     int index = listBox()->index (aItem);
    243     QToolTip::remove (listBox()->viewport());
    244     QToolTip::add (listBox()->viewport(), mTipList [index]);
     245#warning port me
     246//    int index = listBox()->index (aItem);
     247//    QToolTip::remove (listBox()->viewport());
     248//    QToolTip::add (listBox()->viewport(), mTipList [index]);
    245249}
    246250
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxNetworkFramework.cpp

    r5999 r7220  
    1919#include <VBoxNetworkFramework.h>
    2020#include <qapplication.h>
     21//Added by qt3to4:
     22#include <QEvent>
    2123
    2224/* These notifications are used to notify the GUI thread about different
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp

    r7207 r7220  
    2828
    2929#include <qmessagebox.h>
    30 #include <qprogressdialog.h>
     30#include <q3progressdialog.h>
    3131#include <qcursor.h>
    32 #include <qprocess.h>
     32#include <q3process.h>
    3333#include <qeventloop.h>
    3434#include <qregexp.h>
     
    3636# include <qpushbutton.h>
    3737#endif
     38//Added by qt3to4:
     39#include <QTimerEvent>
     40#include <Q3CString>
     41#include <QCloseEvent>
    3842
    3943#include <iprt/err.h>
     
    5963 *        is destroyed.
    6064 */
    61 class VBoxProgressDialog : public QProgressDialog
     65class VBoxProgressDialog : public Q3ProgressDialog
    6266{
    6367public:
     
    6670                        int aMinDuration = 2000, QWidget *aCreator = 0,
    6771                        const char *aName = 0)
    68         : QProgressDialog (aCreator, aName, true,
    69                            WStyle_Customize | WStyle_DialogBorder | WStyle_Title)
     72        : Q3ProgressDialog (aCreator, aName, true,
     73                           Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_Title)
    7074        , mProgress (aProgress)
    7175        , mCalcelEnabled (true)
     
    100104    virtual void timerEvent (QTimerEvent *e);
    101105
    102     virtual void reject() { if (mCalcelEnabled) QProgressDialog::reject(); };
     106    virtual void reject() { if (mCalcelEnabled) Q3ProgressDialog::reject(); };
    103107
    104108    virtual void closeEvent (QCloseEvent *e)
    105109    {
    106110        if (mCalcelEnabled)
    107             QProgressDialog::closeEvent (e);
     111            Q3ProgressDialog::closeEvent (e);
    108112        else
    109113            e->ignore();
     
    129133    if (mProgress.isOk())
    130134    {
     135#warning port me
    131136        /* start a refresh timer */
    132         startTimer (aRefreshInterval);
    133         mLoopLevel = qApp->eventLoop()->loopLevel();
    134         /* enter the modal loop */
    135         qApp->eventLoop()->enterLoop();
    136         killTimers();
    137         mLoopLevel = -1;
    138         mEnded = false;
     137//        startTimer (aRefreshInterval);
     138//        mLoopLevel = qApp->eventLoop()->loopLevel();
     139//        /* enter the modal loop */
     140//        qApp->eventLoop()->enterLoop();
     141//        killTimers();
     142//        mLoopLevel = -1;
     143//        mEnded = false;
    139144        return result();
    140145    }
     
    165170        if (mLoopLevel != -1)
    166171        {
    167             /* we've entered the loop in run() */
    168             if (mLoopLevel + 1 == qApp->eventLoop()->loopLevel())
    169             {
    170                 /* it's our loop, exit it */
    171                 qApp->eventLoop()->exitLoop();
    172             }
    173             else
    174             {
    175                 Assert (mLoopLevel + 1 < qApp->eventLoop()->loopLevel());
    176                 /* restart the timer to watch for the loop level to drop */
    177                 if (justEnded)
    178                     startTimer (50);
    179             }
     172#warning port me
     173//            /* we've entered the loop in run() */
     174//            if (mLoopLevel + 1 == qApp->eventLoop()->loopLevel())
     175//            {
     176//                /* it's our loop, exit it */
     177//                qApp->eventLoop()->exitLoop();
     178//            }
     179//            else
     180//            {
     181//                Assert (mLoopLevel + 1 < qApp->eventLoop()->loopLevel());
     182//                /* restart the timer to watch for the loop level to drop */
     183//                if (justEnded)
     184//                    startTimer (50);
     185//            }
    180186        }
    181187        else
     
    349355        box->setButtonText (2, aText3);
    350356
    351     if (aDetails)
     357    if (!aDetails.isEmpty())
    352358    {
    353359        box->setDetailsText (aDetails);
     
    409415    int aMinDuration)
    410416{
    411     QApplication::setOverrideCursor (QCursor (WaitCursor));
     417    QApplication::setOverrideCursor (QCursor (Qt::WaitCursor));
    412418
    413419    VBoxProgressDialog progressDlg (aProgress, aTitle, aMinDuration,
     
    17641770    //  - add common buttons like Retry/Save/PowerOff/whatever
    17651771
    1766     QCString autoConfimId = "showRuntimeError.";
     1772    Q3CString autoConfimId = "showRuntimeError.";
    17671773
    17681774    CConsole console = aConsole;
     
    18701876    QString formatted;
    18711877
    1872     if (aInfo.text())
     1878    if (!aInfo.text().isEmpty())
    18731879        formatted += QString ("<table bgcolor=#FFFFFF border=0 cellspacing=0 "
    18741880                              "cellpadding=0 width=100%>"
     
    19261932        {
    19271933            QString s = aInfo.interfaceID();
    1928             if (aInfo.interfaceName())
     1934            if (!aInfo.interfaceName().isEmpty())
    19291935                s = aInfo.interfaceName() + ' ' + s;
    19301936            formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
     
    19351941        {
    19361942            QString s = aInfo.calleeIID();
    1937             if (aInfo.calleeName())
     1943            if (!aInfo.calleeName().isEmpty())
    19381944                s = aInfo.calleeName() + ' ' + s;
    19391945            formatted += QString ("<tr><td>%1</td><td>%2</td></tr>")
     
    20132019
    20142020    QString fullProgPath = QString(szDocsPath);
    2015     QProcess kchmViewer (QString(szViewerPath) + "/kchmviewer");
     2021    Q3Process kchmViewer (QString(szViewerPath) + "/kchmviewer");
    20162022    kchmViewer.addArgument (fullProgPath + "/VirtualBox.chm");
    2017     kchmViewer.launch ("");
     2023    kchmViewer.launch (QString(""));
    20182024#elif defined (Q_WS_MAC)
    2019     QProcess openApp (QString("/usr/bin/open"));
     2025    Q3Process openApp (QString("/usr/bin/open"));
    20202026    openApp.addArgument (qApp->applicationDirPath() + "/UserManual.pdf");
    20212027    openApp.launch ("");
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp

    r7207 r7220  
    3131
    3232#include <qlabel.h>
    33 #include <qtextbrowser.h>
     33#include <q3textbrowser.h>
    3434#include <qmenubar.h>
    35 #include <qpopupmenu.h>
     35#include <q3popupmenu.h>
    3636#include <qmessagebox.h>
    37 #include <qwidgetlist.h>
     37#include <qwidget.h>
    3838#include <qtabwidget.h>
    39 #include <qwidgetstack.h>
    40 #include <qbutton.h>
    41 #include <qprocess.h>
     39#include <q3widgetstack.h>
     40#include <qpushbutton.h>
     41#include <q3process.h>
    4242
    4343#include <qlayout.h>
    44 #include <qvbox.h>
     44#include <q3vbox.h>
     45//Added by qt3to4:
     46#include <QDesktopWidget>
     47#include <Q3HBoxLayout>
     48#include <Q3Frame>
     49#include <q3mimefactory.h>
     50#include <QResizeEvent>
     51#include <QEvent>
     52#include <Q3VBoxLayout>
     53#include <QMenuItem>
    4554
    4655#ifdef Q_WS_X11
     
    5665 *  and another one for inaccessibility errors.
    5766 */
    58 class VBoxVMDetailsView : public QWidgetStack
     67class VBoxVMDetailsView : public Q3WidgetStack
    5968{
    6069    Q_OBJECT
     
    106115    void createErrPage();
    107116
    108     QTextBrowser *mDetailsText;
     117    Q3TextBrowser *mDetailsText;
    109118
    110119    QWidget *mErrBox;
    111120    QLabel *mErrLabel;
    112     QTextBrowser *mErrText;
     121    Q3TextBrowser *mErrText;
    113122    QToolButton *mRefreshButton;
    114123    QAction *mRefreshAction;
     
    117126VBoxVMDetailsView::VBoxVMDetailsView (QWidget *aParent, const char *aName,
    118127                                      QAction *aRefreshAction /* = NULL */)
    119     : QWidgetStack (aParent, aName)
     128    : Q3WidgetStack (aParent, aName)
    120129    , mErrBox (NULL), mErrLabel (NULL), mErrText (NULL)
    121130    , mRefreshButton (NULL)
     
    126135    /* create normal details page */
    127136
    128     mDetailsText = new QTextBrowser (mErrBox);
    129     mDetailsText->setFocusPolicy (QWidget::StrongFocus);
     137    mDetailsText = new Q3TextBrowser (mErrBox);
     138    mDetailsText->setFocusPolicy (Qt::StrongFocus);
    130139    mDetailsText->setLinkUnderline (false);
    131140    /* make "transparent" */
    132     mDetailsText->setFrameShape (QFrame::NoFrame);
     141    mDetailsText->setFrameShape (Q3Frame::NoFrame);
    133142    mDetailsText->setPaper (backgroundBrush());
    134143
     
    148157    mErrBox = new QWidget();
    149158
    150     QVBoxLayout *layout = new QVBoxLayout (mErrBox);
     159    Q3VBoxLayout *layout = new Q3VBoxLayout (mErrBox);
    151160    layout->setSpacing (10);
    152161
    153162    mErrLabel = new QLabel (mErrBox);
    154     mErrLabel->setAlignment (WordBreak);
     163    mErrLabel->setAlignment (Qt::WordBreak);
    155164    mErrLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
    156165    layout->add (mErrLabel);
    157166
    158     mErrText = new QTextBrowser (mErrBox);
    159     mErrText->setFocusPolicy (QWidget::StrongFocus);
     167    mErrText = new Q3TextBrowser (mErrBox);
     168    mErrText->setFocusPolicy (Qt::StrongFocus);
    160169    mErrText->setLinkUnderline (false);
    161170    layout->add (mErrText);
     
    164173    {
    165174        mRefreshButton = new QToolButton (mErrBox);
    166         mRefreshButton->setFocusPolicy (QWidget::StrongFocus);
    167 
    168         QHBoxLayout *hLayout = new QHBoxLayout (layout);
     175        mRefreshButton->setFocusPolicy (Qt::StrongFocus);
     176
     177        Q3HBoxLayout *hLayout = new Q3HBoxLayout (layout);
    169178        hLayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding,
    170179                                                 QSizePolicy::Minimum));
     
    235244    VBoxSelectorWnd *mParent;
    236245    QToolButton *mBtnEdit;
    237     QTextBrowser *mBrowser;
     246    Q3TextBrowser *mBrowser;
    238247    QLabel *mLabel;
    239248};
     
    246255{
    247256    /* main layout */
    248     QVBoxLayout *mainLayout = new QVBoxLayout (this, 0, 10, "mainLayout");
     257    Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 0, 10, "mainLayout");
    249258
    250259    /* mBrowser */
    251     mBrowser = new QTextBrowser (this, "mBrowser");
     260    mBrowser = new Q3TextBrowser (this, "mBrowser");
    252261    mBrowser->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
    253     mBrowser->setFocusPolicy (QWidget::StrongFocus);
     262    mBrowser->setFocusPolicy (Qt::StrongFocus);
    254263    mBrowser->setLinkUnderline (false);
    255264    mainLayout->addWidget (mBrowser);
     
    260269    mLabel->setFrameStyle (mBrowser->frameStyle());
    261270    mLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
    262     mLabel->setAlignment (AlignCenter | WordBreak);
     271    mLabel->setAlignment (Qt::AlignCenter | Qt::WordBreak);
    263272    mainLayout->addWidget (mLabel);
    264273    /* always disabled */
     
    266275
    267276    /* button layout */
    268     QHBoxLayout *btnLayout = new QHBoxLayout (mainLayout, 10, "btnLayout");
     277    Q3HBoxLayout *btnLayout = new Q3HBoxLayout (mainLayout, 10, "btnLayout");
    269278    btnLayout->addItem (new QSpacerItem (0, 0,
    270279                                         QSizePolicy::Expanding,
     
    274283    mBtnEdit = new QToolButton (this, "mBtnEdit");
    275284    mBtnEdit->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Fixed);
    276     mBtnEdit->setFocusPolicy (QWidget::StrongFocus);
     285    mBtnEdit->setFocusPolicy (Qt::StrongFocus);
    277286    mBtnEdit->setIconSet (VBoxGlobal::iconSet ("edit_description_16px.png",
    278287                                               "edit_description_disabled_16px.png"));
     
    379388VBoxSelectorWnd::
    380389VBoxSelectorWnd (VBoxSelectorWnd **aSelf, QWidget* aParent, const char* aName,
    381                  WFlags aFlags)
    382     : QMainWindow (aParent, aName, aFlags)
     390                 Qt::WFlags aFlags)
     391    : Q3MainWindow (aParent, aName, aFlags)
    383392    , doneInaccessibleWarningOnce (false)
    384393{
     
    389398
    390399    /* application icon */
    391     setIcon (QPixmap::fromMimeSource ("ico40x01.png"));
     400    setIcon (qPixmapFromMimeSource ("ico40x01.png"));
    392401
    393402    /* actions */
     
    449458    /* central widget & horizontal layout */
    450459    setCentralWidget (new QWidget (this, "centralWidget"));
    451     QHBoxLayout *centralLayout =
    452         new QHBoxLayout (centralWidget(), 5, 9, "centralLayout");
     460    Q3HBoxLayout *centralLayout =
     461        new Q3HBoxLayout (centralWidget(), 5, 9, "centralLayout");
    453462
    454463    /* left vertical box */
    455     QVBox *leftVBox = new QVBox (centralWidget(), "leftWidget");
     464    Q3VBox *leftVBox = new Q3VBox (centralWidget(), "leftWidget");
    456465    leftVBox->setSpacing (5);
    457466    /* right vertical box */
    458     QVBox *rightVBox = new QVBox (centralWidget(), "rightWidget");
     467    Q3VBox *rightVBox = new Q3VBox (centralWidget(), "rightWidget");
    459468    rightVBox->setSpacing (5);
    460469    centralLayout->addWidget (leftVBox, 3);
     
    511520    /* add actions to menubar */
    512521
    513     QPopupMenu *fileMenu = new QPopupMenu(this, "fileMenu");
     522    Q3PopupMenu *fileMenu = new Q3PopupMenu(this, "fileMenu");
    514523    fileDiskMgrAction->addTo( fileMenu );
    515524    fileMenu->insertSeparator();
     
    520529    menuBar()->insertItem( QString::null, fileMenu, 1);
    521530
    522     QPopupMenu *vmMenu = new QPopupMenu (this, "vmMenu");
     531    Q3PopupMenu *vmMenu = new Q3PopupMenu (this, "vmMenu");
    523532    vmNewAction->addTo (vmMenu);
    524533    vmMenu->insertSeparator();
     
    537546    menuBar()->insertItem (QString::null, vmMenu, 2);
    538547
    539     mVMCtxtMenu = new QPopupMenu (this, "mVMCtxtMenu");
     548    mVMCtxtMenu = new Q3PopupMenu (this, "mVMCtxtMenu");
    540549    vmConfigAction->addTo (mVMCtxtMenu);
    541550    vmDeleteAction->addTo (mVMCtxtMenu);
     
    550559    vmShowLogsAction->addTo (mVMCtxtMenu);
    551560
    552     QPopupMenu *helpMenu = new QPopupMenu( this, "helpMenu" );
     561    Q3PopupMenu *helpMenu = new Q3PopupMenu( this, "helpMenu" );
    553562    helpContentsAction->addTo (helpMenu);
    554563    helpWebAction->addTo (helpMenu);
     
    610619    }
    611620
    612     clearWState (WState_Polished);
     621#warning port me
     622//    clearWState (WState_Polished);
    613623
    614624    /* signals and slots connections */
     
    638648             &vboxProblem(), SLOT (resetSuppressedMessages()));
    639649
    640     connect (vmListBox, SIGNAL (currentChanged(QListBoxItem *)),
     650    connect (vmListBox, SIGNAL (currentChanged(Q3ListBoxItem *)),
    641651             this, SLOT (vmListBoxCurrentChanged()));
    642     connect (vmListBox, SIGNAL (selected (QListBoxItem *)),
     652    connect (vmListBox, SIGNAL (selected (Q3ListBoxItem *)),
    643653             this, SLOT (vmStart()));
    644     connect (vmListBox, SIGNAL (contextMenuRequested (QListBoxItem *, const QPoint &)),
    645              this, SLOT (showContextMenu (QListBoxItem *, const QPoint &)));
     654    connect (vmListBox, SIGNAL (contextMenuRequested (Q3ListBoxItem *, const QPoint &)),
     655             this, SLOT (showContextMenu (Q3ListBoxItem *, const QPoint &)));
    646656
    647657    connect (vmDetailsView, SIGNAL (linkClicked (const QString &)),
     
    687697    /* save vm selector position */
    688698    {
    689         QListBoxItem *item = vmListBox->selectedItem();
     699        Q3ListBoxItem *item = vmListBox->selectedItem();
    690700        QString curVMId = item ?
    691701            QString (static_cast<VBoxVMListBoxItem*> (item)->id()) :
     
    10541064}
    10551065
    1056 void VBoxSelectorWnd::showContextMenu (QListBoxItem *aItem, const QPoint &aPoint)
     1066void VBoxSelectorWnd::showContextMenu (Q3ListBoxItem *aItem, const QPoint &aPoint)
    10571067{
    10581068    if (aItem)
     
    10741084        {
    10751085            QResizeEvent *re = (QResizeEvent *) e;
    1076             if ((windowState() & (WindowMaximized | WindowMinimized |
    1077                                   WindowFullScreen)) == 0)
     1086            if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized |
     1087                                  Qt::WindowFullScreen)) == 0)
    10781088                normal_size = re->size();
    10791089            break;
     
    10811091        case QEvent::Move:
    10821092        {
    1083             if ((windowState() & (WindowMaximized | WindowMinimized |
    1084                                   WindowFullScreen)) == 0)
     1093            if ((windowState() & (Qt::WindowMaximized | Qt::WindowMinimized |
     1094                                  Qt::WindowFullScreen)) == 0)
    10851095                normal_pos = pos();
    10861096            break;
     
    10961106    }
    10971107
    1098     return QMainWindow::event (e);
     1108    return Q3MainWindow::event (e);
    10991109}
    11001110
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMListBox.cpp

    r7207 r7220  
    2929
    3030#include <qfileinfo.h>
     31//Added by qt3to4:
     32#include <QPixmap>
     33#include <q3mimefactory.h>
     34#include <QFocusEvent>
    3135
    3236#if defined (Q_WS_MAC)
     
    140144////////////////////////////////////////////////////////////////////////////////
    141145
    142 class VBoxVMListBoxTip : public QToolTip
    143 {
    144 public:
    145 
    146     VBoxVMListBoxTip (VBoxVMListBox *aLB, QToolTipGroup *aTG = 0)
    147         : QToolTip (aLB, aTG)
    148     {}
    149 
    150     virtual ~VBoxVMListBoxTip()
    151     {
    152         remove (parentWidget());
    153     }
    154 
    155     void maybeTip (const QPoint &aPnt);
    156 };
    157 
    158 void VBoxVMListBoxTip::maybeTip (const QPoint &aPnt)
    159 {
    160     const VBoxVMListBox *lb = static_cast <VBoxVMListBox *> (parentWidget());
    161 
    162     VBoxVMListBoxItem *vmi = static_cast <VBoxVMListBoxItem *> (lb->itemAt (aPnt));
    163     if (!vmi)
    164         return;
    165 
    166     if (parentWidget()->topLevelWidget()->inherits ("QMainWindow"))
    167     {
    168         /*
    169          *  Ensure the main window doesn't show the text from the previous
    170          *  tooltip in the status bar.
    171          */
    172         QToolTipGroup *toolTipGroup =
    173             (::qt_cast <QMainWindow *> (parentWidget()->topLevelWidget()))->
    174                 toolTipGroup();
    175         if (toolTipGroup)
    176         {
    177             int index = toolTipGroup->metaObject()->findSignal("removeTip()", false);
    178             toolTipGroup->qt_emit (index, 0);
    179         }
    180     }
    181 
    182     tip (lb->itemRect (vmi), vmi->toolTipText());
    183 }
     146#warning port me
     147//class VBoxVMListBoxTip : public QToolTip
     148//{
     149//public:
     150//
     151//    VBoxVMListBoxTip (VBoxVMListBox *aLB, QToolTipGroup *aTG = 0)
     152//        : QToolTip (aLB, aTG)
     153//    {}
     154//
     155//    virtual ~VBoxVMListBoxTip()
     156//    {
     157//        remove (parentWidget());
     158//    }
     159//
     160//    void maybeTip (const QPoint &aPnt);
     161//};
     162//
     163//void VBoxVMListBoxTip::maybeTip (const QPoint &aPnt)
     164//{
     165//    const VBoxVMListBox *lb = static_cast <VBoxVMListBox *> (parentWidget());
     166//
     167//    VBoxVMListBoxItem *vmi = static_cast <VBoxVMListBoxItem *> (lb->itemAt (aPnt));
     168//    if (!vmi)
     169//        return;
     170//
     171//    if (parentWidget()->topLevelWidget()->inherits ("QMainWindow"))
     172//    {
     173//        /*
     174//         *  Ensure the main window doesn't show the text from the previous
     175//         *  tooltip in the status bar.
     176//         */
     177//        QToolTipGroup *toolTipGroup =
     178//            (::qt_cast <Q3MainWindow *> (parentWidget()->topLevelWidget()))->
     179//                toolTipGroup();
     180//        if (toolTipGroup)
     181//        {
     182//            int index = toolTipGroup->metaObject()->findSignal("removeTip()", false);
     183//            toolTipGroup->qt_emit (index, 0);
     184//        }
     185//    }
     186//
     187//    tip (lb->itemRect (vmi), vmi->toolTipText());
     188//}
    184189
    185190////////////////////////////////////////////////////////////////////////////////
     
    193198VBoxVMListBox::
    194199VBoxVMListBox (QWidget *aParent /* = 0 */, const char *aName /* = NULL */,
    195                WFlags aFlags /* = 0 */)
    196     : QListBox (aParent, aName, aFlags)
     200               Qt::WFlags aFlags /* = 0 */)
     201    : Q3ListBox (aParent, aName, aFlags)
    197202{
    198203    mVBox = vboxGlobal().virtualBox();
     
    205210    mMargin = QMAX (fontMetrics().width (' ') * 2, 8);
    206211
    207     mToolTip = new VBoxVMListBoxTip (this);
     212#warning port me
     213//    mToolTip = new VBoxVMListBoxTip (this);
    208214
    209215    mGaveFocusToPopup = false;
     
    214220VBoxVMListBox::~VBoxVMListBox()
    215221{
    216     delete mToolTip;
     222#warning port me
     223//    delete mToolTip;
    217224}
    218225
     
    244251    for (uint i = 0; i < count(); i++)
    245252    {
    246         VBoxVMListBoxItem *vmi = (VBoxVMListBoxItem *) QListBox::item (i);
     253        VBoxVMListBoxItem *vmi = (VBoxVMListBoxItem *) Q3ListBox::item (i);
    247254        if (vmi->id() == aID)
    248255        {
     
    263270    for (uint i = 0; i < count(); i++)
    264271    {
    265         VBoxVMListBoxItem *vmi = (VBoxVMListBoxItem *) QListBox::item (i);
     272        VBoxVMListBoxItem *vmi = (VBoxVMListBoxItem *) Q3ListBox::item (i);
    266273        if (vmi->id() == aID)
    267274            return vmi;
     
    285292     * Here is a modified extract from qlistbox.cpp: */
    286293
    287     bool drawActiveSelection =
    288         !style().styleHint (QStyle::SH_ItemView_ChangeHighlightOnFocus, this) ||
    289         hasFocus() ||
    290         mGaveFocusToPopup;
    291 
    292     return (drawActiveSelection ? colorGroup() : palette().inactive());
     294#warning port me
     295//    bool drawActiveSelection =
     296//        !style().styleHint (QStyle::SH_ItemView_ChangeHighlightOnFocus, this) ||
     297//        hasFocus() ||
     298//        mGaveFocusToPopup;
     299//
     300//    return (drawActiveSelection ? colorGroup() : palette().inactive());
     301    return colorGroup();
    293302}
    294303
     
    299308{
    300309    mGaveFocusToPopup = false;
    301     QListBox::focusInEvent (aE);
     310    Q3ListBox::focusInEvent (aE);
    302311}
    303312
     
    306315    /* A modified extract from qlistbox.cpp (see #activeColorGroup()): */
    307316    mGaveFocusToPopup =
    308         QFocusEvent::reason() == QFocusEvent::Popup ||
     317#warning port me: check this
     318        aE->reason() == QFocusEvent::Popup ||
     319//        QFocusEvent::reason() == QFocusEvent::Popup ||
    309320        (qApp->focusWidget() && qApp->focusWidget()->inherits ("QMenuBar"));
    310     QListBox::focusOutEvent (aE);
     321    Q3ListBox::focusOutEvent (aE);
    311322}
    312323
     
    319330
    320331VBoxVMListBoxItem::VBoxVMListBoxItem (VBoxVMListBox *aLB, const CMachine &aM)
    321     : QListBoxItem (aLB), mMachine (aM)
     332    : Q3ListBoxItem (aLB), mMachine (aM)
    322333{
    323334    recache();
     
    443454}
    444455
    445 int VBoxVMListBoxItem::width (const QListBox *) const
     456int VBoxVMListBoxItem::width (const Q3ListBox *) const
    446457{
    447458    /* see the picture below for dimensions */
     
    467478    {
    468479        /// @todo (r=dmik) temporary
    469         pmOSType = QPixmap::fromMimeSource ("os_other.png");
    470         pmState = QPixmap::fromMimeSource ("state_aborted_16px.png");
     480        pmOSType = qPixmapFromMimeSource ("os_other.png");
     481        pmState = qPixmapFromMimeSource ("state_aborted_16px.png");
    471482        strState = VBoxVMListBox::tr ("Inaccessible");
    472483    }
     
    482493}
    483494
    484 int VBoxVMListBoxItem::height (const QListBox *) const
     495int VBoxVMListBoxItem::height (const Q3ListBox *) const
    485496{
    486497    /* see the picture below for dimensions */
     
    503514    {
    504515        /// @todo (r=dmik) temporary
    505         pmOSType = QPixmap::fromMimeSource ("os_other.png");
    506         pmState = QPixmap::fromMimeSource ("state_aborted_16px.png");
     516        pmOSType = qPixmapFromMimeSource ("os_other.png");
     517        pmState = qPixmapFromMimeSource ("state_aborted_16px.png");
    507518    }
    508519
     
    685696    {
    686697        /// @todo (r=dmik) temporary
    687         pmOSType = QPixmap::fromMimeSource ("os_other.png");
    688         pmState = QPixmap::fromMimeSource ("state_aborted_16px.png");
     698        pmOSType = qPixmapFromMimeSource ("os_other.png");
     699        pmState = qPixmapFromMimeSource ("state_aborted_16px.png");
    689700        strState = VBoxVMListBox::tr ("Inaccessible");
    690701    }
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxAboutDlg.ui.h

    r6285 r7220  
     1//Added by qt3to4:
     2#include <QMouseEvent>
    13/**
    24 *
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxDiskImageManagerDlg.ui

    r5999 r7220  
    496496    <include location="global" impldecl="in implementation">qapplication.h</include>
    497497    <include location="global" impldecl="in implementation">qprogressdialog.h</include>
    498     <include location="global" impldecl="in implementation">qfocusdata.h</include>
    499498    <include location="global" impldecl="in implementation">qobjectlist.h</include>
    500499    <include location="global" impldecl="in implementation">qdragobject.h</include>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxDiskImageManagerDlg.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <QResizeEvent>
     3#include <QLabel>
     4#include <QPixmap>
     5#include <QCloseEvent>
     6#include <Q3GridLayout>
     7#include <QShowEvent>
     8#include <q3mimefactory.h>
     9#include <QDragEnterEvent>
     10#include <QKeyEvent>
     11#include <QEvent>
     12#include <Q3VBoxLayout>
     13#include <Q3Frame>
     14#include <QDropEvent>
     15#include <QCustomEvent>
     16#include <Q3PopupMenu>
     17#include <QMenuBar>
     18#include <QMenuItem>
    119/**
    220 *
     
    2745
    2846
    29 class DiskImageItem : public QListViewItem
     47class DiskImageItem : public Q3ListViewItem
    3048{
    3149public:
     
    3452
    3553    DiskImageItem (DiskImageItem *parent) :
    36         QListViewItem (parent), mStatus (VBoxMedia::Unknown) {}
    37 
    38     DiskImageItem (QListView *parent) :
    39         QListViewItem (parent), mStatus (VBoxMedia::Unknown) {}
     54        Q3ListViewItem (parent), mStatus (VBoxMedia::Unknown) {}
     55
     56    DiskImageItem (Q3ListView *parent) :
     57        Q3ListViewItem (parent), mStatus (VBoxMedia::Unknown) {}
    4058
    4159    void setMedia (const VBoxMedia &aMedia) { mMedia = aMedia; }
     
    100118    int rtti() const { return TypeId; }
    101119
    102     int compare (QListViewItem *aItem, int aColumn, bool aAscending) const
     120    int compare (Q3ListViewItem *aItem, int aColumn, bool aAscending) const
    103121    {
    104122        ULONG64 thisValue = vboxGlobal().parseSize (       text (aColumn));
     
    112130        }
    113131        else
    114             return QListViewItem::compare (aItem, aColumn, aAscending);
     132            return Q3ListViewItem::compare (aItem, aColumn, aAscending);
    115133    }
    116134
    117135    DiskImageItem* nextSibling() const
    118136    {
    119         return (QListViewItem::nextSibling() &&
    120                 QListViewItem::nextSibling()->rtti() == DiskImageItem::TypeId) ?
    121                 static_cast<DiskImageItem*> (QListViewItem::nextSibling()) : 0;
     137        return (Q3ListViewItem::nextSibling() &&
     138                Q3ListViewItem::nextSibling()->rtti() == DiskImageItem::TypeId) ?
     139                static_cast<DiskImageItem*> (Q3ListViewItem::nextSibling()) : 0;
    122140    }
    123141
     
    128146        if (mStatus == VBoxMedia::Unknown)
    129147            cGroup.setColor (QColorGroup::Text, cGroup.mid());
    130         QListViewItem::paintCell (aPainter, cGroup, aColumn, aWidth, aSlign);
     148        Q3ListViewItem::paintCell (aPainter, cGroup, aColumn, aWidth, aSlign);
    131149    }
    132150
     
    154172
    155173
    156 class DiskImageItemIterator : public QListViewItemIterator
     174class DiskImageItemIterator : public Q3ListViewItemIterator
    157175{
    158176public:
    159177
    160     DiskImageItemIterator (QListView* aList)
    161         : QListViewItemIterator (aList) {}
     178    DiskImageItemIterator (Q3ListView* aList)
     179        : Q3ListViewItemIterator (aList) {}
    162180
    163181    DiskImageItem* operator*()
    164182    {
    165         QListViewItem *item = QListViewItemIterator::operator*();
     183        Q3ListViewItem *item = Q3ListViewItemIterator::operator*();
    166184        return item && item->rtti() == DiskImageItem::TypeId ?
    167185            static_cast<DiskImageItem*> (item) : 0;
     
    170188    DiskImageItemIterator& operator++()
    171189    {
    172         return (DiskImageItemIterator&) QListViewItemIterator::operator++();
     190        return (DiskImageItemIterator&) Q3ListViewItemIterator::operator++();
    173191    }
    174192};
     
    200218            new VBoxDiskImageManagerDlg (NULL,
    201219                                         "VBoxDiskImageManagerDlg",
    202                                          WType_TopLevel | WDestructiveClose);
     220                                         Qt::WType_TopLevel | Qt::WDestructiveClose);
    203221        mModelessDialog->setup (VBoxDefs::HD | VBoxDefs::CD | VBoxDefs::FD,
    204222                                false, NULL, aRefresh);
     
    218236    mModelessDialog->show();
    219237    mModelessDialog->setWindowState (mModelessDialog->windowState() &
    220                                      ~WindowMinimized);
     238                                     ~Qt::WindowMinimized);
    221239    mModelessDialog->setActiveWindow();
    222240}
     
    234252    Assert (!vbox.isNull());
    235253
    236     setIcon (QPixmap::fromMimeSource ("diskim_16px.png"));
     254    setIcon (qPixmapFromMimeSource ("diskim_16px.png"));
    237255
    238256    type = VBoxDefs::InvalidType;
     
    278296    cdsView->setShowToolTips (false);
    279297    fdsView->setShowToolTips (false);
    280     connect (hdsView, SIGNAL (onItem (QListViewItem*)),
    281              this, SLOT (mouseOnItem(QListViewItem*)));
    282     connect (cdsView, SIGNAL (onItem (QListViewItem*)),
    283              this, SLOT (mouseOnItem(QListViewItem*)));
    284     connect (fdsView, SIGNAL (onItem (QListViewItem*)),
    285              this, SLOT (mouseOnItem(QListViewItem*)));
     298    connect (hdsView, SIGNAL (onItem (Q3ListViewItem*)),
     299             this, SLOT (mouseOnItem(Q3ListViewItem*)));
     300    connect (cdsView, SIGNAL (onItem (Q3ListViewItem*)),
     301             this, SLOT (mouseOnItem(Q3ListViewItem*)));
     302    connect (fdsView, SIGNAL (onItem (Q3ListViewItem*)),
     303             this, SLOT (mouseOnItem(Q3ListViewItem*)));
    286304
    287305
     
    293311
    294312    /* context menu composing */
    295     itemMenu = new QPopupMenu (this, "itemMenu");
     313    itemMenu = new Q3PopupMenu (this, "itemMenu");
    296314
    297315    imNewAction = new QAction (this, "imNewAction");
     
    340358    toolBar = new VBoxToolBar (this, centralWidget(), "toolBar");
    341359    toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
    342     ((QVBoxLayout*)centralWidget()->layout())->insertWidget(0, toolBar);
     360    ((Q3VBoxLayout*)centralWidget()->layout())->insertWidget(0, toolBar);
    343361
    344362    toolBar->setUsesTextLabel (true);
     
    359377
    360378    /* menu bar */
    361     QPopupMenu *actionMenu = new QPopupMenu (this, "actionMenu");
     379    Q3PopupMenu *actionMenu = new Q3PopupMenu (this, "actionMenu");
    362380    imNewAction->addTo    (actionMenu);
    363381    imAddAction->addTo    (actionMenu);
     
    380398    qApp->installEventFilter (this);
    381399    /* setup information pane layouts */
    382     QGridLayout *hdsContainerLayout = new QGridLayout (hdsContainer, 4, 4);
     400    Q3GridLayout *hdsContainerLayout = new Q3GridLayout (hdsContainer, 4, 4);
    383401    hdsContainerLayout->setMargin (10);
    384     QGridLayout *cdsContainerLayout = new QGridLayout (cdsContainer, 2, 4);
     402    Q3GridLayout *cdsContainerLayout = new Q3GridLayout (cdsContainer, 2, 4);
    385403    cdsContainerLayout->setMargin (10);
    386     QGridLayout *fdsContainerLayout = new QGridLayout (fdsContainer, 2, 4);
     404    Q3GridLayout *fdsContainerLayout = new Q3GridLayout (fdsContainer, 2, 4);
    387405    fdsContainerLayout->setMargin (10);
    388406    /* create info-pane for hd list-view */
     
    403421    mProgressText = new QLabel (centralWidget());
    404422    mProgressText->setHidden (true);
    405     buttonLayout->insertWidget (2, mProgressText);
    406     mProgressBar = new QProgressBar (centralWidget());
     423#warning port me
     424//    buttonLayout->insertWidget (2, mProgressText);
     425    mProgressBar = new Q3ProgressBar (centralWidget());
    407426    mProgressBar->setHidden (true);
    408     mProgressBar->setFrameShadow (QFrame::Sunken);
    409     mProgressBar->setFrameShape  (QFrame::Panel);
     427    mProgressBar->setFrameShadow (Q3Frame::Sunken);
     428    mProgressBar->setFrameShape  (Q3Frame::Panel);
    410429    mProgressBar->setPercentageVisible (false);
    411430    mProgressBar->setMaximumWidth (100);
    412     buttonLayout->insertWidget (3, mProgressBar);
     431#warning port me
     432//    buttonLayout->insertWidget (3, mProgressBar);
    413433
    414434
     
    476496
    477497    /* Setup focus policy <strong> default for info pane */
    478     aInfo->setFocusPolicy (QWidget::StrongFocus);
     498    aInfo->setFocusPolicy (Qt::StrongFocus);
    479499
    480500    /* prevent the name columns from being expanded */
     
    483503    if (aColumn == -1)
    484504    {
    485         ((QGridLayout *) aRoot->layout())->addWidget (nameLabel, aRow, 0);
    486         ((QGridLayout *) aRoot->layout())->
     505        ((Q3GridLayout *) aRoot->layout())->addWidget (nameLabel, aRow, 0);
     506        ((Q3GridLayout *) aRoot->layout())->
    487507            addMultiCellWidget (aInfo, aRow, aRow,
    488                                 1, ((QGridLayout *) aRoot->layout())->numCols() - 1);
     508                                1, ((Q3GridLayout *) aRoot->layout())->numCols() - 1);
    489509    }
    490510    else
    491511    {
    492         ((QGridLayout *) aRoot->layout())->addWidget (nameLabel, aRow, aColumn * 2);
    493         ((QGridLayout *) aRoot->layout())->addWidget (aInfo, aRow, aColumn * 2 + 1);
     512        ((Q3GridLayout *) aRoot->layout())->addWidget (nameLabel, aRow, aColumn * 2);
     513        ((Q3GridLayout *) aRoot->layout())->addWidget (aInfo, aRow, aColumn * 2 + 1);
    494514    }
    495515}
     
    498518void VBoxDiskImageManagerDlg::showEvent (QShowEvent *e)
    499519{
    500     QMainWindow::showEvent (e);
     520    Q3MainWindow::showEvent (e);
    501521
    502522    /* one may think that QWidget::polish() is the right place to do things
     
    515535
    516536
    517 void VBoxDiskImageManagerDlg::mouseOnItem (QListViewItem *aItem)
    518 {
    519     QListView *currentList = getCurrentListView();
     537void VBoxDiskImageManagerDlg::mouseOnItem (Q3ListViewItem *aItem)
     538{
     539    Q3ListView *currentList = getCurrentListView();
    520540    QString tip;
    521541    switch (aItem->rtti())
     
    548568{
    549569    if ( aEvent->state() == 0 ||
    550          (aEvent->state() & Keypad && aEvent->key() == Key_Enter) )
     570         (aEvent->state() & Qt::KeypadModifier && aEvent->key() == Qt::Key_Enter) )
    551571    {
    552572        switch ( aEvent->key() )
    553573        {
    554             case Key_Enter:
    555             case Key_Return:
     574            case Qt::Key_Enter:
     575            case Qt::Key_Return:
    556576            {
    557577                QPushButton *currentDefault = searchDefaultButton();
     
    560580                break;
    561581            }
    562             case Key_Escape:
     582            case Qt::Key_Escape:
    563583            {
    564584                reject();
     
    575595{
    576596    QPushButton *defButton = 0;
    577     QObjectList *list = queryList ("QPushButton");
    578     QObjectListIt it (*list);
    579     while ( (defButton = (QPushButton*)it.current()) && !defButton->isDefault() )
    580     {
    581         ++it;
     597    QObjectList list = queryList ("QPushButton");
     598    QListIterator<QObject*> it (list);
     599    foreach(QObject *o, list)
     600    {
     601        defButton = qobject_cast<QPushButton*> (o);
     602        if(defButton->isDefault())
     603            break;
    582604    }
    583605    return defButton;
     
    597619    show();
    598620    mInLoop = true;
    599     qApp->eventLoop()->enterLoop();
     621#warning port me
     622//    qApp->eventLoop()->enterLoop();
    600623    mInLoop = false;
    601624
     
    610633    {
    611634        hide();
    612         qApp->eventLoop()->exitLoop();
     635#warning port me
     636//        qApp->eventLoop()->exitLoop();
    613637    }
    614638    else
     
    619643
    620644
    621 QListView* VBoxDiskImageManagerDlg::getCurrentListView()
    622 {
    623     QListView *clv = static_cast<QListView*>(twImages->currentPage()->
    624         queryList("QListView")->getFirst());
     645Q3ListView* VBoxDiskImageManagerDlg::getCurrentListView()
     646{
     647    Q3ListView *clv = static_cast<Q3ListView*>(twImages->currentPage()->
     648        queryList("QListView").first());
    625649    Assert(clv);
    626650    return clv;
    627651}
    628652
    629 QListView* VBoxDiskImageManagerDlg::getListView (VBoxDefs::DiskType aType)
     653Q3ListView* VBoxDiskImageManagerDlg::getListView (VBoxDefs::DiskType aType)
    630654{
    631655    switch (aType)
     
    645669bool VBoxDiskImageManagerDlg::eventFilter (QObject *aObject, QEvent *aEvent)
    646670{
    647     QListView *currentList = getCurrentListView();
     671    Q3ListView *currentList = getCurrentListView();
    648672
    649673    switch (aEvent->type())
     
    667691                    static_cast<QDropEvent*>(aEvent);
    668692                QStringList *droppedList = new QStringList();
    669                 QUriDrag::decodeLocalFiles (dropEvent, *droppedList);
     693                Q3UriDrag::decodeLocalFiles (dropEvent, *droppedList);
    670694                QCustomEvent *updateEvent = new QCustomEvent (1001);
    671695                updateEvent->setData (droppedList);
     
    710734            break;
    711735    }
    712     return QMainWindow::eventFilter (aObject, aEvent);
     736    return Q3MainWindow::eventFilter (aObject, aEvent);
    713737}
    714738
     
    716740bool VBoxDiskImageManagerDlg::event (QEvent *aEvent)
    717741{
    718     bool result = QMainWindow::event (aEvent);
     742    bool result = Q3MainWindow::event (aEvent);
    719743    switch (aEvent->type())
    720744    {
     
    733757void VBoxDiskImageManagerDlg::addDroppedImages (QStringList *aDroppedList)
    734758{
    735     QListView *currentList = getCurrentListView();
     759    Q3ListView *currentList = getCurrentListView();
    736760
    737761    for (QStringList::Iterator it = (*aDroppedList).begin();
     
    837861
    838862
    839 DiskImageItem* VBoxDiskImageManagerDlg::createImageNode (QListView *aList,
     863DiskImageItem* VBoxDiskImageManagerDlg::createImageNode (Q3ListView *aList,
    840864                                                         DiskImageItem *aRoot,
    841865                                                         const VBoxMedia &aMedia)
     
    856880
    857881
    858 void VBoxDiskImageManagerDlg::invokePopup (QListViewItem *aItem, const QPoint & aPos, int)
     882void VBoxDiskImageManagerDlg::invokePopup (Q3ListViewItem *aItem, const QPoint & aPos, int)
    859883{
    860884    if (aItem)
     
    879903         ++it)
    880904    {
    881         if (usage)
     905        if (!usage.isEmpty())
    882906            usage += ", ";
    883907        CMachine machine = vbox.GetMachine (QUuid (*it));
     
    895919        if (!permMachines.contains (*it))
    896920        {
    897             if (usage)
     921            if (!usage.isEmpty())
    898922                usage += ", [";
    899923            else
     
    926950         ++it)
    927951    {
    928         if (usage)
     952        if (!usage.isEmpty())
    929953            usage += ", ";
    930954        CMachine machine = vbox.GetMachine (QUuid (*it));
     
    942966        if (!permMachines.contains (*it))
    943967        {
    944             if (usage)
     968            if (!usage.isEmpty())
    945969                usage += ", [";
    946970            else
     
    968992        aSnapshot.GetMachine().GetDVDDrive().GetImage().GetId() == aImageId)
    969993    {
    970         if (aUsage)
     994        if (!aUsage.isEmpty())
    971995            aUsage += ", ";
    972996        aUsage += aSnapshot.GetName();
     
    9881012        aSnapshot.GetMachine().GetFloppyDrive().GetImage().GetId() == aImageId)
    9891013    {
    990         if (aUsage)
     1014        if (!aUsage.isEmpty())
    9911015            aUsage += ", ";
    9921016        aUsage += aSnapshot.GetName();
     
    13281352
    13291353
    1330 DiskImageItem* VBoxDiskImageManagerDlg::createHdItem (QListView *aList,
     1354DiskImageItem* VBoxDiskImageManagerDlg::createHdItem (Q3ListView *aList,
    13311355                                                      const VBoxMedia &aMedia)
    13321356{
     
    13391363}
    13401364
    1341 DiskImageItem* VBoxDiskImageManagerDlg::createCdItem (QListView *aList,
     1365DiskImageItem* VBoxDiskImageManagerDlg::createCdItem (Q3ListView *aList,
    13421366                                                      const VBoxMedia &aMedia)
    13431367{
     
    13471371}
    13481372
    1349 DiskImageItem* VBoxDiskImageManagerDlg::createFdItem (QListView *aList,
     1373DiskImageItem* VBoxDiskImageManagerDlg::createFdItem (Q3ListView *aList,
    13501374                                                      const VBoxMedia &aMedia)
    13511375{
     
    13661390    {
    13671391        aItem->setPixmap (0, pm);
    1368         QIconSet iconSet (pm);
     1392        QIcon iconSet (pm);
    13691393        QWidget *wt = aType == VBoxDefs::HD ? twImages->page (0) :
    13701394                      aType == VBoxDefs::CD ? twImages->page (1) :
     
    13771401
    13781402
    1379 DiskImageItem* VBoxDiskImageManagerDlg::searchItem (QListView *aList,
     1403DiskImageItem* VBoxDiskImageManagerDlg::searchItem (Q3ListView *aList,
    13801404                                                    const QUuid &aId)
    13811405{
     
    13921416
    13931417
    1394 DiskImageItem* VBoxDiskImageManagerDlg::searchItem (QListView *aList,
     1418DiskImageItem* VBoxDiskImageManagerDlg::searchItem (Q3ListView *aList,
    13951419                                                    VBoxMedia::Status aStatus)
    13961420{
     
    16431667                                            const QUuid &aId)
    16441668{
    1645     QListView *listView = getListView (aType);
     1669    Q3ListView *listView = getListView (aType);
    16461670    DiskImageItem *item = searchItem (listView, aId);
    16471671    delete item;
     
    16541678                      aType == VBoxDefs::CD ? twImages->page (1) :
    16551679                      aType == VBoxDefs::FD ? twImages->page (2) : 0;
    1656         const QIconSet &set = aType == VBoxDefs::HD ? pxHD :
     1680        const QIcon &set = aType == VBoxDefs::HD ? pxHD :
    16571681                              aType == VBoxDefs::CD ? pxCD :
    1658                               aType == VBoxDefs::FD ? pxFD : QIconSet();
     1682                              aType == VBoxDefs::FD ? pxFD : QIcon();
    16591683        Assert (wt && !set.isNull()); /* atype should be the correct one */
    16601684        twImages->changeTab (wt, set, twImages->tabLabel (wt));
     
    17101734
    17111735    imRefreshAction->setEnabled (false);
    1712     setCursor (QCursor (BusyCursor));
     1736    setCursor (QCursor (Qt::BusyCursor));
    17131737
    17141738    /* store the current list selections */
    17151739
    1716     QListViewItem *item;
     1740    Q3ListViewItem *item;
    17171741    DiskImageItem *di;
    17181742
     
    17541778    if (itemId.isNull()) return false;
    17551779
    1756     QListView* parentList = aItem->listView();
     1780    Q3ListView* parentList = aItem->listView();
    17571781    if (parentList == hdsView)
    17581782    {
     
    18081832
    18091833
    1810 void VBoxDiskImageManagerDlg::setCurrentItem (QListView *aListView,
    1811                                               QListViewItem *aItem)
     1834void VBoxDiskImageManagerDlg::setCurrentItem (Q3ListView *aListView,
     1835                                              Q3ListViewItem *aItem)
    18121836{
    18131837    if (!aItem)
     
    18211845void VBoxDiskImageManagerDlg::processCurrentChanged()
    18221846{
    1823     QListView *currentList = getCurrentListView();
     1847    Q3ListView *currentList = getCurrentListView();
    18241848    currentList->setFocus();
    18251849
     
    18461870}
    18471871
    1848 void VBoxDiskImageManagerDlg::processCurrentChanged (QListViewItem *aItem)
     1872void VBoxDiskImageManagerDlg::processCurrentChanged (Q3ListViewItem *aItem)
    18491873{
    18501874    DiskImageItem *item = aItem && aItem->rtti() == DiskImageItem::TypeId ?
     
    19101934
    19111935
    1912 void VBoxDiskImageManagerDlg::processPressed (QListViewItem * aItem)
     1936void VBoxDiskImageManagerDlg::processPressed (Q3ListViewItem * aItem)
    19131937{
    19141938    if (!aItem)
    19151939    {
    1916         QListView *currentList = getCurrentListView();
     1940        Q3ListView *currentList = getCurrentListView();
    19171941        currentList->setSelected (currentList->currentItem(), true);
    19181942    }
     
    19401964void VBoxDiskImageManagerDlg::addImage()
    19411965{
    1942     QListView *currentList = getCurrentListView();
     1966    Q3ListView *currentList = getCurrentListView();
    19431967    DiskImageItem *item =
    19441968        currentList->currentItem() &&
     
    19501974        dir = QFileInfo (item->getPath().stripWhiteSpace()).dirPath (true);
    19511975
    1952     if (!dir)
     1976    if (dir.isEmpty())
    19531977        if (currentList == hdsView)
    19541978            dir = vbox.GetSystemProperties().GetDefaultVDIFolder();
    19551979
    1956     if (!dir || !QFileInfo (dir).exists())
     1980    if (dir.isEmpty() || !QFileInfo (dir).exists())
    19571981        dir = vbox.GetHomeFolder();
    19581982
     
    20012025void VBoxDiskImageManagerDlg::removeImage()
    20022026{
    2003     QListView *currentList = getCurrentListView();
     2027    Q3ListView *currentList = getCurrentListView();
    20042028    DiskImageItem *item =
    20052029        currentList->currentItem() &&
     
    20782102void VBoxDiskImageManagerDlg::releaseImage()
    20792103{
    2080     QListView *currentList = getCurrentListView();
     2104    Q3ListView *currentList = getCurrentListView();
    20812105    DiskImageItem *item =
    20822106        currentList->currentItem() &&
     
    22172241QUuid VBoxDiskImageManagerDlg::getSelectedUuid()
    22182242{
    2219     QListView *currentList = getCurrentListView();
     2243    Q3ListView *currentList = getCurrentListView();
    22202244    QUuid uuid;
    22212245
     
    22312255QString VBoxDiskImageManagerDlg::getSelectedPath()
    22322256{
    2233     QListView *currentList = getCurrentListView();
     2257    Q3ListView *currentList = getCurrentListView();
    22342258    QString path;
    22352259
     
    22432267
    22442268
    2245 void VBoxDiskImageManagerDlg::processDoubleClick (QListViewItem*)
    2246 {
    2247     QListView *currentList = getCurrentListView();
     2269void VBoxDiskImageManagerDlg::processDoubleClick (Q3ListViewItem*)
     2270{
     2271    Q3ListView *currentList = getCurrentListView();
    22482272
    22492273    if (doSelect && currentList->selectedItem() && buttonOk->isEnabled())
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGlobalSettingsDlg.ui

    r5999 r7220  
    12941294    <include location="global" impldecl="in implementation">qobjectlist.h</include>
    12951295    <include location="global" impldecl="in implementation">qfiledialog.h</include>
    1296     <include location="global" impldecl="in implementation">qfocusdata.h</include>
    12971296    <include location="global" impldecl="in implementation">qtimer.h</include>
    12981297    <include location="global" impldecl="in implementation">qeventloop.h</include>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGlobalSettingsDlg.ui.h

    r7207 r7220  
    2929#include <iprt/param.h>
    3030#include <iprt/path.h>
     31//Added by qt3to4:
     32#include <QTranslator>
     33#include <QLabel>
     34#include <q3mimefactory.h>
     35#include <QEvent>
     36#include <QShowEvent>
     37#include <Q3WhatsThis>
    3138
    3239/* defined in VBoxGlobal.cpp */
     
    4148 *  using the text of the first column of every item.
    4249 */
    43 static QString path (QListViewItem *li)
     50static QString path (Q3ListViewItem *li)
    4451{
    4552    static QString sep = ": ";
    4653    QString p;
    47     QListViewItem *cur = li;
     54    Q3ListViewItem *cur = li;
    4855    while (cur)
    4956    {
     
    6673
    6774
    68 class USBListItem : public QCheckListItem
     75class USBListItem : public Q3CheckListItem
    6976{
    7077public:
    7178
    72     USBListItem (QListView *aParent, QListViewItem *aAfter)
    73         : QCheckListItem (aParent, aAfter, QString::null, CheckBox)
     79    USBListItem (Q3ListView *aParent, Q3ListViewItem *aAfter)
     80        : Q3CheckListItem (aParent, aAfter, QString::null, CheckBox)
    7481        , mId (-1) {}
    7582
     
    7986
    8087
    81 class LanguageItem : public QListViewItem
     88class LanguageItem : public Q3ListViewItem
    8289{
    8390public:
     
    8592    enum { TypeId = 1001 };
    8693
    87     LanguageItem (QListView *aParent, const QTranslator &aTranslator,
     94    LanguageItem (Q3ListView *aParent, const QTranslator &aTranslator,
    8895                  const QString &aId, bool aBuiltIn = false)
    89         : QListViewItem (aParent), mBuiltIn (aBuiltIn), mInvalid (false)
     96        : Q3ListViewItem (aParent), mBuiltIn (aBuiltIn), mInvalid (false)
    9097    {
    9198        Assert (!aId.isEmpty());
    9299
    93         QTranslatorMessage transMes;
     100//        QTranslatorMessage transMes;
    94101
    95102        /* Note: context/source/comment arguments below must match strings
     
    141148    /* Constructs an item for an invalid language ID (i.e. when a language
    142149     * file is missing or corrupt). */
    143     LanguageItem (QListView *aParent, const QString &aId)
    144         : QListViewItem (aParent), mBuiltIn (false), mInvalid (true)
     150    LanguageItem (Q3ListView *aParent, const QString &aId)
     151        : Q3ListViewItem (aParent), mBuiltIn (false), mInvalid (true)
    145152    {
    146153        Assert (!aId.isEmpty());
     
    154161    /* Constructs an item for the default language ID (column 1 will be set
    155162     * to QString::null) */
    156     LanguageItem (QListView *aParent)
    157         : QListViewItem (aParent), mBuiltIn (false), mInvalid (false)
     163    LanguageItem (Q3ListView *aParent)
     164        : Q3ListViewItem (aParent), mBuiltIn (false), mInvalid (false)
    158165    {
    159166        setText (0, VBoxGlobalSettingsDlg::tr ("Default", "Language"));
     
    167174    int rtti() const { return TypeId; }
    168175
    169     int compare (QListViewItem *aItem, int aColumn, bool aAscending) const
     176    int compare (Q3ListViewItem *aItem, int aColumn, bool aAscending) const
    170177    {
    171178        QString thisId = text (1);
     
    179186        if (aItem->rtti() == TypeId && ((LanguageItem *) aItem)->mBuiltIn)
    180187            return 1;
    181         return QListViewItem::compare (aItem, aColumn, aAscending);
     188        return Q3ListViewItem::compare (aItem, aColumn, aAscending);
    182189    }
    183190
     
    196203            aPainter->setFont (font);
    197204
    198         QListViewItem::paintCell (aPainter, aGroup, aColumn, aWidth, aAlign);
     205        Q3ListViewItem::paintCell (aPainter, aGroup, aColumn, aWidth, aAlign);
    199206
    200207        if (mBuiltIn)
     
    206213    }
    207214
    208     int width (const QFontMetrics &aFM, const QListView *aLV, int aC) const
     215    int width (const QFontMetrics &aFM, const Q3ListView *aLV, int aC) const
    209216    {
    210217        QFont font = aLV->font();
     
    220227            fm = QFontMetrics (font);
    221228
    222         return QListViewItem::width (fm, aLV, aC);
     229        return Q3ListViewItem::width (fm, aLV, aC);
    223230    }
    224231
    225232    void setup ()
    226233    {
    227         QListViewItem::setup();
     234        Q3ListViewItem::setup();
    228235        if (mBuiltIn)
    229236            setHeight (height() + 1);
     
    235242                       const char *aSrc, const char *aCmnt)
    236243    {
    237         QString msg = aTranslator.findMessage (aCtxt, aSrc, aCmnt).translation();
     244#warning port me: check this
     245        QString msg = aTranslator.translate (aCtxt, aSrc, aCmnt);
     246//        QString msg = aTranslator.findMessage (aCtxt, aSrc, aCmnt).translation();
    238247        /* return the source text if no translation is found */
    239248        if (msg.isEmpty())
     
    251260    polished = false;
    252261
    253     setIcon (QPixmap::fromMimeSource ("global_settings_16px.png"));
     262    setIcon (qPixmapFromMimeSource ("global_settings_16px.png"));
    254263
    255264    /*  all pages are initially valid */
    256265    valid = true;
    257266    buttonOk->setEnabled (true);
    258     warningSpacer->changeSize (0, 0, QSizePolicy::Expanding);
     267#warning port me
     268//    warningSpacer->changeSize (0, 0, QSizePolicy::Expanding);
    259269    warningLabel->setHidden (true);
    260270    warningPixmap->setHidden (true);
     
    264274    /*  hide the header and internal columns */
    265275    listView->header()->hide();
    266     listView->setColumnWidthMode (listView_Id, QListView::Manual);
    267     listView->setColumnWidthMode (listView_Link, QListView::Manual);
     276    listView->setColumnWidthMode (listView_Id, Q3ListView::Manual);
     277    listView->setColumnWidthMode (listView_Link, Q3ListView::Manual);
    268278    listView->hideColumn (listView_Id);
    269279    listView->hideColumn (listView_Link);
     
    289299
    290300    whatsThisLabel = new QIRichLabel (this, "whatsThisLabel");
    291     VBoxGlobalSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1);
     301#warning port me
     302//    VBoxGlobalSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1);
    292303
    293304#ifndef DEBUG
     
    303314
    304315    whatsThisLabel->setMaxHeightMode (true);
    305     whatsThisLabel->setFocusPolicy (QWidget::NoFocus);
     316    whatsThisLabel->setFocusPolicy (Qt::NoFocus);
    306317    whatsThisLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
    307     whatsThisLabel->setBackgroundMode (QLabel::PaletteMidlight);
     318    whatsThisLabel->setBackgroundMode (Qt::PaletteMidlight);
    308319    whatsThisLabel->setFrameShape (QLabel::Box);
    309320    whatsThisLabel->setFrameShadow (QLabel::Sunken);
    310321    whatsThisLabel->setMargin (7);
    311322    whatsThisLabel->setScaledContents (FALSE);
    312     whatsThisLabel->setAlignment (int (QLabel::WordBreak |
    313                                        QLabel::AlignJustify |
    314                                        QLabel::AlignTop));
     323    whatsThisLabel->setAlignment (int (Qt::TextWordWrap |
     324                                       Qt::AlignJustify |
     325                                       Qt::AlignTop));
    315326
    316327    whatsThisLabel->setFixedHeight (whatsThisLabel->frameWidth() * 2 +
     
    328339    hkeHostKey = new QIHotKeyEdit (grbKeyboard, "hkeHostKey");
    329340    hkeHostKey->setSizePolicy (QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Fixed));
    330     QWhatsThis::add (hkeHostKey,
     341    Q3WhatsThis::add (hkeHostKey,
    331342        tr ("Displays the key used as a Host Key in the VM window. Activate the "
    332343            "entry field and press a new Host Key. Note that alphanumeric, "
    333344            "cursor movement and editing keys cannot be used as a Host Key."));
    334     layoutHostKey->addWidget (hkeHostKey);
     345#warning port me
     346//    layoutHostKey->addWidget (hkeHostKey);
    335347    txHostKey->setBuddy (hkeHostKey);
    336348    setTabOrder (listView, hkeHostKey);
     
    360372    /* disable unselecting items by clicking in the unused area of the list */
    361373    new QIListViewSelectionPreserver (this, lvUSBFilters);
    362     wstUSBFilters = new QWidgetStack (grbUSBFilters, "wstUSBFilters");
    363     grbUSBFiltersLayout->addWidget (wstUSBFilters);
     374    wstUSBFilters = new Q3WidgetStack (grbUSBFilters, "wstUSBFilters");
     375#warning port me
     376//    grbUSBFiltersLayout->addWidget (wstUSBFilters);
    364377    /* create a default (disabled) filter settings widget at index 0 */
    365378    VBoxUSBFilterSettings *settings = new VBoxUSBFilterSettings (wstUSBFilters);
     
    441454QString VBoxGlobalSettingsDlg::pagePath (QWidget *aPage)
    442455{
    443     QListViewItem *li = listView->
     456    Q3ListViewItem *li = listView->
    444457        findItem (QString::number (widgetStack->id (aPage)), 1);
    445458    return ::path (li);
     
    527540}
    528541
    529 void VBoxGlobalSettingsDlg::listView_currentChanged (QListViewItem *item)
     542void VBoxGlobalSettingsDlg::listView_currentChanged (Q3ListViewItem *item)
    530543{
    531544    Assert (item);
     
    549562    bool newValid = true;
    550563    {
    551         QObjectList *l = this->queryList ("QIWidgetValidator");
    552         QObjectListIt it (*l);
    553         QObject *obj;
    554         while ((obj = it.current()) != 0)
     564        QObjectList l = this->queryList ("QIWidgetValidator");
     565        foreach (QObject *obj, l)
    555566        {
    556567            QIWidgetValidator *wval = (QIWidgetValidator *) obj;
     
    561572                break;
    562573            }
    563             ++ it;
    564574        }
    565         delete l;
    566575    }
    567576
     
    637646         * not available (i.e. in VirtualBox OSE) */
    638647
    639         QListViewItem *usbItem = listView->findItem ("#usb", listView_Link);
     648        Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link);
    640649        Assert (usbItem);
    641650        usbItem->setVisible (false);
     
    663672
    664673    QString langId = gs.languageId();
    665     QListViewItem *item = lvLanguages->findItem (langId, 1);
     674    Q3ListViewItem *item = lvLanguages->findItem (langId, 1);
    666675    if (!item)
    667676    {
     
    719728
    720729    /* then add all new filters */
    721     for (QListViewItem *item = lvUSBFilters->firstChild(); item;
     730    for (Q3ListViewItem *item = lvUSBFilters->firstChild(); item;
    722731         item = item->nextSibling())
    723732    {
     
    744753    /* language properties */
    745754
    746     QListViewItem *selItem = lvLanguages->selectedItem();
     755    Q3ListViewItem *selItem = lvLanguages->selectedItem();
    747756    Assert (selItem);
    748757    if (mLanguageChanged && selItem)
     
    765774    else
    766775    {
    767         widget = focusData()->focusWidget();
     776#warning port me
     777//        widget = focusData()->focusWidget();
    768778    }
    769779    /* if the given widget lacks the whats'this text, look at its parent */
    770780    while (widget && widget != this)
    771781    {
    772         text = QWhatsThis::textFor (widget);
     782#warning port me
     783//        text = Q3WhatsThis::textFor (widget);
    773784        if (!text.isEmpty())
    774785            break;
     
    778789    if (text.isEmpty() && !warningString.isEmpty())
    779790        text = warningString;
    780     if (text.isEmpty())
    781         text = QWhatsThis::textFor (this);
     791#warning port me
     792//    if (text.isEmpty())
     793//        text = Q3WhatsThis::textFor (this);
    782794
    783795    whatsThisLabel->setText (text);
     
    798810void VBoxGlobalSettingsDlg::tbResetFolder_clicked()
    799811{
    800     QToolButton *tb = ::qt_cast <QToolButton *> (sender());
     812    QToolButton *tb = qobject_cast <QToolButton *> (sender());
    801813    Assert (tb);
    802814
     
    817829void VBoxGlobalSettingsDlg::tbSelectFolder_clicked()
    818830{
    819     QToolButton *tb = ::qt_cast <QToolButton *> (sender());
     831    QToolButton *tb = qobject_cast <QToolButton *> (sender());
    820832    Assert (tb);
    821833
     
    855867                                          bool aIsNew)
    856868{
    857     QListViewItem *currentItem = aIsNew
     869    Q3ListViewItem *currentItem = aIsNew
    858870        ? lvUSBFilters->currentItem()
    859871        : lvUSBFilters->lastItem();
     
    894906}
    895907
    896 void VBoxGlobalSettingsDlg::lvUSBFilters_currentChanged (QListViewItem *item)
     908void VBoxGlobalSettingsDlg::lvUSBFilters_currentChanged (Q3ListViewItem *item)
    897909{
    898910    if (item && lvUSBFilters->selectedItem() != item)
     
    918930void VBoxGlobalSettingsDlg::lvUSBFilters_setCurrentText (const QString &aText)
    919931{
    920     QListViewItem *item = lvUSBFilters->currentItem();
     932    Q3ListViewItem *item = lvUSBFilters->currentItem();
    921933    Assert (item);
    922934
     
    930942    QString usbFilterName = tr ("New Filter %1", "usb");
    931943    QRegExp regExp (QString ("^") + usbFilterName.arg ("([0-9]+)") + QString ("$"));
    932     QListViewItemIterator iterator (lvUSBFilters);
     944    Q3ListViewItemIterator iterator (lvUSBFilters);
    933945    while (*iterator)
    934946    {
     
    9971009void VBoxGlobalSettingsDlg::tbRemoveUSBFilter_clicked()
    9981010{
    999     QListViewItem *item = lvUSBFilters->currentItem();
     1011    Q3ListViewItem *item = lvUSBFilters->currentItem();
    10001012    Assert (item);
    10011013
     
    10141026void VBoxGlobalSettingsDlg::tbUSBFilterUp_clicked()
    10151027{
    1016     QListViewItem *item = lvUSBFilters->currentItem();
     1028    Q3ListViewItem *item = lvUSBFilters->currentItem();
    10171029    Assert (item);
    10181030
    1019     QListViewItem *itemAbove = item->itemAbove();
     1031    Q3ListViewItem *itemAbove = item->itemAbove();
    10201032    Assert (itemAbove);
    10211033    itemAbove = itemAbove->itemAbove();
     
    10321044void VBoxGlobalSettingsDlg::tbUSBFilterDown_clicked()
    10331045{
    1034     QListViewItem *item = lvUSBFilters->currentItem();
     1046    Q3ListViewItem *item = lvUSBFilters->currentItem();
    10351047    Assert (item);
    10361048
    1037     QListViewItem *itemBelow = item->itemBelow();
     1049    Q3ListViewItem *itemBelow = item->itemBelow();
    10381050    Assert (itemBelow);
    10391051
     
    10441056}
    10451057
    1046 void VBoxGlobalSettingsDlg::lvLanguages_currentChanged (QListViewItem *aItem)
     1058void VBoxGlobalSettingsDlg::lvLanguages_currentChanged (Q3ListViewItem *aItem)
    10471059{
    10481060    Assert (aItem);
     
    10731085         * not available (i.e. in VirtualBox OSE) */
    10741086
    1075         QListViewItem *usbItem = listView->findItem ("#usb", listView_Link);
     1087        Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link);
    10761088        Assert (usbItem);
    10771089        usbItem->setVisible (false);
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxNewHDWzd.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <QShowEvent>
     3#include <QPushButton>
    14/**
    25 *
     
    197200    leName->setValidator (new QRegExpValidator (QRegExp( ".+" ), this));
    198201
    199     leSize->setValidator (new QRegExpValidator (vboxGlobal().sizeRegexp(), this));
     202    leSize->setValidator (new QRegExpValidator (QRegExp(vboxGlobal().sizeRegexp()), this));
    200203    leSize->setAlignment (Qt::AlignRight);
    201204
     
    214217    teSummary = new QITextEdit (pageSummary);
    215218    teSummary->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
    216     teSummary->setFrameShape (QTextEdit::NoFrame);
     219    teSummary->setFrameShape (Q3TextEdit::NoFrame);
    217220    teSummary->setReadOnly (TRUE);
    218     summaryLayout->insertWidget (1, teSummary);
     221#warning port me
     222//    summaryLayout->insertWidget (1, teSummary);
    219223
    220224    /* filter out Enter keys in order to direct them to the default dlg button */
    221     QIKeyFilter *ef = new QIKeyFilter (this, Key_Enter);
     225    QIKeyFilter *ef = new QIKeyFilter (this, Qt::Key_Enter);
    222226    ef->watchOn (teSummary);
    223227
     
    232236    leName->setText (QString ("NewHardDisk%1.vdi").arg (++ HDNumber));
    233237
    234     slSize->setFocusPolicy (QWidget::StrongFocus);
     238    slSize->setFocusPolicy (Qt::StrongFocus);
    235239    slSize->setPageStep (sliderScale);
    236240    slSize->setLineStep (sliderScale / 8);
     
    261265
    262266    /* setup minimum width for the sizeHint to be calculated correctly */
    263     int wid = widthSpacer->minimumSize().width();
     267#warning port me
     268    int wid = 1;
     269//    int wid = widthSpacer->minimumSize().width();
    264270    txWelcome->setMinimumWidth (wid);
    265271    textLabel1_2->setMinimumWidth (wid);
     
    413419    }
    414420
    415     QWizard::showPage (page);
     421    Q3Wizard::showPage (page);
    416422
    417423    /* fix focus on the last page. when we go to the last page
     
    446452     */
    447453    if (createHardDisk())
    448         QWizard::accept();
     454        Q3Wizard::accept();
    449455}
    450456
     
    566572//    fd.setDir (d);
    567573
    568     QString selected = QFileDialog::getSaveFileName (
     574    QString selected = Q3FileDialog::getSaveFileName (
    569575        fld.absFilePath(),
    570576        tr ("Hard disk images (*.vdi)"),
     
    575581//    if ( fd.exec() == QDialog::Accepted ) {
    576582//        leName->setText (QDir::convertSeparators (fd.selectedFile()));
    577     if (selected)
     583    if (!selected.isEmpty())
    578584    {
    579585        if (QFileInfo (selected).extension().isEmpty())
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxNewVMWzd.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <QShowEvent>
    13/**
    24 *
     
    100102    /* HDD Images page */
    101103    mediaCombo = new VBoxMediaComboBox (grbHDA, "mediaCombo", VBoxDefs::HD, true);
    102     grbHDALayout->addMultiCellWidget (mediaCombo, 0, 0, 0, 2);
     104#warning port me: check this
     105    gridLayout->addMultiCellWidget (mediaCombo, 0, 0, 0, 2);
     106//    grbHDALayout->addMultiCellWidget (mediaCombo, 0, 0, 0, 2);
    103107    setTabOrder (mediaCombo, pbNewHD);
    104108    setTabOrder (pbNewHD, pbExistingHD);
     
    121125    teSummary = new QITextEdit (pageSummary);
    122126    teSummary->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
    123     teSummary->setFrameShape (QTextEdit::NoFrame);
     127    teSummary->setFrameShape (Q3TextEdit::NoFrame);
    124128    teSummary->setReadOnly (TRUE);
    125     summaryLayout->insertWidget (1, teSummary);
     129#warning port me: check this
     130    hboxLayout12->insertWidget (1, teSummary);
     131//    summaryLayout->insertWidget (1, teSummary);
    126132
    127133    /* filter out Enter keys in order to direct them to the default dlg button */
    128     QIKeyFilter *ef = new QIKeyFilter (this, Key_Enter);
     134    QIKeyFilter *ef = new QIKeyFilter (this, Qt::Key_Enter);
    129135    ef->watchOn (teSummary);
    130136
     
    178184
    179185    /* setup minimum width for the sizeHint to be calculated correctly */
    180     int wid = widthSpacer->minimumSize().width();
     186#warning port me: check this
     187    int wid = spacerItem->minimumSize().width();
     188//    int wid = widthSpacer->minimumSize().width();
    181189    txWelcome->setMinimumWidth (wid);
    182190    txNameAndOS->setMinimumWidth (wid);
     
    270278    }
    271279
    272     QWizard::showPage (page);
     280    Q3Wizard::showPage (page);
    273281
    274282    /*
     
    300308     */
    301309    if (constructMachine())
    302         QWizard::accept();
     310        Q3Wizard::accept();
    303311}
    304312
     
    423431void VBoxNewVMWzd::showVDIManager()
    424432{
    425     VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg", WType_Dialog | WShowModal);
     433    VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg", Qt::WType_Dialog | Qt::WShowModal);
    426434    dlg.setup (VBoxDefs::HD, true);
    427435    QUuid newId = dlg.exec() == VBoxDiskImageManagerDlg::Accepted ?
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxRegistrationDlg.ui.h

    r6349 r7220  
    3333#include <iprt/param.h>
    3434#include <iprt/path.h>
     35//Added by qt3to4:
     36#include <QShowEvent>
    3537
    3638/**
     
    218220
    219221    /* Adjust text label size */
    220     mTextLabel->setMinimumWidth (widthSpacer->minimumSize().width());
     222#warning port me
     223//    mTextLabel->setMinimumWidth (widthSpacer->minimumSize().width());
    221224
    222225    /* Setup validations and maximum text-edit text length */
     
    321324    /* Handshake arguments initializing */
    322325    QString version = vboxGlobal().virtualBox().GetVersion();
    323     QUrl::encode (version);
     326    Q3Url::encode (version);
    324327
    325328    /* Handshake */
     
    375378        QString email = mEmailEdit->text();
    376379        QString prvt = mUseCheckBox->isChecked() ? "1" : "0";
    377         QUrl::encode (version);
    378         QUrl::encode (platform);
    379         QUrl::encode (name);
    380         QUrl::encode (email);
     380        Q3Url::encode (version);
     381        Q3Url::encode (platform);
     382        Q3Url::encode (name);
     383        Q3Url::encode (email);
    381384
    382385        /* Registration */
     
    531534    rc = RTPathAppPrivateNoArch (szAppPrivPath, sizeof (szAppPrivPath));
    532535    Assert (RT_SUCCESS (rc));
    533     QProcess infoScript (QString ("./VBoxSysInfo.sh"), this, "infoScript");
     536    Q3Process infoScript (QString ("./VBoxSysInfo.sh"), this, "infoScript");
    534537    infoScript.setWorkingDirectory (QString (szAppPrivPath));
    535538    if (infoScript.start())
     
    537540        while (infoScript.isRunning()) {}
    538541        if (infoScript.normalExit())
    539             platform += QString (" [%1]").arg (infoScript.readStdout());
     542            platform += QString (" [%1]").arg (QString(infoScript.readStdout()));
    540543    }
    541544#endif
     
    565568{
    566569    validate();
    567     QWizard::showEvent (aEvent);
    568 }
     570    Q3Wizard::showEvent (aEvent);
     571}
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxSharedFoldersSettings.ui.h

    r6942 r7220  
     1//Added by qt3to4:
     2#include <Q3WhatsThis>
     3#include <QPushButton>
     4#include <Q3HBoxLayout>
     5#include <Q3ValueList>
     6#include <QLabel>
     7#include <Q3GridLayout>
     8#include <QMouseEvent>
     9#include <QEvent>
     10#include <Q3VBoxLayout>
     11#include <QShowEvent>
    112/**
    213 *
     
    3142
    3243typedef QPair<QString, VBoxSharedFoldersSettings::SFDialogType> SFolderName;
    33 typedef QValueList<SFolderName> SFoldersNameList;
    34 
    35 
    36 class VBoxRichListItem : public QListViewItem
     44typedef Q3ValueList<SFolderName> SFoldersNameList;
     45
     46
     47class VBoxRichListItem : public Q3ListViewItem
    3748{
    3849public:
     
    4960    };
    5061
    51     VBoxRichListItem (FormatType aFormat, QListView *aParent,
     62    VBoxRichListItem (FormatType aFormat, Q3ListView *aParent,
    5263                      const QString& aName, const QString& aNull1,
    5364                      const QString& aNull2, const QString& aKey) :
    54         QListViewItem (aParent, aName, aNull1, aNull2, aKey), mFormat (aFormat)
    55     {
    56     }
    57 
    58     VBoxRichListItem (FormatType aFormat, QListViewItem *aParent,
     65        Q3ListViewItem (aParent, aName, aNull1, aNull2, aKey), mFormat (aFormat)
     66    {
     67    }
     68
     69    VBoxRichListItem (FormatType aFormat, Q3ListViewItem *aParent,
    5970                      const QString& aName, const QString& aPath,
    6071                      const QString& aAccess, const QString& aEdited) :
    61         QListViewItem (aParent, aName, aPath, aAccess, aEdited), mFormat (aFormat)
     72        Q3ListViewItem (aParent, aName, aPath, aAccess, aEdited), mFormat (aFormat)
    6273    {
    6374        mTextList << aName << aPath << aAccess << aEdited;
     
    6677    int rtti() const { return QIRichListItemId; }
    6778
    68     int compare (QListViewItem *aItem, int aColumn, bool aAscending) const
     79    int compare (Q3ListViewItem *aItem, int aColumn, bool aAscending) const
    6980    {
    7081        /* Sorting the children always by name: */
    7182        if (parent() && aItem->parent())
    72             return QListViewItem::compare (aItem, 0, aAscending);
     83            return Q3ListViewItem::compare (aItem, 0, aAscending);
    7384        /* Sorting the root items always by key: */
    7485        else if (!parent() && !aItem->parent())
    75             return QListViewItem::compare (aItem, 3, aAscending);
     86            return Q3ListViewItem::compare (aItem, 3, aAscending);
    7687        else
    77             return QListViewItem::compare (aItem, aColumn, aAscending);
     88            return Q3ListViewItem::compare (aItem, aColumn, aAscending);
    7889    }
    7990
    8091    VBoxRichListItem* nextSibling() const
    8192    {
    82         QListViewItem *item = QListViewItem::nextSibling();
     93        Q3ListViewItem *item = Q3ListViewItem::nextSibling();
    8394        return item && item->rtti() == QIRichListItemId ?
    8495            static_cast<VBoxRichListItem*> (item) : 0;
     
    118129                wnd.moveBy (dx, 0);
    119130                aPainter->setWindow (wnd);
    120                 QListViewItem::paintCell (aPainter, aColorGroup, 0, aWidth, aAlign);
     131                Q3ListViewItem::paintCell (aPainter, aColorGroup, 0, aWidth, aAlign);
    121132                aPainter->restore();
    122133                return;
    123134            }
    124135
    125             QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
     136            Q3ListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
    126137        }
    127138        else
    128139        {
    129140            processColumn (aColumn, aWidth);
    130             QListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
    131         }
    132     }
    133 
    134     int width (const QFontMetrics &aFontMetrics, const QListView *, int aColumn) const
     141            Q3ListViewItem::paintCell (aPainter, aColorGroup, aColumn, aWidth, aAlign);
     142        }
     143    }
     144
     145    int width (const QFontMetrics &aFontMetrics, const Q3ListView *, int aColumn) const
    135146    {
    136147        return parent() ?
     
    228239                AssertMsgFailed (("Incorrect SF Dialog type\n"));
    229240        }
    230         QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10, "mainLayout");
     241        Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 10, 10, "mainLayout");
    231242
    232243        /* Setup Input layout */
    233         QGridLayout *inputLayout = new QGridLayout (mainLayout, 3, 3, 10, "inputLayout");
     244        Q3GridLayout *inputLayout = new Q3GridLayout (mainLayout, 3, 3, 10, "inputLayout");
    234245        QLabel *lbPath = new QLabel (tr ("Folder Path"), this);
    235246        mLePath = new QLineEdit (this);
     
    239250        tbPath->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png",
    240251                                                 "select_file_dis_16px.png"));
    241         tbPath->setFocusPolicy (QWidget::TabFocus);
     252        tbPath->setFocusPolicy (Qt::TabFocus);
    242253        connect (mLePath, SIGNAL (textChanged (const QString &)),
    243254                 this, SLOT (validate()));
     
    245256                 this, SLOT (validate()));
    246257        connect (tbPath, SIGNAL (clicked()), this, SLOT (showFileDialog()));
    247         QWhatsThis::add (mLePath, tr ("Displays the path to an existing folder on the host PC."));
    248         QWhatsThis::add (mLeName, tr ("Displays the name of the shared folder "
     258        Q3WhatsThis::add (mLePath, tr ("Displays the path to an existing folder on the host PC."));
     259        Q3WhatsThis::add (mLeName, tr ("Displays the name of the shared folder "
    249260                                      "(as it will be seen by the guest OS)."));
    250         QWhatsThis::add (tbPath, tr ("Opens the dialog to select a folder."));
     261        Q3WhatsThis::add (tbPath, tr ("Opens the dialog to select a folder."));
    251262
    252263        inputLayout->addWidget (lbPath,  0, 0);
     
    257268
    258269        mCbReadonly = new QCheckBox (tr ("&Read-only"), this);
    259         QWhatsThis::add (mCbReadonly,
     270        Q3WhatsThis::add (mCbReadonly,
    260271            tr ("When checked, the guest OS will not be able to write to the "
    261272                "specified shared folder."));
     
    273284
    274285        /* Setup Button layout */
    275         QHBoxLayout *buttonLayout = new QHBoxLayout (mainLayout, 10, "buttonLayout");
     286        Q3HBoxLayout *buttonLayout = new Q3HBoxLayout (mainLayout, 10, "buttonLayout");
    276287        mBtOk = new QPushButton (tr ("&OK"), this, "btOk");
    277288        QSpacerItem *spacer = new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
     
    396407    connect (tbEdit, SIGNAL (clicked()), this, SLOT (tbEditPressed()));
    397408    connect (tbRemove, SIGNAL (clicked()), this, SLOT (tbRemovePressed()));
    398     connect (listView, SIGNAL (currentChanged (QListViewItem *)),
    399              this, SLOT (processCurrentChanged (QListViewItem *)));
     409    connect (listView, SIGNAL (currentChanged (Q3ListViewItem *)),
     410             this, SLOT (processCurrentChanged (Q3ListViewItem *)));
    400411
    401412    /* Make after-paining list update to ensure all columns repainted correctly. */
     
    454465    {
    455466        QMouseEvent *e = static_cast<QMouseEvent*> (aEvent);
    456         QListViewItem *i = listView->itemAt (e->pos());
     467        Q3ListViewItem *i = listView->itemAt (e->pos());
    457468        VBoxRichListItem *item = i && i->rtti() == VBoxRichListItem::QIRichListItemId ?
    458469            static_cast<VBoxRichListItem*> (i) : 0;
     
    468479            }
    469480
    470             QString curText = QToolTip::textFor (listView->viewport());
     481#warning port me
     482//            QString curText = QToolTip::textFor (listView->viewport());
     483            QString curText = "";
    471484            QString newText = item->text (id) != item->getText (id) ?
    472485                              item->getText (id) : QString::null;
     
    602615
    603616void VBoxSharedFoldersSettings::getFrom (const CSharedFolderEnumerator &aEn,
    604                                          QListViewItem *aRoot)
     617                                         Q3ListViewItem *aRoot)
    605618{
    606619    aRoot->setSelectable (false);
     
    644657    Assert (mDialogType & MachineType);
    645658    /* Searching for MachineType item's root */
    646     QListViewItem *root = listView->findItem (QString::number (MachineType), 3);
     659    Q3ListViewItem *root = listView->findItem (QString::number (MachineType), 3);
    647660    Assert (root);
    648661    CSharedFolderEnumerator en = mMachine.GetSharedFolders().Enumerate();
     
    658671    Assert (mDialogType & ConsoleType);
    659672    /* Searching for ConsoleType item's root */
    660     QListViewItem *root = listView->findItem (QString::number (ConsoleType), 3);
     673    Q3ListViewItem *root = listView->findItem (QString::number (ConsoleType), 3);
    661674    Assert (root);
    662675    CSharedFolderEnumerator en = mConsole.GetSharedFolders().Enumerate();
     
    665678
    666679void VBoxSharedFoldersSettings::putBackTo (CSharedFolderEnumerator &aEn,
    667                                            QListViewItem *aRoot)
     680                                           Q3ListViewItem *aRoot)
    668681{
    669682    Assert (!aRoot->text (3).isNull());
     
    676689
    677690        /* Search for this root's items */
    678         QListViewItem *firstItem = aRoot->firstChild();
     691        Q3ListViewItem *firstItem = aRoot->firstChild();
    679692        VBoxRichListItem *item = firstItem &&
    680693            firstItem->rtti() == VBoxRichListItem::QIRichListItemId ?
     
    694707
    695708    /* saving all machine related list view items */
    696     QListViewItem *iterator = aRoot->firstChild();
     709    Q3ListViewItem *iterator = aRoot->firstChild();
    697710    while (iterator)
    698711    {
     
    709722
    710723
    711 QListViewItem* VBoxSharedFoldersSettings::searchRoot (bool aIsPermanent)
     724Q3ListViewItem* VBoxSharedFoldersSettings::searchRoot (bool aIsPermanent)
    712725{
    713726    if (!aIsPermanent)
     
    723736    /* Make the used names list: */
    724737    SFoldersNameList usedList;
    725     QListViewItemIterator it (listView);
     738    Q3ListViewItemIterator it (listView);
    726739    while (*it)
    727740    {
     
    746759    Assert (!name.isEmpty() && !path.isEmpty());
    747760    /* Searching root for the new listview item */
    748     QListViewItem *root = searchRoot (isPermanent);
     761    Q3ListViewItem *root = searchRoot (isPermanent);
    749762    Assert (root);
    750763    /* Appending a new listview item to the root */
     
    765778    /* Make the used names list: */
    766779    SFoldersNameList usedList;
    767     QListViewItemIterator it (listView);
     780    Q3ListViewItemIterator it (listView);
    768781    while (*it)
    769782    {
     
    779792
    780793    /* Check selected item */
    781     QListViewItem *selectedItem = listView->selectedItem();
     794    Q3ListViewItem *selectedItem = listView->selectedItem();
    782795    VBoxRichListItem *item =
    783796        selectedItem->rtti() == VBoxRichListItem::QIRichListItemId ?
     
    801814    Assert (!name.isEmpty() && !path.isEmpty());
    802815    /* Searching new root for the selected listview item */
    803     QListViewItem *root = searchRoot (isPermanent);
     816    Q3ListViewItem *root = searchRoot (isPermanent);
    804817    Assert (root);
    805818    /* Updating an edited listview item */
     
    833846
    834847
    835 void VBoxSharedFoldersSettings::processCurrentChanged (QListViewItem *aItem)
     848void VBoxSharedFoldersSettings::processCurrentChanged (Q3ListViewItem *aItem)
    836849{
    837850    if (aItem && aItem->isSelectable() && listView->selectedItem() != aItem)
     
    847860}
    848861
    849 void VBoxSharedFoldersSettings::processDoubleClick (QListViewItem *aItem)
     862void VBoxSharedFoldersSettings::processDoubleClick (Q3ListViewItem *aItem)
    850863{
    851864    bool editEnabled = aItem && aItem->parent() &&
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxSnapshotDetailsDlg.ui.h

    r5999 r7220  
     1//Added by qt3to4:
     2#include <q3mimefactory.h>
    13/**
    24 *
     
    2931void VBoxSnapshotDetailsDlg::init()
    3032{
    31     setIcon (QPixmap::fromMimeSource ("settings_16px.png"));
     33    setIcon (qPixmapFromMimeSource ("settings_16px.png"));
    3234
    3335    txeSummary->setPaper (this->backgroundBrush());
     
    3537
    3638    // filter out Enter keys in order to direct them to the default dlg button
    37     QIKeyFilter *ef = new QIKeyFilter (this, Key_Enter);
     39    QIKeyFilter *ef = new QIKeyFilter (this, Qt::Key_Enter);
    3840    ef->watchOn (txeSummary);
    3941
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxSnapshotsWgt.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <Q3PopupMenu>
    13/**
    24 *
     
    3032
    3133/** QListViewItem subclass for snapshots */
    32 class VBoxSnapshotsWgt::ListViewItem : public QListViewItem
     34class VBoxSnapshotsWgt::ListViewItem : public Q3ListViewItem
    3335{
    3436public:
    3537
    3638    /** Normal snapshot item */
    37     ListViewItem (QListView *lv, const CSnapshot &aSnapshot)
    38         : QListViewItem (lv)
     39    ListViewItem (Q3ListView *lv, const CSnapshot &aSnapshot)
     40        : Q3ListViewItem (lv)
    3941        , mBld (false), mItal (false)
    4042        , mSnapshot (aSnapshot)
     
    4446
    4547    /** Normal snapshot item */
    46     ListViewItem (QListViewItem *lvi, const CSnapshot &aSnapshot)
    47         : QListViewItem (lvi)
     48    ListViewItem (Q3ListViewItem *lvi, const CSnapshot &aSnapshot)
     49        : Q3ListViewItem (lvi)
    4850        , mBld (false), mItal (false)
    4951        , mSnapshot (aSnapshot)
     
    5355
    5456    /** Current state item */
    55     ListViewItem (QListView *lv, const CMachine &aMachine)
    56         : QListViewItem (lv)
     57    ListViewItem (Q3ListView *lv, const CMachine &aMachine)
     58        : Q3ListViewItem (lv)
    5759        , mBld (false), mItal (true)
    5860        , mMachine (aMachine)
     
    6365
    6466    /** Current state item */
    65     ListViewItem (QListViewItem *lvi, const CMachine &aMachine)
    66         : QListViewItem (lvi)
     67    ListViewItem (Q3ListViewItem *lvi, const CMachine &aMachine)
     68        : Q3ListViewItem (lvi)
    6769        , mBld (false), mItal (true)
    6870        , mMachine (aMachine)
     
    9597        if (font != p->font())
    9698            p->setFont (font);
    97         QListViewItem::paintCell (p, cg, column, width, align);
    98     }
    99 
    100     int width (const QFontMetrics &fm, const QListView *lv, int c) const
     99        Q3ListViewItem::paintCell (p, cg, column, width, align);
     100    }
     101
     102    int width (const QFontMetrics &fm, const Q3ListView *lv, int c) const
    101103    {
    102104        QFont font = lv->font();
     
    106108            font.setItalic (mItal);
    107109        if (font != lv->font())
    108             return QListViewItem::width (QFontMetrics (font), lv, c);
    109         return QListViewItem::width (fm, lv, c);
     110            return Q3ListViewItem::width (QFontMetrics (font), lv, c);
     111        return Q3ListViewItem::width (fm, lv, c);
    110112    }
    111113
     
    201203    void okRename (int aCol)
    202204    {
    203         QListViewItem::okRename (aCol);
     205        Q3ListViewItem::okRename (aCol);
    204206        AssertReturn (aCol == 0 && !mSnapshot.isNull(), (void) 0);
    205207        mSnapshot.SetName (text (0));
     
    226228
    227229/** Tooltips for snapshots */
    228 class VBoxSnapshotsWgt::ToolTip : public QToolTip
    229 {
    230 public:
    231 
    232     ToolTip (QListView *aLV, QWidget *aParent, QToolTipGroup *aTG = 0)
    233         : QToolTip (aParent, aTG), mLV (aLV)
    234     {}
    235 
    236     virtual ~ToolTip()
    237     {
    238         remove (parentWidget());
    239     }
    240 
    241     void maybeTip (const QPoint &aPnt);
    242 
    243 private:
    244 
    245     QListView *mLV;
    246 };
    247 
    248 void VBoxSnapshotsWgt::ToolTip::maybeTip (const QPoint &aPnt)
    249 {
    250     ListViewItem *lvi = static_cast <ListViewItem *> (mLV->itemAt (aPnt));
    251     if (!lvi)
    252         return;
    253 
    254     if (parentWidget()->topLevelWidget()->inherits ("QMainWindow"))
    255     {
    256         /*
    257          *  Ensure the main window doesn't show the text from the previous
    258          *  tooltip in the status bar.
    259          */
    260         QToolTipGroup *toolTipGroup =
    261             (::qt_cast <QMainWindow *> (parentWidget()->topLevelWidget()))->
    262                 toolTipGroup();
    263         if (toolTipGroup)
    264         {
    265             int index = toolTipGroup->metaObject()->findSignal("removeTip()", false);
    266             toolTipGroup->qt_emit (index, 0);
    267         }
    268     }
    269 
    270     tip (mLV->itemRect (lvi), lvi->toolTipText());
    271 }
     230#warning port me
     231//class VBoxSnapshotsWgt::ToolTip : public QToolTip
     232//{
     233//public:
     234//
     235//    ToolTip (Q3ListView *aLV, QWidget *aParent, QToolTipGroup *aTG = 0)
     236//        : QToolTip (aParent, aTG), mLV (aLV)
     237//    {}
     238//
     239//    virtual ~ToolTip()
     240//    {
     241//        remove (parentWidget());
     242//    }
     243//
     244//    void maybeTip (const QPoint &aPnt);
     245//
     246//private:
     247//
     248//    Q3ListView *mLV;
     249//};
     250
     251//void VBoxSnapshotsWgt::ToolTip::maybeTip (const QPoint &aPnt)
     252//{
     253//    ListViewItem *lvi = static_cast <ListViewItem *> (mLV->itemAt (aPnt));
     254//    if (!lvi)
     255//        return;
     256//
     257//    if (parentWidget()->topLevelWidget()->inherits ("QMainWindow"))
     258//    {
     259//        /*
     260//         *  Ensure the main window doesn't show the text from the previous
     261//         *  tooltip in the status bar.
     262//         */
     263//        QToolTipGroup *toolTipGroup =
     264//            (::qt_cast <Q3MainWindow *> (parentWidget()->topLevelWidget()))->
     265//                toolTipGroup();
     266//        if (toolTipGroup)
     267//        {
     268//          int index = toolTipGroup->metaObject()->findSignal("removeTip()", false);
     269//          toolTipGroup->qt_emit (index, 0);
     270//        }
     271//    }
     272//
     273//    tip (mLV->itemRect (lvi), lvi->toolTipText());
     274//}
    272275
    273276////////////////////////////////////////////////////////////////////////////////
     
    299302    toolBar->setUsesBigPixmaps (true);
    300303    toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
    301     VBoxSnapshotsWgtLayout->insertWidget (0, toolBar);
     304#warning port me
     305//    VBoxSnapshotsWgtLayout->insertWidget (0, toolBar);
    302306#ifdef Q_WS_MAC
    303307    toolBar->setMacStyle();
     
    305309
    306310    /* context menu */
    307     mContextMenu = new QPopupMenu (this);
     311    mContextMenu = new Q3PopupMenu (this);
    308312    mContextMenuDirty = true;
    309313
     
    326330
    327331    /* tooltip */
    328     mToolTip = new ToolTip (listView, listView->viewport());
     332#warning port me
     333//    mToolTip = new ToolTip (listView, listView->viewport());
    329334}
    330335
     
    354359VBoxSnapshotsWgt::ListViewItem *VBoxSnapshotsWgt::findItem (const QUuid &aSnapshotId)
    355360{
    356     QListViewItemIterator it (listView);
     361    Q3ListViewItemIterator it (listView);
    357362    while (it.current())
    358363    {
     
    433438VBoxSnapshotsWgt::ListViewItem *VBoxSnapshotsWgt::curStateItem()
    434439{
    435     QListViewItem *csi = mCurSnapshotItem ? mCurSnapshotItem->firstChild()
     440    Q3ListViewItem *csi = mCurSnapshotItem ? mCurSnapshotItem->firstChild()
    436441                                          : listView->firstChild();
    437442    Assert (csi);
     
    439444}
    440445
    441 void VBoxSnapshotsWgt::populateSnapshots (const CSnapshot &snapshot, QListViewItem *item)
     446void VBoxSnapshotsWgt::populateSnapshots (const CSnapshot &snapshot, Q3ListViewItem *item)
    442447{
    443448    ListViewItem *si = 0;
     
    464469}
    465470
    466 void VBoxSnapshotsWgt::listView_currentChanged (QListViewItem *item)
     471void VBoxSnapshotsWgt::listView_currentChanged (Q3ListViewItem *item)
    467472{
    468473    /* Make the selected item visible */
     
    502507
    503508void VBoxSnapshotsWgt::
    504 listView_contextMenuRequested (QListViewItem *item, const QPoint &pnt,
     509listView_contextMenuRequested (Q3ListViewItem *item, const QPoint &pnt,
    505510                               int /* col */)
    506511{
     
    583588    QString snapShotName = tr ("Snapshot %1");
    584589    QRegExp regExp (QString ("^") + snapShotName.arg ("([0-9]+)") + QString ("$"));
    585     QListViewItemIterator iterator (listView);
     590    Q3ListViewItemIterator iterator (listView);
    586591    while (*iterator)
    587592    {
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxUSBFilterSettings.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <Q3CString>
    13/**
    24 *
     
    6567        case VBoxUSBFilterSettings::MachineType:
    6668        {
    67             QCString remote = aFilter.GetRemote().latin1();
     69            Q3CString remote = aFilter.GetRemote().latin1();
    6870            if (remote == "yes" || remote == "true" || remote == "1")
    6971                cbRemote->setCurrentItem (1);
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMFirstRunWzd.ui.h

    r5999 r7220  
     1//Added by qt3to4:
     2#include <QShowEvent>
    13/**
    24 *
     
    5052    /* media page */
    5153    cbImage = new VBoxMediaComboBox (bgSource, "cbImage", VBoxDefs::CD);
    52     ltVdm->insertWidget (0, cbImage);
     54#warning port me
     55//    ltVdm->insertWidget (0, cbImage);
    5356    tbVdm->setIconSet (VBoxGlobal::iconSet ("select_file_16px.png",
    5457                                            "select_file_dis_16px.png"));
     
    5861    teSummary = new QITextEdit (pageSummary);
    5962    teSummary->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Minimum);
    60     teSummary->setFrameShape (QTextEdit::NoFrame);
     63    teSummary->setFrameShape (Q3TextEdit::NoFrame);
    6164    teSummary->setReadOnly (TRUE);
    6265    teSummary->setPaper (pageSummary->backgroundBrush());
    63     ltSummary->insertWidget (2, teSummary);
     66#warning port me
     67//    ltSummary->insertWidget (2, teSummary);
    6468
    6569    /* setup connections and set validation for pages
     
    7478
    7579    /* filter out Enter keys in order to direct them to the default dlg button */
    76     QIKeyFilter *ef = new QIKeyFilter (this, Key_Enter);
     80    QIKeyFilter *ef = new QIKeyFilter (this, Qt::Key_Enter);
    7781    ef->watchOn (teSummary);
    7882
     
    8488
    8589    /* setup minimum width for the sizeHint to be calculated correctly */
    86     int wid = widthSpacer->minimumSize().width();
     90#warning port me
     91    int wid = 1;
     92//    int wid = widthSpacer->minimumSize().width();
    8793    txWelcome->setMinimumWidth (wid);
    8894    txType->setMinimumWidth (wid);
     
    170176    }
    171177
    172     QWizard::showPage (aPage);
     178    Q3Wizard::showPage (aPage);
    173179
    174180    /* fix focus on the last page. when we go to the last page
     
    227233    }
    228234
    229     QWizard::accept();
     235    Q3Wizard::accept();
    230236}
    231237
     
    331337{
    332338    VBoxDiskImageManagerDlg vdm (this, "VBoxDiskImageManagerDlg",
    333                                  WType_Dialog | WShowModal);
     339                                 Qt::WType_Dialog | Qt::WShowModal);
    334340    QUuid machineId = machine.GetId();
    335341    VBoxDefs::DiskType type = rbCdType->isChecked() ? VBoxDefs::CD :
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMInformationDlg.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <QKeyEvent>
     3#include <Q3Frame>
     4#include <q3mimefactory.h>
     5#include <QResizeEvent>
     6#include <QEvent>
     7#include <Q3VBoxLayout>
     8#include <QShowEvent>
    19/**
    210 *
     
    3846        mSelfArray [machine.GetName()] = new VBoxVMInformationDlg (
    3947            aConsole,
    40             "VBoxVMInformationDlg", WType_TopLevel | WDestructiveClose);
     48            "VBoxVMInformationDlg", Qt::WType_TopLevel | Qt::WDestructiveClose);
    4149        /* read new machine data for this information dialog */
    4250        mSelfArray [machine.GetName()]->setup (aSession, aConsole);
     
    4654    info->show();
    4755    info->raise();
    48     info->setWindowState (info->windowState() & ~WindowMinimized);
     56    info->setWindowState (info->windowState() & ~Qt::WindowMinimized);
    4957    info->setActiveWindow();
    5058}
     
    6169
    6270    /* setup a dialog icon */
    63     setIcon (QPixmap::fromMimeSource ("description_16px.png"));
     71    setIcon (qPixmapFromMimeSource ("description_16px.png"));
    6472
    6573    /* statusbar initially disabled */
     
    7482    mInfoStack = new QTabWidget (mInfoFrame, "mInfoStack");
    7583    mInfoStack->setMargin (10);
    76     QVBoxLayout *infoFrameLayout = new QVBoxLayout (mInfoFrame);
     84    Q3VBoxLayout *infoFrameLayout = new Q3VBoxLayout (mInfoFrame);
    7785    infoFrameLayout->addWidget (mInfoStack);
    7886
    7987    /* details view creation */
    80     mDetailsText = new QTextBrowser();
    81     mDetailsText->setFrameShape (QFrame::NoFrame);
     88    mDetailsText = new Q3TextBrowser();
     89    mDetailsText->setFrameShape (Q3Frame::NoFrame);
    8290    mDetailsText->setPaper (backgroundBrush());
    8391    mInfoStack->addTab (mDetailsText,
     
    8694
    8795    /* statistic view creation */
    88     mStatisticText = new QTextBrowser();
    89     mStatisticText->setFrameShape (QFrame::NoFrame);
     96    mStatisticText = new Q3TextBrowser();
     97    mStatisticText->setFrameShape (Q3Frame::NoFrame);
    9098    mStatisticText->setPaper (backgroundBrush());
    9199    mInfoStack->addTab (mStatisticText,
     
    226234     * and similar the same mechanism in Qt::QDialog inner source */
    227235    QPushButton *button = 0;
    228     QObjectList *list = queryList ("QPushButton");
    229     QObjectListIt it (*list);
    230     while ((button = (QPushButton*)it.current()) && !button->isDefault())
    231         ++ it;
     236    QObjectList list = queryList ("QPushButton");
     237    foreach (QObject* obj, list)
     238    {
     239        button = qobject_cast<QPushButton*> (obj);
     240        if (button->isDefault())
     241            break;
     242    }
    232243    return button;
    233244}
     
    267278            break;
    268279    }
    269     return QMainWindow::eventFilter (aObject, aEvent);
     280    return Q3MainWindow::eventFilter (aObject, aEvent);
    270281}
    271282
     
    273284bool VBoxVMInformationDlg::event (QEvent *aEvent)
    274285{
    275     bool result = QMainWindow::event (aEvent);
     286    bool result = Q3MainWindow::event (aEvent);
    276287    switch (aEvent->type())
    277288    {
     
    299310{
    300311    if (aEvent->state() == 0 ||
    301         (aEvent->state() & Keypad && aEvent->key() == Key_Enter))
     312        (aEvent->state() & Qt::KeypadModifier && aEvent->key() == Qt::Key_Enter))
    302313    {
    303314        switch (aEvent->key())
    304315        {
    305316            /* processing the return keypress for the auto-default button */
    306             case Key_Enter:
    307             case Key_Return:
     317            case Qt::Key_Enter:
     318            case Qt::Key_Return:
    308319            {
    309320                QPushButton *currentDefault = searchDefaultButton();
     
    313324            }
    314325            /* processing the escape keypress as the close dialog action */
    315             case Key_Escape:
     326            case Qt::Key_Escape:
    316327            {
    317328                close();
     
    327338void VBoxVMInformationDlg::showEvent (QShowEvent *aEvent)
    328339{
    329     QMainWindow::showEvent (aEvent);
     340    Q3MainWindow::showEvent (aEvent);
    330341
    331342    /* one may think that QWidget::polish() is the right place to do things
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMLogViewer.ui

    r5999 r7220  
    179179    <include location="global" impldecl="in implementation">qtoolbutton.h</include>
    180180    <include location="global" impldecl="in implementation">qmessagebox.h</include>
    181     <include location="global" impldecl="in implementation">qfocusdata.h</include>
    182181</includes>
    183182<forwards>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMLogViewer.ui.h

    r5999 r7220  
     1//Added by qt3to4:
     2#include <Q3HBoxLayout>
     3#include <QKeyEvent>
     4#include <QLabel>
     5#include <QPixmap>
     6#include <q3mimefactory.h>
     7#include <QHideEvent>
     8#include <QResizeEvent>
     9#include <QEvent>
     10#include <Q3VBoxLayout>
     11#include <QShowEvent>
    112/**
    213 *
     
    4657        mButtonClose = new QToolButton (this);
    4758        mButtonClose->setAutoRaise (true);
    48         mButtonClose->setFocusPolicy (QWidget::TabFocus);
     59        mButtonClose->setFocusPolicy (Qt::TabFocus);
    4960        mButtonClose->setAccel (QKeySequence (Qt::Key_Escape));
    5061        connect (mButtonClose, SIGNAL (clicked()), this, SLOT (hide()));
     
    6273        mButtonNext->setEnabled (false);
    6374        mButtonNext->setAutoRaise (true);
    64         mButtonNext->setFocusPolicy (QWidget::TabFocus);
     75        mButtonNext->setFocusPolicy (Qt::TabFocus);
    6576        mButtonNext->setUsesTextLabel (true);
    6677        mButtonNext->setTextPosition (QToolButton::BesideIcon);
     
    7283        mButtonPrev->setEnabled (false);
    7384        mButtonPrev->setAutoRaise (true);
    74         mButtonPrev->setFocusPolicy (QWidget::TabFocus);
     85        mButtonPrev->setFocusPolicy (Qt::TabFocus);
    7586        mButtonPrev->setUsesTextLabel (true);
    7687        mButtonPrev->setTextPosition (QToolButton::BesideIcon);
     
    100111                                                     QSizePolicy::Minimum);
    101112
    102         QHBoxLayout *mainLayout = new QHBoxLayout (this, 5, 5);
     113        Q3HBoxLayout *mainLayout = new Q3HBoxLayout (this, 5, 5);
    103114        mainLayout->addWidget (mButtonClose);
    104115        mainLayout->addWidget (mSearchName);
     
    169180    void search (bool aForward, bool aStartCurrent = false)
    170181    {
    171         QTextBrowser *browser = mViewer->currentLogPage();
     182        Q3TextBrowser *browser = mViewer->currentLogPage();
    172183        if (!browser) return;
    173184
     
    226237                 * widget as a search next string action */
    227238                if (aObject == mSearchString &&
    228                     (e->state() == 0 || e->state() & Keypad) &&
    229                     (e->key() == Key_Enter || e->key() == Key_Return))
     239                    (e->state() == 0 || e->state() & Qt::Keypad) &&
     240                    (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return))
    230241                {
    231242                    findNext();
     
    233244                }
    234245                /* handle other search next/previous shortcuts */
    235                 else if (e->key() == Key_F3)
     246                else if (e->key() == Qt::Key_F3)
    236247                {
    237248                    if (e->state() == 0)
    238249                        findNext();
    239                     else if (e->state() == ShiftButton)
     250                    else if (e->state() == Qt::ShiftButton)
    240251                        findBack();
    241252                    return true;
     
    243254                /* handle ctrl-f key combination as a shortcut to
    244255                 * move to the search field */
    245                 else if (e->state() == ControlButton && e->key() == Key_F)
     256                else if (e->state() == Qt::ControlButton && e->key() == Qt::Key_F)
    246257                {
    247258                    if (mViewer->currentLogPage())
     
    254265                /* handle alpha-numeric keys to implement the
    255266                 * "find as you type" feature */
    256                 else if ((e->state() & ~ShiftButton) == 0 &&
     267                else if ((e->state() & ~Qt::ShiftButton) == 0 &&
    257268                         e->key() >= Qt::Key_Exclam &&
    258269                         e->key() <= Qt::Key_AsciiTilde)
     
    284295    void hideEvent (QHideEvent *aEvent)
    285296    {
    286         if (focusData()->focusWidget()->parent() == this)
    287            focusNextPrevChild (true);
     297#warning port me
     298//        if (focusData()->focusWidget()->parent() == this)
     299//           focusNextPrevChild (true);
    288300        QWidget::hideEvent (aEvent);
    289301    }
     
    318330        /* creating new log viewer if there is no one existing */
    319331        mSelfArray [aMachine.GetName()] = new VBoxVMLogViewer (0,
    320             "VBoxVMLogViewer", WType_TopLevel | WDestructiveClose);
     332            "VBoxVMLogViewer", Qt::WType_TopLevel | Qt::WDestructiveClose);
    321333        /* read new machine data for this log viewer */
    322334        mSelfArray [aMachine.GetName()]->setup (aMachine);
     
    325337    VBoxVMLogViewer *viewer = mSelfArray [aMachine.GetName()];
    326338    viewer->show();
    327     viewer->setWindowState (viewer->windowState() & ~WindowMinimized);
     339    viewer->setWindowState (viewer->windowState() & ~Qt::WindowMinimized);
    328340    viewer->setActiveWindow();
    329341}
     
    343355
    344356    /* setup a dialog icon */
    345     setIcon (QPixmap::fromMimeSource ("show_logs_16px.png"));
     357    setIcon (qPixmapFromMimeSource ("show_logs_16px.png"));
    346358
    347359    /* statusbar initially disabled */
     
    355367    /* logs list creation */
    356368    mLogList = new QTabWidget (mLogsFrame, "mLogList");
    357     QVBoxLayout *logsFrameLayout = new QVBoxLayout (mLogsFrame);
     369    Q3VBoxLayout *logsFrameLayout = new Q3VBoxLayout (mLogsFrame);
    358370    logsFrameLayout->addWidget (mLogList);
    359371
     
    421433     * and similar the same mechanism in Qt::QDialog inner source */
    422434    QPushButton *button = 0;
    423     QObjectList *list = queryList ("QPushButton");
    424     QObjectListIt it (*list);
    425     while ((button = (QPushButton*)it.current()) && !button->isDefault())
    426         ++ it;
     435    QObjectList list = queryList ("QPushButton");
     436    foreach (QObject *obj, list)
     437    {
     438        button = qobject_cast<QPushButton*> (obj);
     439        if (button->isDefault())
     440            break;
     441    }
    427442    return button;
    428443}
     
    462477            break;
    463478    }
    464     return QMainWindow::eventFilter (aObject, aEvent);
     479    return Q3MainWindow::eventFilter (aObject, aEvent);
    465480}
    466481
     
    468483bool VBoxVMLogViewer::event (QEvent *aEvent)
    469484{
    470     bool result = QMainWindow::event (aEvent);
     485    bool result = Q3MainWindow::event (aEvent);
    471486    switch (aEvent->type())
    472487    {
     
    486501{
    487502    if (aEvent->state() == 0 ||
    488         (aEvent->state() & Keypad && aEvent->key() == Key_Enter))
     503        (aEvent->state() & Qt::KeypadModifier && aEvent->key() == Qt::Key_Enter))
    489504    {
    490505        switch (aEvent->key())
    491506        {
    492507            /* processing the return keypress for the auto-default button */
    493             case Key_Enter:
    494             case Key_Return:
     508            case Qt::Key_Enter:
     509            case Qt::Key_Return:
    495510            {
    496511                QPushButton *currentDefault = searchDefaultButton();
     
    500515            }
    501516            /* processing the escape keypress as the close dialog action */
    502             case Key_Escape:
     517            case Qt::Key_Escape:
    503518            {
    504519                mCloseButton->animateClick();
     
    514529void VBoxVMLogViewer::showEvent (QShowEvent *aEvent)
    515530{
    516     QMainWindow::showEvent (aEvent);
     531    Q3MainWindow::showEvent (aEvent);
    517532
    518533    /* one may think that QWidget::polish() is the right place to do things
     
    570585    if (!isAnyLogPresent)
    571586    {
    572         QTextBrowser *dummyLog = createLogPage ("VBox.log");
     587        Q3TextBrowser *dummyLog = createLogPage ("VBox.log");
    573588        dummyLog->setTextFormat (Qt::RichText);
    574         dummyLog->setWordWrap (QTextEdit::WidgetWidth);
     589        dummyLog->setWordWrap (Q3TextEdit::WidgetWidth);
    575590        dummyLog->setText (tr ("<p>No log files found. Press the <b>Refresh</b> "
    576591            "button to rescan the log folder <nobr><b>%1</b></nobr>.</p>")
     
    596611        /* resize the whole log-viewer to fit 80 symbols in text-browser for
    597612         * the first time started */
    598         QTextBrowser *firstPage = static_cast <QTextBrowser *> (mLogList->page(0));
     613        Q3TextBrowser *firstPage = static_cast <Q3TextBrowser *> (mLogList->page(0));
    599614        int fullWidth = firstPage->fontMetrics().width (QChar ('x')) * 80 +
    600615                        firstPage->verticalScrollBar()->width() +
     
    613628    /* prepare log file */
    614629    QFile logFile (aFileName);
    615     if (!logFile.exists() || !logFile.open (IO_ReadOnly))
     630    if (!logFile.exists() || !logFile.open (QIODevice::ReadOnly))
    616631        return;
    617632
    618633    /* read log file and write it into the log page */
    619     QTextBrowser *logViewer = createLogPage (QFileInfo (aFileName).fileName());
     634    Q3TextBrowser *logViewer = createLogPage (QFileInfo (aFileName).fileName());
    620635    logViewer->setText (logFile.readAll());
    621636
     
    624639
    625640
    626 QTextBrowser* VBoxVMLogViewer::createLogPage (const QString &aName)
    627 {
    628     QTextBrowser *logViewer = new QTextBrowser();
     641Q3TextBrowser* VBoxVMLogViewer::createLogPage (const QString &aName)
     642{
     643    Q3TextBrowser *logViewer = new Q3TextBrowser();
    629644    logViewer->setTextFormat (Qt::PlainText);
    630645    QFont font = logViewer->currentFont();
    631646    font.setFamily ("Courier New,courier");
    632647    logViewer->setFont (font);
    633     logViewer->setWordWrap (QTextEdit::NoWrap);
    634     logViewer->setVScrollBarMode (QScrollView::AlwaysOn);
     648    logViewer->setWordWrap (Q3TextEdit::NoWrap);
     649    logViewer->setVScrollBarMode (Q3ScrollView::AlwaysOn);
    635650    mLogList->addTab (logViewer, aName);
    636651    return logViewer;
     
    638653
    639654
    640 QTextBrowser* VBoxVMLogViewer::currentLogPage()
     655Q3TextBrowser* VBoxVMLogViewer::currentLogPage()
    641656{
    642657    return mLogList->isEnabled() ?
    643         static_cast<QTextBrowser*> (mLogList->currentPage()) : 0;
     658        static_cast<Q3TextBrowser*> (mLogList->currentPage()) : 0;
    644659}
    645660
     
    656671                                                       "/" + defaultFileName);
    657672
    658     QString newFileName = QFileDialog::getSaveFileName (defaultFullName,
     673    QString newFileName = Q3FileDialog::getSaveFileName (defaultFullName,
    659674        QString::null, this, "SaveLogAsDialog", tr ("Save VirtualBox Log As"));
    660675
     
    665680        QFile oldFile (mLogFilesList [mLogList->currentPageIndex()]);
    666681        QFile newFile (newFileName);
    667         if (!oldFile.open (IO_ReadOnly) || !newFile.open (IO_WriteOnly))
     682        if (!oldFile.open (QIODevice::ReadOnly) || !newFile.open (QIODevice::WriteOnly))
    668683            return;
    669684
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMNetworkSettings.ui.h

    r7207 r7220  
    290290void VBoxVMNetworkSettings::pbTAPSetup_clicked()
    291291{
    292     QString selected = QFileDialog::getOpenFileName (
     292    QString selected = Q3FileDialog::getOpenFileName (
    293293        "/",
    294294        QString::null,
     
    297297        tr ("Select TAP setup application"));
    298298
    299     if (selected)
     299    if (!selected.isEmpty())
    300300        leTAPSetup->setText (selected);
    301301}
     
    303303void VBoxVMNetworkSettings::pbTAPTerminate_clicked()
    304304{
    305     QString selected = QFileDialog::getOpenFileName (
     305    QString selected = Q3FileDialog::getOpenFileName (
    306306        "/",
    307307        QString::null,
     
    310310        tr ("Select TAP terminate application"));
    311311
    312     if (selected)
     312    if (!selected.isEmpty())
    313313        leTAPTerminate->setText (selected);
    314314}
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsDlg.ui

    r7021 r7220  
    4646    <grid>
    4747        <property name="name">
    48             <cstring>unnamed</cstring>
     48            <cstring>VBoxVMSettingsDlgLayout</cstring>
    4949        </property>
    5050        <property name="spacing">
     
    32053205    <include location="global" impldecl="in implementation">qobjectlist.h</include>
    32063206    <include location="global" impldecl="in implementation">qlistbox.h</include>
    3207     <include location="global" impldecl="in implementation">qfocusdata.h</include>
    32083207    <include location="global" impldecl="in implementation">qtimer.h</include>
    32093208    <include location="global" impldecl="in implementation">qpopupmenu.h</include>
  • trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsDlg.ui.h

    r7207 r7220  
     1//Added by qt3to4:
     2#include <Q3WhatsThis>
     3#include <QLabel>
     4#include <QShowEvent>
     5#include <Q3ValueList>
     6#include <q3mimefactory.h>
     7#include <QKeyEvent>
     8#include <Q3HBoxLayout>
     9#include <QEvent>
     10#include <Q3VBoxLayout>
    111/**
    212 *
     
    4353    {
    4454        setCaption (tr ("Add Host Interface"));
    45         QVBoxLayout *mainLayout = new QVBoxLayout (this, 10, 10, "mainLayout");
     55        Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 10, 10, "mainLayout");
    4656
    4757        /* Setup Input layout */
    48         QHBoxLayout *inputLayout = new QHBoxLayout (mainLayout, 10, "inputLayout");
     58        Q3HBoxLayout *inputLayout = new Q3HBoxLayout (mainLayout, 10, "inputLayout");
    4959        QLabel *lbName = new QLabel (tr ("Interface Name"), this);
    5060        mLeName = new QLineEdit (aIfaceName, this);
    51         QWhatsThis::add (mLeName, tr ("Descriptive name of the new network interface"));
     61        Q3WhatsThis::add (mLeName, tr ("Descriptive name of the new network interface"));
    5262        inputLayout->addWidget (lbName);
    5363        inputLayout->addWidget (mLeName);
     
    5666
    5767        /* Setup Button layout */
    58         QHBoxLayout *buttonLayout = new QHBoxLayout (mainLayout, 10, "buttonLayout");
     68        Q3HBoxLayout *buttonLayout = new Q3HBoxLayout (mainLayout, 10, "buttonLayout");
    5969        mBtOk = new QPushButton (tr ("&OK"), this, "mBtOk");
    6070        QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
     
    133143 *  boot-items up/down moving.
    134144 */
    135 class BootItemsTable : public QListView
     145class BootItemsTable : public Q3ListView
    136146{
    137147    Q_OBJECT
     
    140150
    141151    BootItemsTable (QWidget *aParent, const char *aName)
    142         : QListView (aParent, aName)
     152        : Q3ListView (aParent, aName)
    143153    {
    144154        addColumn (QString::null);
     
    147157        setColumnWidthMode (0, Maximum);
    148158        setResizeMode (AllColumns);
    149         QWhatsThis::add (this, tr ("Defines the boot device order. "
     159        Q3WhatsThis::add (this, tr ("Defines the boot device order. "
    150160                                   "Use checkboxes to the left to enable or disable "
    151161                                   "individual boot devices. Move items up and down to "
    152162                                   "change the device order."));
    153163        setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Preferred);
    154         connect (this, SIGNAL (pressed (QListViewItem*)),
    155                  this, SLOT (processPressed (QListViewItem*)));
     164        connect (this, SIGNAL (pressed (Q3ListViewItem*)),
     165                 this, SLOT (processPressed (Q3ListViewItem*)));
    156166    }
    157167
     
    168178private slots:
    169179
    170     void processPressed (QListViewItem *aItem)
     180    void processPressed (Q3ListViewItem *aItem)
    171181    {
    172182        if (!aItem)
     
    190200            }
    191201        }
    192         QListView::keyPressEvent (aEvent);
     202        Q3ListView::keyPressEvent (aEvent);
    193203    }
    194204};
     
    206216    Q_OBJECT
    207217
    208     class BootItem : public QCheckListItem
     218    class BootItem : public Q3CheckListItem
    209219    {
    210220        public:
    211221
    212             BootItem (BootItemsTable *aParent, QListViewItem *aAfter,
     222            BootItem (BootItemsTable *aParent, Q3ListViewItem *aAfter,
    213223                      const QString &aName, Type aType)
    214                 : QCheckListItem (aParent, aAfter, aName, aType) {}
     224                : Q3CheckListItem (aParent, aAfter, aName, aType) {}
    215225
    216226        private:
     
    229239    {
    230240        /* Setup main widget layout */
    231         QHBoxLayout *mainLayout = new QHBoxLayout (this, 0, 6, "mainLayout");
     241        Q3HBoxLayout *mainLayout = new Q3HBoxLayout (this, 0, 6, "mainLayout");
    232242
    233243        /* Setup settings layout */
    234244        mBootTable = new BootItemsTable (this, "mBootTable");
    235         connect (mBootTable, SIGNAL (currentChanged (QListViewItem*)),
    236                  this, SLOT (processCurrentChanged (QListViewItem*)));
     245        connect (mBootTable, SIGNAL (currentChanged (Q3ListViewItem*)),
     246                 this, SLOT (processCurrentChanged (Q3ListViewItem*)));
    237247        mainLayout->addWidget (mBootTable);
    238248
    239249        /* Setup button's layout */
    240         QVBoxLayout *buttonLayout = new QVBoxLayout (mainLayout, 0, "buttonLayout");
     250        Q3VBoxLayout *buttonLayout = new Q3VBoxLayout (mainLayout, 0, "buttonLayout");
    241251        mBtnUp = new QToolButton (this, "mBtnUp");
    242252        mBtnDown = new QToolButton (this, "mBtnDown");
    243253        mBtnUp->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
    244254        mBtnDown->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
    245         QWhatsThis::add (mBtnUp, tr ("Moves the selected boot device up."));
    246         QWhatsThis::add (mBtnDown, tr ("Moves the selected boot device down."));
     255        Q3WhatsThis::add (mBtnUp, tr ("Moves the selected boot device up."));
     256        Q3WhatsThis::add (mBtnDown, tr ("Moves the selected boot device down."));
    247257        QToolTip::add (mBtnUp, tr ("Move Up (Ctrl-Up)"));
    248258        QToolTip::add (mBtnDown, tr ("Move Down (Ctrl-Down)"));
    249259        mBtnUp->setAutoRaise (true);
    250260        mBtnDown->setAutoRaise (true);
    251         mBtnUp->setFocusPolicy (QWidget::StrongFocus);
    252         mBtnDown->setFocusPolicy (QWidget::StrongFocus);
     261        mBtnUp->setFocusPolicy (Qt::StrongFocus);
     262        mBtnDown->setFocusPolicy (Qt::StrongFocus);
    253263        mBtnUp->setIconSet (VBoxGlobal::iconSet ("list_moveup_16px.png",
    254264                                                 "list_moveup_disabled_16px.png"));
     
    290300            {
    291301                QString name = vboxGlobal().toString (type);
    292                 QCheckListItem *item = new BootItem (mBootTable,
    293                     mBootTable->lastItem(), name, QCheckListItem::CheckBox);
     302                Q3CheckListItem *item = new BootItem (mBootTable,
     303                    mBootTable->lastItem(), name, Q3CheckListItem::CheckBox);
    294304                item->setOn (true);
    295305                uniqueList << name;
     
    304314            if (!uniqueList.contains (name))
    305315            {
    306                 QCheckListItem *item = new BootItem (mBootTable,
    307                     mBootTable->lastItem(), name, QCheckListItem::CheckBox);
     316                Q3CheckListItem *item = new BootItem (mBootTable,
     317                    mBootTable->lastItem(), name, Q3CheckListItem::CheckBox);
    308318                uniqueList << name;
    309319                int width = item->width (mBootTable->fontMetrics(), mBootTable, 0);
     
    321331    void putBackToMachine (CMachine &aMachine)
    322332    {
    323         QCheckListItem *item = 0;
     333        Q3CheckListItem *item = 0;
    324334        /* Search for checked items */
    325335        int index = 1;
    326         item = static_cast<QCheckListItem*> (mBootTable->firstChild());
     336        item = static_cast<Q3CheckListItem*> (mBootTable->firstChild());
    327337        while (item)
    328338        {
     
    333343                aMachine.SetBootOrder (index++, type);
    334344            }
    335             item = static_cast<QCheckListItem*> (item->nextSibling());
     345            item = static_cast<Q3CheckListItem*> (item->nextSibling());
    336346        }
    337347        /* Search for non-checked items */
    338         item = static_cast<QCheckListItem*> (mBootTable->firstChild());
     348        item = static_cast<Q3CheckListItem*> (mBootTable->firstChild());
    339349        while (item)
    340350        {
    341351            if (!item->isOn())
    342352                aMachine.SetBootOrder (index++, KDeviceType_Null);
    343             item = static_cast<QCheckListItem*> (item->nextSibling());
     353            item = static_cast<Q3CheckListItem*> (item->nextSibling());
    344354        }
    345355    }
     
    367377    void moveItemUp()
    368378    {
    369         QListViewItem *item = mBootTable->currentItem();
     379        Q3ListViewItem *item = mBootTable->currentItem();
    370380        Assert (item);
    371         QListViewItem *itemAbove = item->itemAbove();
     381        Q3ListViewItem *itemAbove = item->itemAbove();
    372382        if (!itemAbove) return;
    373383        itemAbove->moveItem (item);
     
    378388    void moveItemDown()
    379389    {
    380         QListViewItem *item = mBootTable->currentItem();
     390        Q3ListViewItem *item = mBootTable->currentItem();
    381391        Assert (item);
    382         QListViewItem *itemBelow = item->itemBelow();
     392        Q3ListViewItem *itemBelow = item->itemBelow();
    383393        if (!itemBelow) return;
    384394        item->moveItem (itemBelow);
     
    392402    }
    393403
    394     void processCurrentChanged (QListViewItem *aItem)
     404    void processCurrentChanged (Q3ListViewItem *aItem)
    395405    {
    396406        bool upEnabled   = aItem && aItem->isSelected() && aItem->itemAbove();
     
    429439//}
    430440
    431 class USBListItem : public QCheckListItem
     441class USBListItem : public Q3CheckListItem
    432442{
    433443public:
    434444
    435     USBListItem (QListView *aParent, QListViewItem *aAfter)
    436         : QCheckListItem (aParent, aAfter, QString::null, CheckBox)
     445    USBListItem (Q3ListView *aParent, Q3ListViewItem *aAfter)
     446        : Q3CheckListItem (aParent, aAfter, QString::null, CheckBox)
    437447        , mId (-1) {}
    438448
     
    444454 *  using the text of the first column of every item.
    445455 */
    446 static QString path (QListViewItem *li)
     456static QString path (Q3ListViewItem *li)
    447457{
    448458    static QString sep = ": ";
    449459    QString p;
    450     QListViewItem *cur = li;
     460    Q3ListViewItem *cur = li;
    451461    while (cur)
    452462    {
     
    480490             this, SLOT (onMediaEnumerationDone()));
    481491
    482     setIcon (QPixmap::fromMimeSource ("settings_16px.png"));
     492    setIcon (qPixmapFromMimeSource ("settings_16px.png"));
    483493
    484494    /* all pages are initially valid */
     
    490500    /* hide the header and internal columns */
    491501    listView->header()->hide();
    492     listView->setColumnWidthMode (listView_Id, QListView::Manual);
    493     listView->setColumnWidthMode (listView_Link, QListView::Manual);
     502    listView->setColumnWidthMode (listView_Id, Q3ListView::Manual);
     503    listView->setColumnWidthMode (listView_Link, Q3ListView::Manual);
    494504    listView->hideColumn (listView_Id);
    495505    listView->hideColumn (listView_Link);
     
    520530
    521531    whatsThisLabel = new QIRichLabel (this, "whatsThisLabel");
    522     VBoxVMSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1);
     532#warning port me
     533//    VBoxVMSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1);
    523534
    524535#ifndef DEBUG
     
    534545
    535546    whatsThisLabel->setMaxHeightMode (true);
    536     whatsThisLabel->setFocusPolicy (QWidget::NoFocus);
     547    whatsThisLabel->setFocusPolicy (Qt::NoFocus);
    537548    whatsThisLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
    538     whatsThisLabel->setBackgroundMode (QLabel::PaletteMidlight);
     549    whatsThisLabel->setBackgroundMode (Qt::PaletteMidlight);
    539550    whatsThisLabel->setFrameShape (QLabel::Box);
    540551    whatsThisLabel->setFrameShadow (QLabel::Sunken);
    541552    whatsThisLabel->setMargin (7);
    542553    whatsThisLabel->setScaledContents (FALSE);
    543     whatsThisLabel->setAlignment (int (QLabel::WordBreak |
    544                                        QLabel::AlignJustify |
    545                                        QLabel::AlignTop));
     554    whatsThisLabel->setAlignment (int (Qt::TextWordWrap |
     555                                       Qt::AlignJustify |
     556                                       Qt::AlignTop));
    546557
    547558    whatsThisLabel->setFixedHeight (whatsThisLabel->frameWidth() * 2 +
     
    584595    /* HDD Images page */
    585596
    586     QWhatsThis::add (static_cast <QWidget *> (grbHDA->child ("qt_groupbox_checkbox")),
     597    Q3WhatsThis::add (static_cast <QWidget *> (grbHDA->child ("qt_groupbox_checkbox")),
    587598                     tr ("When checked, attaches the specified virtual hard disk to the "
    588599                         "Master slot of the Primary IDE controller."));
    589     QWhatsThis::add (static_cast <QWidget *> (grbHDB->child ("qt_groupbox_checkbox")),
     600    Q3WhatsThis::add (static_cast <QWidget *> (grbHDB->child ("qt_groupbox_checkbox")),
    590601                     tr ("When checked, attaches the specified virtual hard disk to the "
    591602                         "Slave slot of the Primary IDE controller."));
    592     QWhatsThis::add (static_cast <QWidget *> (grbHDD->child ("qt_groupbox_checkbox")),
     603    Q3WhatsThis::add (static_cast <QWidget *> (grbHDD->child ("qt_groupbox_checkbox")),
    593604                     tr ("When checked, attaches the specified virtual hard disk to the "
    594605                         "Slave slot of the Secondary IDE controller."));
     
    596607    cbHDB = new VBoxMediaComboBox (grbHDB, "cbHDB", VBoxDefs::HD);
    597608    cbHDD = new VBoxMediaComboBox (grbHDD, "cbHDD", VBoxDefs::HD);
    598     hdaLayout->insertWidget (0, cbHDA);
    599     hdbLayout->insertWidget (0, cbHDB);
    600     hddLayout->insertWidget (0, cbHDD);
     609#warning port me
     610//    hdaLayout->insertWidget (0, cbHDA);
     611//    hdbLayout->insertWidget (0, cbHDB);
     612//    hddLayout->insertWidget (0, cbHDD);
    601613    /* sometimes the weirdness of Qt just kills... */
    602614    setTabOrder (static_cast <QWidget *> (grbHDA->child ("qt_groupbox_checkbox")),
     
    607619                 cbHDD);
    608620
    609     QWhatsThis::add (cbHDB, tr ("Displays the virtual hard disk to attach to this IDE slot "
     621    Q3WhatsThis::add (cbHDB, tr ("Displays the virtual hard disk to attach to this IDE slot "
    610622                                "and allows to quickly select a different hard disk."));
    611     QWhatsThis::add (cbHDD, tr ("Displays the virtual hard disk to attach to this IDE slot "
     623    Q3WhatsThis::add (cbHDD, tr ("Displays the virtual hard disk to attach to this IDE slot "
    612624                                "and allows to quickly select a different hard disk."));
    613     QWhatsThis::add (cbHDA, tr ("Displays the virtual hard disk to attach to this IDE slot "
     625    Q3WhatsThis::add (cbHDA, tr ("Displays the virtual hard disk to attach to this IDE slot "
    614626                                "and allows to quickly select a different hard disk."));
    615     QWhatsThis::add (cbHDB, tr ("Displays the virtual hard disk to attach to this IDE slot "
     627    Q3WhatsThis::add (cbHDB, tr ("Displays the virtual hard disk to attach to this IDE slot "
    616628                                "and allows to quickly select a different hard disk."));
    617     QWhatsThis::add (cbHDD, tr ("Displays the virtual hard disk to attach to this IDE slot "
     629    Q3WhatsThis::add (cbHDD, tr ("Displays the virtual hard disk to attach to this IDE slot "
    618630                                "and allows to quickly select a different hard disk."));
    619631
     
    644656    /* CD/DVD-ROM Drive Page */
    645657
    646     QWhatsThis::add (static_cast <QWidget *> (bgDVD->child ("qt_groupbox_checkbox")),
     658    Q3WhatsThis::add (static_cast <QWidget *> (bgDVD->child ("qt_groupbox_checkbox")),
    647659                     tr ("When checked, mounts the specified media to the CD/DVD drive of the "
    648660                         "virtual machine. Note that the CD/DVD drive is always connected to the "
    649661                         "Secondary Master IDE controller of the machine."));
    650662    cbISODVD = new VBoxMediaComboBox (bgDVD, "cbISODVD", VBoxDefs::CD);
    651     cdLayout->insertWidget(0, cbISODVD);
    652     QWhatsThis::add (cbISODVD, tr ("Displays the image file to mount to the virtual CD/DVD "
     663#warning port me
     664//    cdLayout->insertWidget(0, cbISODVD);
     665    Q3WhatsThis::add (cbISODVD, tr ("Displays the image file to mount to the virtual CD/DVD "
    653666                                   "drive and allows to quickly select a different image."));
    654667
     
    671684    /* Floppy Drive Page */
    672685
    673     QWhatsThis::add (static_cast <QWidget *> (bgFloppy->child ("qt_groupbox_checkbox")),
     686    Q3WhatsThis::add (static_cast <QWidget *> (bgFloppy->child ("qt_groupbox_checkbox")),
    674687                     tr ("When checked, mounts the specified media to the Floppy drive of the "
    675688                         "virtual machine."));
    676689    cbISOFloppy = new VBoxMediaComboBox (bgFloppy, "cbISOFloppy", VBoxDefs::FD);
    677     fdLayout->insertWidget(0, cbISOFloppy);
    678     QWhatsThis::add (cbISOFloppy, tr ("Displays the image file to mount to the virtual Floppy "
     690#warning port me
     691//    fdLayout->insertWidget(0, cbISOFloppy);
     692    Q3WhatsThis::add (cbISOFloppy, tr ("Displays the image file to mount to the virtual Floppy "
    679693                                      "drive and allows to quickly select a different image."));
    680694
     
    697711    /* Audio Page */
    698712
    699     QWhatsThis::add (static_cast <QWidget *> (grbAudio->child ("qt_groupbox_checkbox")),
     713    Q3WhatsThis::add (static_cast <QWidget *> (grbAudio->child ("qt_groupbox_checkbox")),
    700714                     tr ("When checked, the virtual PCI audio card is plugged into the "
    701715                         "virtual machine that uses the specified driver to communicate "
     
    721735
    722736    /* Parallel Port Page (currently disabled) */
    723     QListViewItem *item = listView->findItem ("#parallelPorts", listView_Link);
     737    Q3ListViewItem *item = listView->findItem ("#parallelPorts", listView_Link);
    724738    if (item) item->setVisible (false);
    725739
     
    741755    //  If we remove stacking, we will have to create a structure to store
    742756    //  editable data of all USB filters while the dialog is open.
    743     wstUSBFilters = new QWidgetStack (grbUSBFilters, "wstUSBFilters");
    744     grbUSBFiltersLayout->addWidget (wstUSBFilters);
     757    wstUSBFilters = new Q3WidgetStack (grbUSBFilters, "wstUSBFilters");
     758#warning port me
     759//    grbUSBFiltersLayout->addWidget (wstUSBFilters);
    745760    /* create a default (disabled) filter settings widget at index 0 */
    746761    VBoxUSBFilterSettings *settings = new VBoxUSBFilterSettings (wstUSBFilters);
     
    766781    /* VRDP Page */
    767782
    768     QWhatsThis::add (static_cast <QWidget *> (grbVRDP->child ("qt_groupbox_checkbox")),
     783    Q3WhatsThis::add (static_cast <QWidget *> (grbVRDP->child ("qt_groupbox_checkbox")),
    769784                     tr ("When checked, the VM will act as a Remote Desktop "
    770785                         "Protocol (RDP) server, allowing remote clients to connect "
     
    786801    /* Shared Folders Page */
    787802
    788     QVBoxLayout* pageFoldersLayout = new QVBoxLayout (pageFolders, 0, 10, "pageFoldersLayout");
     803    Q3VBoxLayout* pageFoldersLayout = new Q3VBoxLayout (pageFolders, 0, 10, "pageFoldersLayout");
    789804    mSharedFolders = new VBoxSharedFoldersSettings (pageFolders, "sharedFolders");
    790805    mSharedFolders->setDialogType (VBoxSharedFoldersSettings::MachineType);
     
    840855    setTabOrder (tbwGeneral, tblBootOrder);
    841856    setTabOrder (tblBootOrder->focusProxy(), chbEnableACPI);
    842     groupBox12Layout->addWidget (tblBootOrder);
     857#warning port me
     858//    groupBox12Layout->addWidget (tblBootOrder);
    843859    tblBootOrder->fixTabStops();
    844860    /* Shared Clipboard mode */
     
    905921QString VBoxVMSettingsDlg::pagePath (QWidget *aPage)
    906922{
    907     QListViewItem *li = listView->
     923    Q3ListViewItem *li = listView->
    908924        findItem (QString::number (widgetStack->id (aPage)), 1);
    909925    return ::path (li);
     
    12411257
    12421258
    1243 QString VBoxVMSettingsDlg::getHdInfo (QGroupBox *aGroupBox, QUuid aId)
     1259QString VBoxVMSettingsDlg::getHdInfo (Q3GroupBox *aGroupBox, QUuid aId)
    12441260{
    12451261    QString notAttached = tr ("<not attached>", "hard disk");
     
    12631279    else
    12641280    {
    1265         widget = focusData()->focusWidget();
     1281#warning port me
     1282//        widget = focusData()->focusWidget();
    12661283    }
    12671284    /* if the given widget lacks the whats'this text, look at its parent */
    12681285    while (widget && widget != this)
    12691286    {
    1270         text = QWhatsThis::textFor (widget);
     1287#warning port me
     1288//        text = Q3WhatsThis::textFor (widget);
    12711289        if (!text.isEmpty())
    12721290            break;
     
    12741292    }
    12751293
    1276     if (text.isEmpty() && !warningString.isEmpty())
    1277         text = warningString;
    1278     if (text.isEmpty())
    1279         text = QWhatsThis::textFor (this);
     1294#warning port me
     1295//    if (text.isEmpty() && !warningString.isEmpty())
     1296//        text = warningString;
     1297//    if (text.isEmpty())
     1298//        text = Q3WhatsThis::textFor (this);
    12801299
    12811300    whatsThisLabel->setText (text);
     
    13161335    {
    13171336        /* search for a list view item corresponding to the category */
    1318         QListViewItem *item = listView->findItem (aCategory, listView_Link);
     1337        Q3ListViewItem *item = listView->findItem (aCategory, listView_Link);
    13191338        if (item)
    13201339        {
     
    13281347                {
    13291348                    QWidget *w = static_cast <QWidget *> (obj);
    1330                     QWidgetList parents;
     1349                    Q3PtrList<QWidget> parents;
    13311350                    QWidget *p = w;
    13321351                    while ((p = p->parentWidget()) != NULL)
     
    13521371}
    13531372
    1354 void VBoxVMSettingsDlg::listView_currentChanged (QListViewItem *item)
     1373void VBoxVMSettingsDlg::listView_currentChanged (Q3ListViewItem *item)
    13551374{
    13561375    Assert (item);
     
    13751394    bool newValid = true;
    13761395    {
    1377         QObjectList *l = this->queryList ("QIWidgetValidator");
    1378         QObjectListIt it (*l);
    1379         QObject *obj;
    1380         while ((obj = it.current()) != 0)
     1396        QObjectList l = this->queryList ("QIWidgetValidator");
     1397        foreach(QObject *obj, l)
    13811398        {
    13821399            QIWidgetValidator *wval = (QIWidgetValidator *) obj;
     
    13871404                break;
    13881405            }
    1389             ++ it;
    1390         }
    1391         delete l;
     1406        }
    13921407    }
    13931408
     
    14231438        valid = true;
    14241439
    1425         QValueList <QUuid> uuids;
     1440        Q3ValueList <QUuid> uuids;
    14261441
    14271442        if (valid && grbHDA->isChecked())
     
    15521567    {
    15531568        valid = true;
    1554         QValueList <QString> ports;
    1555         QValueList <QString> paths;
     1569        Q3ValueList <QString> ports;
     1570        Q3ValueList <QString> paths;
    15561571
    15571572        int index = 0;
     
    15971612    {
    15981613        valid = true;
    1599         QValueList <QString> ports;
    1600         QValueList <QString> paths;
     1614        Q3ValueList <QString> ports;
     1615        Q3ValueList <QString> paths;
    16011616
    16021617        int index = 0;
     
    17061721            LONG dev;
    17071722            struct {
    1708                 QGroupBox *grb;
     1723                Q3GroupBox *grb;
    17091724                QComboBox *cbb;
    17101725                QLabel *tx;
     
    19461961             * not available (i.e. in VirtualBox OSE) */
    19471962
    1948             QListViewItem *usbItem = listView->findItem ("#usb", listView_Link);
     1963            Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link);
    19491964            Assert (usbItem);
    19501965            if (usbItem)
     
    19801995             * not available (i.e. in VirtualBox OSE) */
    19811996
    1982             QListViewItem *vrdpItem = listView->findItem ("#vrdp", listView_Link);
     1997            Q3ListViewItem *vrdpItem = listView->findItem ("#vrdp", listView_Link);
    19831998            Assert (vrdpItem);
    19841999            if (vrdpItem)
     
    20542069    /* VT-x/AMD-V */
    20552070    cmachine.SetHWVirtExEnabled (
    2056         chbVTX->state() == QButton::Off ? KTSBool_False :
    2057         chbVTX->state() == QButton::On ? KTSBool_True : KTSBool_Default);
     2071        chbVTX->state() == QCheckBox::Off ? KTSBool_False :
     2072        chbVTX->state() == QCheckBox::On ? KTSBool_True : KTSBool_Default);
    20582073
    20592074    /* Saved state folder */
     
    20892104            LONG dev;
    20902105            struct {
    2091                 QGroupBox *grb;
     2106                Q3GroupBox *grb;
    20922107                QUuid *uuid;
    20932108            } data;
     
    22562271
    22572272            /* then add all new filters */
    2258             for (QListViewItem *item = lvUSBFilters->firstChild(); item;
     2273            for (Q3ListViewItem *item = lvUSBFilters->firstChild(); item;
    22592274                 item = item->nextSibling())
    22602275            {
     
    23202335
    23212336    VBoxDiskImageManagerDlg dlg (this, "VBoxDiskImageManagerDlg",
    2322                                  WType_Dialog | WShowModal);
     2337                                 Qt::WType_Dialog | Qt::WShowModal);
    23232338    QUuid machineId = cmachine.GetId();
    23242339    QUuid hdId = type == VBoxDefs::HD ? cbb->getId() : QUuid();
     
    25672582void VBoxVMSettingsDlg::addUSBFilter (const CUSBDeviceFilter &aFilter, bool isNew)
    25682583{
    2569     QListViewItem *currentItem = isNew
     2584    Q3ListViewItem *currentItem = isNew
    25702585        ? lvUSBFilters->currentItem()
    25712586        : lvUSBFilters->lastItem();
     
    26062621}
    26072622
    2608 void VBoxVMSettingsDlg::lvUSBFilters_currentChanged (QListViewItem *item)
     2623void VBoxVMSettingsDlg::lvUSBFilters_currentChanged (Q3ListViewItem *item)
    26092624{
    26102625    if (item && lvUSBFilters->selectedItem() != item)
     
    26302645void VBoxVMSettingsDlg::lvUSBFilters_setCurrentText (const QString &aText)
    26312646{
    2632     QListViewItem *item = lvUSBFilters->currentItem();
     2647    Q3ListViewItem *item = lvUSBFilters->currentItem();
    26332648    Assert (item);
    26342649
     
    26422657    QString usbFilterName = tr ("New Filter %1", "usb");
    26432658    QRegExp regExp (QString ("^") + usbFilterName.arg ("([0-9]+)") + QString ("$"));
    2644     QListViewItemIterator iterator (lvUSBFilters);
     2659    Q3ListViewItemIterator iterator (lvUSBFilters);
    26452660    while (*iterator)
    26462661    {
     
    27022717void VBoxVMSettingsDlg::tbRemoveUSBFilter_clicked()
    27032718{
    2704     QListViewItem *item = lvUSBFilters->currentItem();
     2719    Q3ListViewItem *item = lvUSBFilters->currentItem();
    27052720    Assert (item);
    27062721
     
    27192734void VBoxVMSettingsDlg::tbUSBFilterUp_clicked()
    27202735{
    2721     QListViewItem *item = lvUSBFilters->currentItem();
     2736    Q3ListViewItem *item = lvUSBFilters->currentItem();
    27222737    Assert (item);
    27232738
    2724     QListViewItem *itemAbove = item->itemAbove();
     2739    Q3ListViewItem *itemAbove = item->itemAbove();
    27252740    Assert (itemAbove);
    27262741    itemAbove = itemAbove->itemAbove();
     
    27402755void VBoxVMSettingsDlg::tbUSBFilterDown_clicked()
    27412756{
    2742     QListViewItem *item = lvUSBFilters->currentItem();
     2757    Q3ListViewItem *item = lvUSBFilters->currentItem();
    27432758    Assert (item);
    27442759
    2745     QListViewItem *itemBelow = item->itemBelow();
     2760    Q3ListViewItem *itemBelow = item->itemBelow();
    27462761    Assert (itemBelow);
    27472762
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette