Changeset 5030

Show
Ignore:
Timestamp:
07/18/07 18:57:43 (17 months ago)
Author:
flynd
Message:

Changed Qt requirement to 4.3.0. Also removed some code and workarounds for older Qt versions.

Location:
branches/qt-gui_qt4
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/CMakeLists.txt

    r5028 r5030  
    5555 
    5656# Check for Qt4 
    57 set(QT_MIN_VERSION "4.2.1") 
     57set(QT_MIN_VERSION "4.3.0") 
    5858set(QT_USE_QT3SUPPORT TRUE) 
    5959 
  • branches/qt-gui_qt4/src/contactlist/maincontactlistproxy.cpp

    r4932 r5030  
    3838{ 
    3939  m_filterSystemGroups = enable; 
    40 #if QT_VERSION < 0x040300 
    41   // filterChanged() is obsoleted in Qt 4.3 and should be replaced by invalidateFilter() 
    42   filterChanged(); 
    43 #else 
    4440  invalidateFilter(); 
    45 #endif 
    4641} 
    4742 
     
    4944{ 
    5045  m_filterSubGroups = enable; 
    51 #if QT_VERSION < 0x040300 
    52   // filterChanged() is obsoleted in Qt 4.3 and should be replaced by invalidateFilter() 
    53   filterChanged(); 
    54 #else 
    5546  invalidateFilter(); 
    56 #endif 
    5747} 
    5848 
    5949void CMainContactListProxy::configUpdated() 
    6050{ 
    61 #if QT_VERSION < 0x040300 
    62   // filterChanged() is obsoleted in Qt 4.3 and should be replaced by invalidateFilter() 
    63   filterChanged(); 
    64 #else 
    6551  invalidateFilter(); 
    66 #endif 
    6752} 
    6853 
  • branches/qt-gui_qt4/src/contactlist/sortedcontactlistproxy.cpp

    r4924 r5030  
    4545  // The value of m_sortOrder affects the behaviour of our lessThan() method 
    4646  //   so tell QSortFilterProxyModel to forget any cached values from lessThan() 
    47 #if QT_VERSION < 0x040300 
    48   // clear() is obsoleted in Qt 4.3 and should be replaced by invalidate() 
    49   clear(); 
    50 #else 
    5147  invalidate(); 
    52 #endif 
    5348  QSortFilterProxyModel::sort(column, Qt::AscendingOrder); 
    5449} 
  • branches/qt-gui_qt4/src/mainwin.cpp

    r5002 r5030  
    47024702   
    47034703  // The send submenu and misc modes submenu that depend on sending capabilities 
    4704 #if QT_VERSION >= 0x030100 
    47054704#define HIDE_MENU(x, y, z) x->setItemVisible(y, z); 
    4706 #else 
    4707 #define HIDE_MENU(x, y, z) x->setItemEnabled(y, false); 
    4708 #endif 
    47094705 
    47104706  HIDE_MENU(mnuUser, mnuUserSendMsg, nSendFuncs & PP_SEND_MSG) 
  • branches/qt-gui_qt4/src/mledit.cpp

    r5002 r5030  
    6262  GotoEnd(); 
    6363  insert(s); 
    64 } 
    65  
    66 void MLEditWrap::append(const QString& s) 
    67 { 
    68   MLEditWrapBase::append(s); 
    69   if (strcmp(qVersion(), "3.0.0") == 0 || 
    70       strcmp(qVersion(), "3.0.1") == 0 || 
    71       strcmp(qVersion(), "3.0.2") == 0 || 
    72       strcmp(qVersion(), "3.0.3") == 0 || 
    73       strcmp(qVersion(), "3.0.4") == 0) 
    74   { 
    75     // Workaround -- 
    76     // In those versions, QTextEdit::append didn't add a new paragraph. 
    77     MLEditWrapBase::append("\n"); 
    78   } 
    7964} 
    8065 
  • branches/qt-gui_qt4/src/mledit.h

    r5002 r5030  
    5959 
    6060  void appendNoNewLine(const QString& s); 
    61   void append(const QString& s); 
    6261  void GotoEnd(); 
    6362 
  • branches/qt-gui_qt4/src/mlview.cpp

    r5002 r5030  
    3838{ 
    3939  setWordWrap(WidgetWidth); 
    40 #if QT_VERSION >= 0x030100 
    4140  setWrapPolicy(AtWordOrDocumentBoundary); 
    42 #else 
    43   setWrapPolicy(AtWhiteSpace); 
    44 #endif 
    4541  setReadOnly(true); 
    4642  setTextFormat(Qt::RichText); 
     
    5147  int p = paragraphs() - 1; 
    5248  insertAt(s, p, paragraphLength(p)); 
    53 } 
    54  
    55 void MLView::append(const QString& s) 
    56 { 
    57   if (strcmp(qVersion(), "3.0.0") == 0 || 
    58       strcmp(qVersion(), "3.0.1") == 0 || 
    59       strcmp(qVersion(), "3.0.2") == 0 || 
    60       strcmp(qVersion(), "3.0.3") == 0 || 
    61       strcmp(qVersion(), "3.0.4") == 0) 
    62   { 
    63     // Workaround -- 
    64     // In those versions, QTextEdit::append didn't add a new paragraph. 
    65     Q3TextBrowser::append("<p>" + s); 
    66   } 
    67   else 
    68     Q3TextBrowser::append(s); 
    6949} 
    7050 
  • branches/qt-gui_qt4/src/mlview.h

    r5002 r5030  
    3333 
    3434  void appendNoNewLine(const QString& s); 
    35   void append(const QString& s); 
    3635  void GotoHome(); 
    3736  void GotoEnd(); 
  • branches/qt-gui_qt4/src/widgets/tabwidget.cpp

    r5002 r5030  
    6161  e->accept(); 
    6262} 
    63  
    64 #if QT_VERSION < 0x040300 
    65 // tabAt() is added in Qt 4.3 so we have to make our own implementation for QT 4.2 
    66 int CTabBar::tabAt(const QPoint& position) const 
    67 { 
    68   for (int i = 0; i < count(); ++i) 
    69     if (tabRect(i).contains(position)) 
    70       return i; 
    71  
    72   return -1; 
    73 } 
    74 #endif 
    7563 
    7664void CTabBar::mousePressEvent(QMouseEvent* e) 
  • branches/qt-gui_qt4/src/widgets/tabwidget.h

    r5002 r5030  
    4242  virtual void mouseReleaseEvent(QMouseEvent* e); 
    4343 
    44 #if QT_VERSION < 0x040300 
    45   // tabAt is added in Qt 4.3 so we have to make our own implementation for QT 4.2 
    46   int tabAt(const QPoint& position) const; 
    47 #endif 
    48  
    4944  int clickedTab; 
    5045};