Back to index

texmacs  1.0.7.15
Public Member Functions | Private Attributes
QTMMinibarAction Class Reference

List of all members.

Public Member Functions

 QTMMinibarAction (QWidget *parent, array< widget > &arr)
QWidget * createWidget (QWidget *parent)

Private Attributes

QVector< QAction * > actions

Detailed Description

Definition at line 230 of file qt_ui_element.cpp.


Constructor & Destructor Documentation

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

Definition at line 233 of file qt_ui_element.cpp.

  : QWidgetAction (parent)
  {
    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 * QTMMinibarAction::createWidget ( QWidget *  parent)

Definition at line 256 of file qt_ui_element.cpp.

                                              {
  if (DEBUG_QT) cout << "QTMMinibarAction::createWidget\n";
  QWidget* wid= new QWidget (parent);
  QBoxLayout* l= new QBoxLayout (QBoxLayout::LeftToRight, wid);
  wid->setLayout (l);
  //  l->setSizeConstraint (QLayout::SetFixedSize);
  l->setContentsMargins (0, 0, 0, 0);
  l->setSpacing(0);
  for (int i=0; i < actions.count(); i++) {
    QAction* sa= actions[i];
    if (QWidgetAction * wa = qobject_cast<QWidgetAction*>(sa)) {
      QWidget *w = wa->requestWidget(wid);
      l->addWidget(w);
    } else if ((sa->text().isNull())&&(sa->icon().isNull())) {
      l->addSpacing(8);
    } else {
      QToolButton *tb = new QToolButton(wid);
      
      //HACK: texmacs does not use the checked state of the action
      // if the action is checkable then it means that it should be
      // checked
      sa->setChecked(sa->isCheckable());
      
      tb->setDefaultAction(sa);
      tb->setAutoRaise(true);
      tb->setPopupMode (QToolButton::InstantPopup);
      tb->setStyle(qtmstyle());
      //  tb->setIconSize(QSize(12,12));
      QFont f = tb->font();
      f.setPixelSize(10);
      tb->setFont(f);
      l->addWidget(tb);
    }
  }
  return wid;
}

Here is the call graph for this function:


Member Data Documentation

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

Definition at line 231 of file qt_ui_element.cpp.


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