Back to index

salome-gui  6.5.0
Defines | Functions
SalomeApp_ListView.cxx File Reference
#include "SalomeApp_ListView.h"
#include "SalomeApp_Application.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include <QValidator>
#include <QToolButton>
#include <QPixmap>
#include <QHeaderView>
#include <QKeyEvent>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListOfReal.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfReal.hxx>
#include <qlayout.h>

Go to the source code of this file.

Defines

#define MIN_COMBO_WIDTH   1
#define MIN_EDIT_WIDTH   1

Functions

void computeEditGeometry (SalomeApp_ListViewItem *theItem, SalomeApp_EntityEdit *theWidget)
 Used for resizing editing widget.

Define Documentation

#define MIN_COMBO_WIDTH   1

Definition at line 1043 of file SalomeApp_ListView.cxx.

#define MIN_EDIT_WIDTH   1

Definition at line 1044 of file SalomeApp_ListView.cxx.


Function Documentation

Used for resizing editing widget.

Definition at line 47 of file SalomeApp_ListView.cxx.

{
  if (!theItem)
    return;
  QTreeWidget* aListView = theItem->treeWidget();
  int anEditColumn = theItem->getEditedColumn();
  if (anEditColumn < 0)
    return;

  int aX = 0, aY = 0, aW = 0, aH = 0;

  QRect aRect = aListView->visualItemRect(theItem);
  aX = aListView->header()->sectionViewportPosition(anEditColumn);
  if (aX < 0)
    aX = 0; // THIS CAN BE REMOVED
  QSize aSize = theWidget->getControl()->sizeHint();
  aH = qMax(aSize.height() , aRect.height() );
  aY = aRect.y() - ((aH - aRect.height()) / 2);
  //aW = aListView->columnWidth(anEditColumn); // CAN SUBSTITUTE NEXT 3 ROWS
  aW = aListView->viewport()->width() - aX;
  if (aW < 0)
    aW = 0;
  theWidget->setGeometry(aX, aY, aW, aH);
}

Here is the call graph for this function:

Here is the caller graph for this function: