Changeset 12180 in vbox for trunk/src/VBox
- Timestamp:
- Sep 6, 2008 6:31:18 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 36146
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/Makefile.kmk
r12175 r12180 81 81 82 82 # 83 # Debugger GUI component .83 # Debugger GUI component (Qt3). 84 84 # 85 VBoxDbg3_TEMPLATE = VBOXQTGUI 85 86 USES += qt3 86 VBoxDbg3_TEMPLATE = VBOXQTGUI87 87 VBoxDbg3_USES = qt3 88 88 VBoxDbg3_QTTOOL = QT3 … … 107 107 108 108 # 109 # The VBoxDbg3 testcase. 109 # Debugger GUI component (Qt4). 110 # 111 DLLS += VBoxDbg 112 VBoxDbg_TEMPLATE = VBOXQT4GUI 113 VBoxDbg_DEFS = IN_DBG_R3 VBOXDBG_USE_QT4 114 VBoxDbg_INCS = . 115 VBoxDbg_QT_MODULES = Core Gui 116 VBoxDbg_QT_MOCHDRS = \ 117 VBoxDbgGui.h \ 118 VBoxDbgConsole.h 119 # VBoxDbgStats.h 120 VBoxDbg_SOURCES = \ 121 VBoxDbg.cpp \ 122 VBoxDbgGui.cpp \ 123 VBoxDbgBase.cpp \ 124 VBoxDbgConsole.cpp 125 # VBoxDbgStats.cpp 126 VBoxDbg_LIBS = \ 127 $(LIB_VMM) 128 VBoxDbg_LDFLAGS.darwin = \ 129 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxDbg.dylib 130 131 132 # 133 # The VBoxDbg testcase (Qt3). 110 134 # 111 135 tstVBoxDbg3_TEMPLATE = VBOXQTGUIEXE … … 118 142 ifeq ($(KBUILD_TARGET),win) 119 143 tstVBoxDbg3_LIBS += \ 120 $(PATH_LIB)/VBoxDbg 3.lib144 $(PATH_LIB)/VBoxDbg.lib 121 145 else 122 146 tstVBoxDbg3_LIBS += \ 123 $(PATH_BIN)/VBoxDbg3$(VBOX_SUFF_DLL) 147 $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL) 148 endif 149 150 # 151 # The VBoxDbg testcase (Qt4). 152 # 153 #PROGRAMS += tstVBoxDbg 154 tstVBoxDbg_TEMPLATE = VBOXQTGUI4EXE 155 tstVBoxDbg_USES = qt4 156 tstVBoxDbg_QTTOOL = QT4 157 tstVBoxDbg_QT_MODULES = Core Gui 158 tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp 159 tstVBoxDbg_LIBS = \ 160 $(LIB_VMM) \ 161 $(LIB_RUNTIME) 162 ifeq ($(KBUILD_TARGET),win) 163 tstVBoxDbg_LIBS += \ 164 $(PATH_LIB)/VBoxDbg.lib 165 else 166 tstVBoxDbg_LIBS += \ 167 $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL) 124 168 endif 125 169 -
trunk/src/VBox/Debugger/VBoxDbgConsole.cpp
r9268 r12180 26 26 #include "VBoxDbgConsole.h" 27 27 28 #include <qlabel.h> 29 #include <qapplication.h> 30 #include <qfont.h> 31 #include <qtextview.h> 32 #include <qlineedit.h> 28 #ifdef VBOXDBG_USE_QT4 29 # include <QLabel> 30 # include <QApplication> 31 # include <QFont> 32 # include <QLineEdit> 33 # include <QHBoxLayout> 34 #else 35 # include <qlabel.h> 36 # include <qapplication.h> 37 # include <qfont.h> 38 # include <qtextview.h> 39 # include <qlineedit.h> 40 #endif 33 41 34 42 #include <VBox/dbg.h> … … 58 66 59 67 VBoxDbgConsoleOutput::VBoxDbgConsoleOutput(QWidget *pParent/* = NULL*/, const char *pszName/* = NULL*/) 60 : QTextEdit(pParent, pszName), m_uCurLine(0), m_uCurPos(0), m_hGUIThread(RTThreadNativeSelf()) 68 #ifdef VBOXDBG_USE_QT4 69 : QTextEdit(pParent), 70 #else 71 : QTextEdit(pParent, pszName), 72 #endif 73 m_uCurLine(0), m_uCurPos(0), m_hGUIThread(RTThreadNativeSelf()) 61 74 { 62 75 setReadOnly(true); 63 76 setUndoRedoEnabled(false); 64 77 setOverwriteMode(true); 78 #ifdef VBOXDBG_USE_QT4 79 setPlainText(""); 80 #else 65 81 setTextFormat(PlainText); /* minimal HTML: setTextFormat(LogText); */ 82 #endif 66 83 67 84 #ifdef Q_WS_MAC … … 76 93 77 94 /* green on black */ 95 #ifdef VBOXDBG_USE_QT4 96 QPalette Pal(palette()); 97 Pal.setColor(QPalette::Active, QPalette::Base, QColor(Qt::black)); 98 setPalette(Pal); 99 setTextColor(QColor(qRgb(0, 0xe0, 0))); 100 #else 78 101 setPaper(QBrush(Qt::black)); 79 102 setColor(QColor(qRgb(0, 0xe0, 0))); 103 #endif 104 NOREF(pszName); 80 105 } 81 106 … … 99 124 while (iPos < cch) 100 125 { 126 #ifdef VBOXDBG_USE_QT4 127 int iPosNL = rStr.indexOf('\n', iPos); 128 #else 101 129 int iPosNL = rStr.find('\n', iPos); 130 #endif 102 131 int iPosEnd = iPosNL >= 0 ? iPosNL : cch; 103 132 if ((unsigned)iPosNL != iPos) … … 107 136 append(Str); 108 137 else 138 #ifdef VBOXDBG_USE_QT4 139 insertPlainText(Str); 140 #else 109 141 insertAt(Str, m_uCurLine, m_uCurPos); 142 #endif 110 143 if (iPosNL >= 0) 111 144 { … … 140 173 141 174 VBoxDbgConsoleInput::VBoxDbgConsoleInput(QWidget *pParent/* = NULL*/, const char *pszName/* = NULL*/) 142 : QComboBox(true, pParent, pszName), m_iBlankItem(0), m_hGUIThread(RTThreadNativeSelf()) 143 { 175 #ifdef VBOXDBG_USE_QT4 176 : QComboBox(pParent), 177 #else 178 : QComboBox(true, pParent, pszName), 179 #endif 180 m_iBlankItem(0), m_hGUIThread(RTThreadNativeSelf()) 181 { 182 #ifdef VBOXDBG_USE_QT4 183 insertItem(m_iBlankItem, ""); 184 setEditable(true); 185 setInsertPolicy(NoInsert); 186 #else 144 187 insertItem("", m_iBlankItem); 145 188 setInsertionPolicy(NoInsertion); 189 #endif 146 190 setMaxCount(50); 147 191 const QLineEdit *pEdit = lineEdit(); 148 192 if (pEdit) 149 193 connect(pEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); 194 195 NOREF(pszName); 150 196 } 151 197 … … 171 217 172 218 /* update the history and clear the entry field */ 219 #ifdef VBOXDBG_USE_QT4 220 if (itemText(m_iBlankItem - 1) != Str) 221 { 222 setItemText(m_iBlankItem, Str); 223 removeItem(m_iBlankItem - maxCount() - 1); 224 insertItem(++m_iBlankItem, ""); 225 } 226 227 clearEditText(); 228 setCurrentIndex(m_iBlankItem); 229 #else 173 230 if (text(m_iBlankItem - 1) != Str) 174 231 { … … 180 237 clearEdit(); 181 238 setCurrentItem(m_iBlankItem); 239 #endif 182 240 } 183 241 … … 203 261 m_pTimer(NULL), m_fUpdatePending(false), m_Thread(NIL_RTTHREAD), m_EventSem(NIL_RTSEMEVENT), m_fTerminate(false) 204 262 { 263 #ifdef VBOXDBG_USE_QT4 264 setWindowTitle("VBoxDbg - Console"); 265 #else 205 266 setCaption("VBoxDbg - Console"); 267 #endif 206 268 207 269 NOREF(pszName); … … 214 276 215 277 /* try figure a suitable size */ 216 QLabel *pLabel = new QLabel(NULL, "11111111111111111111111111111111111111111111111111111111111111111111111111111112222222222", this); 278 #ifdef VBOXDBG_USE_QT4 279 QLabel *pLabel = new QLabel( "11111111111111111111111111111111111111111111111111111111111111111111111111111112222222222", this); 280 #else 281 QLabel *pLabel = new QLabel(NULL, "11111111111111111111111111111111111111111111111111111111111111111111111111111112222222222", this); /// @todo 282 #endif 217 283 pLabel->setFont(m_pOutput->font()); 218 284 QSize Size = pLabel->sizeHint(); … … 225 291 * Create the input combo box (with a label). 226 292 */ 293 #ifdef VBOXDBG_USE_QT4 294 QHBoxLayout *pLayout = new QHBoxLayout(); 295 //pLayout->setSizeConstraint(QLayout::SetMaximumSize); 296 297 pLabel = new QLabel(" Command "); 298 pLayout->addWidget(pLabel); 299 pLabel->setMaximumSize(pLabel->sizeHint()); 300 pLabel->setAlignment(Qt::AlignCenter); 301 302 m_pInput = new VBoxDbgConsoleInput(NULL); 303 pLayout->addWidget(m_pInput); 304 m_pInput->setDuplicatesEnabled(false); 305 connect(m_pInput, SIGNAL(commandSubmitted(const QString &)), this, SLOT(commandSubmitted(const QString &))); 306 307 # if 0//def Q_WS_MAC 308 pLabel = new QLabel(" "); 309 pLayout->addWidget(pLabel); 310 pLabel->setMaximumSize(20, m_pInput->sizeHint().height() + 6); 311 pLabel->setMinimumSize(20, m_pInput->sizeHint().height() + 6); 312 # endif 313 314 QWidget *pHBox = new QWidget(this); 315 pHBox->setLayout(pLayout); 316 317 #else /* QT3 */ 227 318 QHBox *pHBox = new QHBox(this); 228 319 … … 235 326 connect(m_pInput, SIGNAL(commandSubmitted(const QString &)), this, SLOT(commandSubmitted(const QString &))); 236 327 237 # ifdef Q_WS_MAC238 pLabel = new QLabel(NULL, " ", pHBox); 328 # ifdef Q_WS_MAC 329 pLabel = new QLabel(NULL, " ", pHBox); /// @todo 239 330 pLabel->setMaximumSize(20, m_pInput->sizeHint().height() + 6); 240 331 pLabel->setMinimumSize(20, m_pInput->sizeHint().height() + 6); 241 #endif 332 # endif 333 #endif /* QT3 */ 334 335 #ifdef VBOXDBG_USE_QT4 336 /* 337 * Vertical layout box on the whole widget. 338 */ 339 QVBoxLayout *pVLayout = new QVBoxLayout; 340 pVLayout->setSpacing(5); 341 pVLayout->setContentsMargins(0, 0, 0, 0); 342 pVLayout->addWidget(m_pOutput); 343 pVLayout->addWidget(pHBox); 344 setLayout(pVLayout); 345 #endif 242 346 243 347 /* … … 317 421 RTSemEventSignal(m_EventSem); 318 422 423 #ifdef VBOXDBG_USE_QT4 424 QByteArray Utf8Array = rCommand.toUtf8(); 425 const char *psz = Utf8Array.constData(); 426 #else 319 427 const char *psz = rCommand;//.utf8(); 428 #endif 320 429 size_t cb = strlen(psz); 321 430 … … 344 453 345 454 m_pOutput->appendText(rCommand + "\n"); 455 #ifdef VBOXDBG_USE_QT4 456 m_pOutput->ensureCursorVisible(); 457 #else 346 458 m_pOutput->scrollToBottom(); 459 #endif 347 460 348 461 m_fInputRestoreFocus = m_pInput->hasFocus(); /* dirty focus hack */ … … 551 664 { 552 665 m_fUpdatePending = true; 666 #ifdef VBOXDBG_USE_QT4 667 m_pTimer->setSingleShot(true); 668 m_pTimer->start(10); 669 #else 553 670 m_pTimer->start(10, true /* single shot */); 671 #endif 554 672 } 555 673 break; … … 578 696 } 579 697 698 #ifdef VBOXDBG_USE_QT4 699 return QWidget::event(pGenEvent); 700 #else 580 701 return QVBox::event(pGenEvent); 581 } 582 702 #endif 703 } 704 -
trunk/src/VBox/Debugger/VBoxDbgConsole.h
r9269 r12180 25 25 #include "VBoxDbgBase.h" 26 26 27 #include <qtextedit.h> 28 #include <qcombobox.h> 29 #include <qvbox.h> 30 #include <qtimer.h> 27 #ifdef VBOXDBG_USE_QT4 28 # include <QTextEdit> 29 # include <QComboBox> 30 # include <QTimer> 31 # include <QEvent> 32 #else 33 # include <qtextedit.h> 34 # include <qcombobox.h> 35 # include <qvbox.h> 36 # include <qtimer.h> 37 #endif 31 38 32 39 #include <iprt/critsect.h> … … 129 136 * The Debugger Console. 130 137 */ 131 class VBoxDbgConsole : public QVBox, public VBoxDbgBase 138 class VBoxDbgConsole : 139 #ifdef VBOXDBG_USE_QT4 140 public QWidget, 141 #else 142 public QVBox, 143 #endif 144 public VBoxDbgBase 132 145 { 133 146 Q_OBJECT -
trunk/src/VBox/Debugger/VBoxDbgGui.cpp
r9269 r12180 27 27 28 28 #include "VBoxDbgGui.h" 29 #include <qdesktopwidget.h> 30 #include <qapplication.h> 29 #ifdef VBOXDBG_USE_QT4 30 # include <QDesktopWidget> 31 # include <QApplication> 32 #else 33 # include <qdesktopwidget.h> 34 # include <qapplication.h> 35 #endif 31 36 32 37 … … 88 93 { 89 94 95 #ifndef VBOXDBG_USE_QT4 90 96 if (m_pDbgStats) 91 97 { … … 93 99 m_pDbgStats = NULL; 94 100 } 101 #endif 95 102 96 103 if (m_pDbgConsole) … … 130 137 int VBoxDbgGui::showStatistics() 131 138 { 139 #ifndef VBOXDBG_USE_QT4 132 140 if (!m_pDbgStats) 133 141 { … … 137 145 } 138 146 m_pDbgStats->show(); 147 #endif 139 148 return VINF_SUCCESS; 140 149 } … … 142 151 void VBoxDbgGui::repositionStatistics(bool fResize/* = true*/) 143 152 { 153 #ifndef VBOXDBG_USE_QT4 144 154 if (m_pDbgStats) 145 155 { … … 150 160 resizeWidget(m_pDbgStats, m_cxDesktop - m_cx - m_x + m_xDesktop, m_cyDesktop - m_y + m_yDesktop); 151 161 } 162 #endif 152 163 } 153 164 -
trunk/src/VBox/Debugger/VBoxDbgGui.h
r9269 r12180 42 42 class VBoxDbgGui : public QObject 43 43 { 44 Q_OBJECT 44 Q_OBJECT; 45 45 46 46 public: -
trunk/src/VBox/Debugger/VBoxDbgStats.h
r9269 r12180 26 26 #include "VBoxDbgBase.h" 27 27 28 #include <qlistview.h> 29 #include <qvbox.h> 30 #include <qtimer.h> 31 #include <qcombobox.h> 32 #include <qpopupmenu.h> 28 #ifdef VBOXDBG_USE_QT4 29 # include <QTreeWidget> 30 # include <QTimer> 31 # include <QComboBox> 32 # include <QMenu> 33 typedef QMenu QPopupMenu; 34 typedef QTreeWidget QListView; 35 typedef QTreeWidgetItem QListViewItem; 36 #else 37 # include <qlistview.h> 38 # include <qvbox.h> 39 # include <qtimer.h> 40 # include <qcombobox.h> 41 # include <qpopupmenu.h> 42 #endif 33 43 34 44 class VBoxDbgStats; … … 108 118 virtual QString key(int iColumn, bool fAscending) const 109 119 { 120 #ifdef VBOXDBG_USE_QT4 121 /** @todo */ NOREF(iColumn); NOREF(fAscending); 122 return ""; 123 #else 110 124 return QListViewItem::key(iColumn, fAscending); 125 #endif 111 126 } 112 127 … … 238 253 class VBoxDbgStatsView : public QListView, public VBoxDbgBase 239 254 { 240 Q_OBJECT 255 Q_OBJECT; 241 256 242 257 public: 258 #ifdef VBOXDBG_USE_QT4 259 /** @todo */ 260 #else 243 261 /** 244 262 * Creates a VM statistics list view widget. … … 250 268 */ 251 269 VBoxDbgStatsView(PVM pVM, VBoxDbgStats *pParent = NULL, const char *pszName = NULL, WFlags f = 0); 270 #endif 252 271 253 272 /** Destructor. */ … … 354 373 * spinbutton, and the tree view with the statistics. 355 374 */ 356 class VBoxDbgStats : public QVBox, public VBoxDbgBase 375 class VBoxDbgStats : 376 #ifdef VBOXDBG_USE_QT4 377 public QWidget, 378 #else 379 public QVBox, 380 #endif 381 public VBoxDbgBase 357 382 { 358 Q_OBJECT 383 Q_OBJECT; 359 384 360 385 public: 386 #ifdef VBOXDBG_USE_QT4 387 /** 388 * Creates a VM statistics list view widget. 389 * 390 * @param pVM The VM this is hooked up to. 391 * @param pszPat Initial selection pattern. NULL means everything. (See STAM for details.) 392 * @param uRefreshRate The refresh rate. 0 means not to refresh and is the default. 393 * @param pParent Parent widget. 394 */ 395 VBoxDbgStats(PVM pVM, const char *pszPat = NULL, unsigned uRefreshRate= 0, QWidget *pParent = NULL); 396 #else 361 397 /** 362 398 * Creates a VM statistics list view widget. … … 370 406 */ 371 407 VBoxDbgStats(PVM pVM, const char *pszPat = NULL, unsigned uRefreshRate= 0, QWidget *pParent = NULL, const char *pszName = NULL, WFlags f = 0); 408 #endif 372 409 373 410 /** Destructor. */
Note:
See TracChangeset
for help on using the changeset viewer.