Changeset 99177 in vbox for trunk/src/VBox
- Timestamp:
- Mar 24, 2023 3:46:06 PM (22 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.cpp
r98103 r99177 71 71 void QILineEdit::setMinimumWidthByText(const QString &strText) 72 72 { 73 setMinimumWidth(f eatTextWidth(strText).width());73 setMinimumWidth(fitTextWidth(strText).width()); 74 74 } 75 75 76 76 void QILineEdit::setFixedWidthByText(const QString &strText) 77 77 { 78 setFixedWidth(f eatTextWidth(strText).width());78 setFixedWidth(fitTextWidth(strText).width()); 79 79 } 80 80 … … 174 174 } 175 175 176 QSize QILineEdit::f eatTextWidth(const QString &strText) const176 QSize QILineEdit::fitTextWidth(const QString &strText) const 177 177 { 178 178 QStyleOptionFrame sof; -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.h
r98103 r99177 84 84 85 85 /** Calculates suitable @a strText size. */ 86 QSize f eatTextWidth(const QString &strText) const;86 QSize fitTextWidth(const QString &strText) const; 87 87 88 88 /** Holds whether this is allowed to copy contents when disabled. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIUSBFilterDetailsEditor.cpp
r99066 r99177 30 30 #include <QGridLayout> 31 31 #include <QLabel> 32 #include <QLineEdit>33 32 #include <QRegularExpressionValidator> 34 33 35 34 /* GUI includes: */ 36 35 #include "QIDialogButtonBox.h" 36 #include "QILineEdit.h" 37 37 #include "UIConverter.h" 38 38 #include "UIUSBFilterDetailsEditor.h" … … 245 245 /* Adjust dialog size: */ 246 246 adjustSize(); 247 248 #ifdef VBOX_WS_MAC249 setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);250 setFixedSize(minimumSize());251 #endif /* VBOX_WS_MAC */252 247 } 253 248 … … 268 263 } 269 264 /* Prepare name editor: */ 270 m_pEditorName = new Q LineEdit(this);265 m_pEditorName = new QILineEdit(this); 271 266 if (m_pEditorName) 272 267 { 273 268 if (m_pLabelName) 274 269 m_pLabelName->setBuddy(m_pEditorName); 270 m_pEditorName->setMinimumWidthByText(QString().fill('0', 32)); 275 271 m_pEditorName->setValidator(new QRegularExpressionValidator(QRegularExpression(".+"), this)); 276 277 272 pLayout->addWidget(m_pEditorName, 0, 1); 278 273 } … … 286 281 } 287 282 /* Prepare vendor ID editor: */ 288 m_pEditorVendorID = new Q LineEdit(this);283 m_pEditorVendorID = new QILineEdit(this); 289 284 if (m_pEditorVendorID) 290 285 { 291 286 if (m_pLabelVendorID) 292 287 m_pLabelVendorID->setBuddy(m_pEditorVendorID); 288 m_pEditorVendorID->setMinimumWidthByText(QString().fill('0', 8)); 293 289 m_pEditorVendorID->setValidator(new QRegularExpressionValidator(QRegularExpression("[0-9a-fA-F]{0,4}"), this)); 294 295 290 pLayout->addWidget(m_pEditorVendorID, 1, 1); 296 291 } … … 304 299 } 305 300 /* Prepare product ID editor: */ 306 m_pEditorProductID = new Q LineEdit(this);301 m_pEditorProductID = new QILineEdit(this); 307 302 if (m_pEditorProductID) 308 303 { 309 304 if (m_pLabelProductID) 310 305 m_pLabelProductID->setBuddy(m_pEditorProductID); 306 m_pEditorProductID->setMinimumWidthByText(QString().fill('0', 8)); 311 307 m_pEditorProductID->setValidator(new QRegularExpressionValidator(QRegularExpression("[0-9a-fA-F]{0,4}"), this)); 312 313 308 pLayout->addWidget(m_pEditorProductID, 2, 1); 314 309 } … … 322 317 } 323 318 /* Prepare revision editor: */ 324 m_pEditorRevision = new Q LineEdit(this);319 m_pEditorRevision = new QILineEdit(this); 325 320 if (m_pEditorRevision) 326 321 { 327 322 if (m_pLabelRevision) 328 323 m_pLabelRevision->setBuddy(m_pEditorRevision); 324 m_pEditorRevision->setMinimumWidthByText(QString().fill('0', 8)); 329 325 m_pEditorRevision->setValidator(new QRegularExpressionValidator(QRegularExpression("[0-9a-fA-F]{0,4}"), this)); 330 331 326 pLayout->addWidget(m_pEditorRevision, 3, 1); 332 327 } … … 340 335 } 341 336 /* Prepare manufacturer editor: */ 342 m_pEditorManufacturer = new Q LineEdit(this);337 m_pEditorManufacturer = new QILineEdit(this); 343 338 if (m_pEditorManufacturer) 344 339 { 345 340 if (m_pLabelManufacturer) 346 341 m_pLabelManufacturer->setBuddy(m_pEditorManufacturer); 342 m_pEditorManufacturer->setMinimumWidthByText(QString().fill('0', 8)); 347 343 pLayout->addWidget(m_pEditorManufacturer, 4, 1); 348 344 } … … 356 352 } 357 353 /* Prepare product editor: */ 358 m_pEditorProduct = new Q LineEdit(this);354 m_pEditorProduct = new QILineEdit(this); 359 355 if (m_pEditorProduct) 360 356 { 361 357 if (m_pLabelProduct) 362 358 m_pLabelProduct->setBuddy(m_pEditorProduct); 359 m_pEditorProduct->setMinimumWidthByText(QString().fill('0', 8)); 363 360 pLayout->addWidget(m_pEditorProduct, 5, 1); 364 361 } … … 372 369 } 373 370 /* Prepare serial NO editor: */ 374 m_pEditorSerialNo = new Q LineEdit(this);371 m_pEditorSerialNo = new QILineEdit(this); 375 372 if (m_pEditorSerialNo) 376 373 { 377 374 if (m_pLabelSerialNo) 378 375 m_pLabelSerialNo->setBuddy(m_pEditorSerialNo); 376 m_pEditorSerialNo->setMinimumWidthByText(QString().fill('0', 8)); 379 377 pLayout->addWidget(m_pEditorSerialNo, 6, 1); 380 378 } … … 388 386 } 389 387 /* Prepare port editor: */ 390 m_pEditorPort = new Q LineEdit(this);388 m_pEditorPort = new QILineEdit(this); 391 389 if (m_pEditorPort) 392 390 { 393 391 if (m_pLabelPort) 394 392 m_pLabelPort->setBuddy(m_pEditorPort); 393 m_pEditorPort->setMinimumWidthByText(QString().fill('0', 8)); 395 394 m_pEditorPort->setValidator(new QRegularExpressionValidator(QRegularExpression("(0[xX])?[0-9a-fA-F]{0,4}"), this)); 396 397 395 pLayout->addWidget(m_pEditorPort, 7, 1); 398 396 } … … 414 412 m_pComboRemote->addItem(QString(), QVariant::fromValue(UIRemoteMode_On)); /* Yes */ 415 413 m_pComboRemote->addItem(QString(), QVariant::fromValue(UIRemoteMode_Off)); /* No */ 416 417 414 pLayout->addWidget(m_pComboRemote, 8, 1); 418 415 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIUSBFilterDetailsEditor.h
r98103 r99177 39 39 class QComboBox; 40 40 class QLabel; 41 class QLineEdit;42 41 class QIDialogButtonBox; 42 class QILineEdit; 43 43 44 44 /** QIDialog subclass used as a USB filter editor. */ … … 119 119 QLabel *m_pLabelName; 120 120 /** Holds the name editor instance. */ 121 Q LineEdit*m_pEditorName;121 QILineEdit *m_pEditorName; 122 122 /** Holds the vendor ID label instance. */ 123 123 QLabel *m_pLabelVendorID; 124 124 /** Holds the vendor ID editor instance. */ 125 Q LineEdit*m_pEditorVendorID;125 QILineEdit *m_pEditorVendorID; 126 126 /** Holds the product ID label instance. */ 127 127 QLabel *m_pLabelProductID; 128 128 /** Holds the product ID editor instance. */ 129 Q LineEdit*m_pEditorProductID;129 QILineEdit *m_pEditorProductID; 130 130 /** Holds the revision label instance. */ 131 131 QLabel *m_pLabelRevision; 132 132 /** Holds the revision editor instance. */ 133 Q LineEdit*m_pEditorRevision;133 QILineEdit *m_pEditorRevision; 134 134 /** Holds the manufacturer label instance. */ 135 135 QLabel *m_pLabelManufacturer; 136 136 /** Holds the manufacturer editor instance. */ 137 Q LineEdit*m_pEditorManufacturer;137 QILineEdit *m_pEditorManufacturer; 138 138 /** Holds the product label instance. */ 139 139 QLabel *m_pLabelProduct; 140 140 /** Holds the product editor instance. */ 141 Q LineEdit*m_pEditorProduct;141 QILineEdit *m_pEditorProduct; 142 142 /** Holds the serial NO label instance. */ 143 143 QLabel *m_pLabelSerialNo; 144 144 /** Holds the serial NO editor instance. */ 145 Q LineEdit*m_pEditorSerialNo;145 QILineEdit *m_pEditorSerialNo; 146 146 /** Holds the port label instance. */ 147 147 QLabel *m_pLabelPort; 148 148 /** Holds the port editor instance. */ 149 Q LineEdit*m_pEditorPort;149 QILineEdit *m_pEditorPort; 150 150 /** Holds the remote label instance. */ 151 151 QLabel *m_pLabelRemote;
Note:
See TracChangeset
for help on using the changeset viewer.