Back to index

texmacs  1.0.7.15
Defines | Functions | Variables
qt_tm_widget.cpp File Reference
#include <QtGui>
#include "analyze.hpp"
#include "qt_tm_widget.hpp"
#include "qt_utilities.hpp"
#include "qt_renderer.hpp"
#include "qt_gui.hpp"
#include "qt_basic_widgets.hpp"
#include "qt_simple_widget.hpp"
#include "qt_window_widget.hpp"
#include "QTMWindow.hpp"
#include "QTMStyle.hpp"
#include "QTMGuiHelper.hpp"
#include "QTMInteractivePrompt.hpp"
#include "QTMInteractiveInputHelper.hpp"

Go to the source code of this file.

Defines

#define XOR(exp1, exp2)   (((!exp1) && (exp2)) || ((exp1) && (!exp2)))

Functions

void replaceActions (QWidget *dest, QWidget *src)
void replaceButtons (QToolBar *dest, QWidget *src)
static void tweek_iconbar_size (QSize &sz)

Variables

int menu_count = 0
 Positive means the menu is busy.
list< qt_tm_widget_rep * > waiting_widgets
 List of widgets wanting to install their menu bar.

Define Documentation

#define XOR (   exp1,
  exp2 
)    (((!exp1) && (exp2)) || ((exp1) && (!exp2)))

Function Documentation

void replaceActions ( QWidget *  dest,
QWidget *  src 
)

Definition at line 41 of file qt_tm_widget.cpp.

                                             {
    //NOTE: the parent hierarchy of the actions is not modified while installing
    //      the menu in the GUI (see qt_menu.cpp for this memory management 
    //      policy)
  dest->setUpdatesEnabled(false);
  QList<QAction *> list = dest->actions();
  while (!list.isEmpty()) {
    QAction* a= list.takeFirst();
    dest->removeAction (a);
  }
  list = src->actions();
  while (!list.isEmpty()) {
    QAction* a= list.takeFirst();
    dest->addAction (a);
  }
  dest->setUpdatesEnabled(true);
}

Here is the caller graph for this function:

void replaceButtons ( QToolBar *  dest,
QWidget *  src 
)

Definition at line 60 of file qt_tm_widget.cpp.

                                             {
  dest->setUpdatesEnabled(false);
  bool visible = dest->isVisible();
  if (visible) dest->hide(); //TRICK: this is a trick to avoid flicker of the dest widget
  replaceActions (dest, src);
  QList<QObject*> list= dest->children();
  for (int i=0; i<list.count(); i++) {
    QToolButton* button= qobject_cast<QToolButton*> (list[i]);
    if (button) {
      button->setPopupMode (QToolButton::InstantPopup);
      button->setStyle( qtmstyle() );
    }
  }
  if (visible) dest->show(); //TRICK: see above
  dest->setUpdatesEnabled(true);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void tweek_iconbar_size ( QSize &  sz) [static]

Definition at line 100 of file qt_tm_widget.cpp.

                               {
  if (sz.height () >= 24) {
    sz.setWidth (sz.width () + 2);
    sz.setHeight (sz.height () + 6);
  }
  else if (sz.height () >= 20) {
    sz.setHeight (sz.height () + 2);
  }
  else if (sz.height () >= 16) {
    sz.setHeight (sz.height () + 2);
  }
}

Here is the caller graph for this function:


Variable Documentation

int menu_count = 0

Positive means the menu is busy.

Definition at line 37 of file qt_tm_widget.cpp.

List of widgets wanting to install their menu bar.

Definition at line 38 of file qt_tm_widget.cpp.