Back to index

texmacs  1.0.7.15
Public Member Functions | Private Attributes
QTMTileAction Class Reference

List of all members.

Public Member Functions

 QTMTileAction (QWidget *parent, array< widget > &arr, int _cols)
QWidget * createWidget (QWidget *parent)

Private Attributes

QVector< QAction * > actions
int cols

Detailed Description

Definition at line 176 of file qt_ui_element.cpp.


Constructor & Destructor Documentation

QTMTileAction::QTMTileAction ( QWidget *  parent,
array< widget > &  arr,
int  _cols 
) [inline]

Definition at line 180 of file qt_ui_element.cpp.

  : QWidgetAction (parent), cols (_cols)
  {
    actions.reserve(N(arr));
    for(int i = 0; i < N(arr); i++) {
      if (is_nil(arr[i])) break;
      QAction *act = concrete(arr[i])->as_qaction();
      act->setParent(this);
      actions.append(act);
    };
  }

Here is the call graph for this function:


Member Function Documentation

QWidget * QTMTileAction::createWidget ( QWidget *  parent)

Definition at line 204 of file qt_ui_element.cpp.

                                           {
  if (DEBUG_QT) 
    cout << "QTMTileAction::createWidget\n";
  QWidget* wid= new QTMMenuWidget (parent);
  QGridLayout* l= new QGridLayout (wid);
  // wid->setAutoFillBackground(true);
  // wid->setBackgroundRole(QPalette::Base);
  wid->setLayout (l);
  l->setSizeConstraint (QLayout::SetFixedSize);
  l->setHorizontalSpacing (2);
  l->setVerticalSpacing (2);
  l->setContentsMargins (4, 0, 4, 0);
  int row= 0, col= 0;
  for (int i=0; i < actions.count(); i++) {
    QAction* sa= actions[i];
    QToolButton* tb= new QTMMenuButton (wid);
    tb->setDefaultAction (sa);
    QObject::connect(tb, SIGNAL(released()), this, SLOT(trigger()));
    //  tb->setStyle (qtmstyle ());
    l->addWidget (tb, row, col);
    col++;
    if (col >= cols) { col = 0; row++; }
  }
  return wid;
}

Here is the call graph for this function:


Member Data Documentation

QVector<QAction*> QTMTileAction::actions [private]

Definition at line 177 of file qt_ui_element.cpp.

int QTMTileAction::cols [private]

Definition at line 178 of file qt_ui_element.cpp.


The documentation for this class was generated from the following file: