Changeset 64080 in vbox
- Timestamp:
- Sep 28, 2016 1:12:04 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111016
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSelector.cpp
r64058 r64080 37 37 38 38 39 /** Tree-widget column categories. */39 /** Tree-widget column sections. */ 40 40 enum 41 41 { … … 51 51 public: 52 52 53 /** Constructs selector item. 54 * @param aIcon Brings the item icon. 55 * @param aText Brings the item text. 56 * @param aId Brings the item ID. 57 * @param aLink Brings the item link. 58 * @param aPage Brings the item page reference. 59 * @param aParentId Brings the item parent ID. */ 53 60 SelectorItem (const QIcon &aIcon, const QString &aText, int aId, const QString &aLink, UISettingsPage* aPage, int aParentId) 54 61 : mIcon (aIcon) … … 60 67 {} 61 68 69 /** Returns the item icon. */ 62 70 QIcon icon() const { return mIcon; } 71 /** Returns the item text. */ 63 72 QString text() const { return mText; } 73 /** Defines the item @s strText. */ 64 74 void setText (const QString &aText) { mText = aText; } 75 /** Returns the item ID. */ 65 76 int id() const { return mId; } 77 /** Returns the item link. */ 66 78 QString link() const { return mLink; } 79 /** Returns the item page reference. */ 67 80 UISettingsPage *page() const { return mPage; } 81 /** Returns the item parent ID. */ 68 82 int parentId() const { return mParentId; } 69 83 70 84 protected: 71 85 86 /** Holds the item icon. */ 72 87 QIcon mIcon; 88 /** Holds the item text. */ 73 89 QString mText; 90 /** Holds the item ID. */ 74 91 int mId; 92 /** Holds the item link. */ 75 93 QString mLink; 94 /** Holds the item page reference. */ 76 95 UISettingsPage* mPage; 96 /** Holds the item parent ID. */ 77 97 int mParentId; 78 98 }; … … 194 214 { 195 215 mTwSelector = new QITreeWidget (aParent); 196 /* Configure the selector */216 /* Configure the selector: */ 197 217 QSizePolicy sizePolicy (QSizePolicy::Minimum, QSizePolicy::Expanding); 198 218 sizePolicy.setHorizontalStretch (0); … … 207 227 mTwSelector->setUniformRowHeights (true); 208 228 mTwSelector->setIconSize(QSize((int)(1.5 * iIconMetric), (int)(1.5 * iIconMetric))); 209 /* Add the columns */229 /* Add the columns: */ 210 230 mTwSelector->headerItem()->setText (treeWidget_Category, "Category"); 211 231 mTwSelector->headerItem()->setText (treeWidget_Id, "[id]"); 212 232 mTwSelector->headerItem()->setText (treeWidget_Link, "[link]"); 213 /* Hide unnecessary columns and header */233 /* Hide unnecessary columns and header: */ 214 234 mTwSelector->header()->hide(); 215 235 mTwSelector->hideColumn (treeWidget_Id); 216 236 mTwSelector->hideColumn (treeWidget_Link); 217 /* Setup connections */237 /* Setup connections: */ 218 238 connect (mTwSelector, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)), 219 239 this, SLOT (settingsGroupChanged (QTreeWidgetItem *, QTreeWidgetItem*))); … … 373 393 public: 374 394 395 /** Constructs selector item. 396 * @param aIcon Brings the item icon. 397 * @param aText Brings the item text. 398 * @param aId Brings the item ID. 399 * @param aLink Brings the item link. 400 * @param aPage Brings the item page reference. 401 * @param aParentId Brings the item parent ID. 402 * @param aParent Brings the item parent. */ 375 403 SelectorActionItem (const QIcon &aIcon, const QString &aText, int aId, const QString &aLink, UISettingsPage* aPage, int aParentId, QObject *aParent) 376 404 : SelectorItem (aIcon, aText, aId, aLink, aPage, aParentId) … … 381 409 } 382 410 411 /** Returns the action instance. */ 383 412 QAction *action() const { return mAction; } 384 413 414 /** Defines the @a pTabWidget instance. */ 385 415 void setTabWidget (QTabWidget *aTabWidget) { mTabWidget = aTabWidget; } 416 /** Returns the tab-widget instance. */ 386 417 QTabWidget *tabWidget() const { return mTabWidget; } 387 418 388 419 protected: 389 420 421 /** Holds the action instance. */ 390 422 QAction *mAction; 423 /** Holds the tab-widget instance. */ 391 424 QTabWidget *mTabWidget; 392 425 }; … … 396 429 : UISettingsSelector (aParent) 397 430 { 398 /* Init the toolbar */431 /* Init the toolbar: */ 399 432 mTbSelector = new UIToolBar (aParent); 400 433 mTbSelector->setUseTextLabels (true); … … 403 436 mTbSelector->setShowToolBarButton (false); 404 437 #endif /* VBOX_WS_MAC */ 405 /* Init the action group for house keeping */438 /* Init the action group for house keeping: */ 406 439 mActionGroup = new QActionGroup (this); 407 440 mActionGroup->setExclusive (true); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSelector.h
r64058 r64080 103 103 signals: 104 104 105 /** Notifies listeners about selector sectionchanged. */106 void categoryChanged (int );105 /** Notifies listeners about selector @a iCategory changed. */ 106 void categoryChanged (int iCategory); 107 107 108 108 protected: … … 186 186 QString idToString (int aId) const; 187 187 188 /** Holds the tree-widget selectorinstance. */188 /** Holds the tree-widget instance. */ 189 189 QITreeWidget *mTwSelector; 190 190 };
Note:
See TracChangeset
for help on using the changeset viewer.