void keyPressEvent(QKeyEvent* event)
 {
   switch(event->key())
   {
     case Qt::Key_PageUp:
     case Qt::Key_Plus:
       event->accept();
       if(getFontPointSize() < 48)
         setFontPointSize(getFontPointSize() + 1);
       QWidget::update();
       break;
     case Qt::Key_PageDown:
     case Qt::Key_Minus:
       event->accept();
       if(getFontPointSize() > 3)
         setFontPointSize(getFontPointSize() - 1);
       QWidget::update();
       break;
     default:
       QWidget::keyPressEvent(event);
       break;
   }
 }
  CABSLBehaviorWidget(CABSLBehaviorView& cabslBehaviorView, QWidget* parent) :
    QWidget(parent), cabslBehaviorView(cabslBehaviorView)
  {
    setFocusPolicy(Qt::StrongFocus);
    setBackgroundRole(QPalette::Base);

    font = QApplication::font();
    boldFont = font;
    boldFont.setBold(true);
    setFontPointSize(getFontPointSize());

    const QPalette& pal(QApplication::palette());
    altBrush = pal.alternateBase();
    fontPen.setColor(pal.text().color());

    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  }
Пример #3
0
  TeamComm3DWidget(TeamComm3DView& view, QHeaderView* headerView, QWidget* parent) : QWidget(parent),
    view(view), headerView(headerView), baseBrush(QPalette().base()), noPen(Qt::NoPen)
  {
    setFocusPolicy(Qt::StrongFocus);
    setBackgroundRole(QPalette::Base);

    font = QApplication::font();
    boldFont = font;
    boldFont.setBold(true);
    setFontPointSize(getFontPointSize());

    const QPalette& pal(QApplication::palette());
    altBrush = pal.alternateBase();
    fontPen.setColor(pal.text().color());

    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    QSettings& settings = TeamComm3DCtrl::application->getLayoutSettings();
    settings.beginGroup(view.fullName);
    headerView->restoreState(settings.value("HeaderState").toByteArray());
    settings.endGroup();
  }