示例#1
0
void wyBitmapFontLabel::setText(const char* text) {
	// null checking
	if(text == NULL)
		return;

	// release old
    if(m_text) {
    	wyFree((void*)m_text);
    	m_text = NULL;
    }

    // save text
    m_text = wyUtils::copy(text);

    // measure
    setLineWidth(m_lineWidth);
}
示例#2
0
int QwtDial::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QwtAbstractSlider::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = hasVisibleBackground(); break;
        case 1: *reinterpret_cast< int*>(_v) = lineWidth(); break;
        case 2: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break;
        case 3: *reinterpret_cast< Mode*>(_v) = mode(); break;
        case 4: *reinterpret_cast< double*>(_v) = origin(); break;
        case 5: *reinterpret_cast< bool*>(_v) = wrapping(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: showBackground(*reinterpret_cast< bool*>(_v)); break;
        case 1: setLineWidth(*reinterpret_cast< int*>(_v)); break;
        case 2: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break;
        case 3: setMode(*reinterpret_cast< Mode*>(_v)); break;
        case 4: setOrigin(*reinterpret_cast< double*>(_v)); break;
        case 5: setWrapping(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
示例#3
0
InboxButtonView::InboxButtonView(QWidget* parent)
        : QGraphicsView(parent), m_usedWidth(0)
{
    setMinimumHeight( 24 );
    setMaximumHeight( minimumHeight() );

    setFrameShape(QFrame::NoFrame);
    setFrameShadow(QFrame::Plain);
    setLineWidth(0);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setInteractive(true);
    setAttribute(Qt::WA_Hover, true);
    setAlignment(Qt::AlignLeft | Qt::AlignTop);

    m_scene = new QGraphicsScene(this);
    setScene( m_scene );
}
示例#4
0
Volta::Volta(Score* s)
   : TextLine(s)
      {
      _voltaType = VoltaType::OPEN;
      setBeginText("1.", TEXT_STYLE_VOLTA);

      setBeginTextPlace(PlaceText::BELOW);
      setContinueTextPlace(PlaceText::BELOW);

      setBeginHook(true);
      Spatium hook(s->styleS(StyleIdx::voltaHook));
      setBeginHookHeight(hook);
      setEndHookHeight(hook);
      setAnchor(Anchor::MEASURE);

      setLineWidth(score()->styleS(StyleIdx::voltaLineWidth));
      lineWidthStyle = PropertyStyle::STYLED;
      }
QvisAbstractOpacityBar::QvisAbstractOpacityBar(QWidget *parent)
    : QFrame(parent)
{
    setFrameStyle( QFrame::Panel | QFrame::Sunken );
    setLineWidth( 2 );
    setMinimumHeight(50);
    setMinimumWidth(128);
    setContentsMargins(0,0,0,0);
    QSizePolicy sp(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
    setSizePolicy(sp);

    image = 0;
    backgroundColorControlPoints = 0;
    histTexture = 0;
    histTextureMask = 0;
    histTextureSize = 0;
    histogramColor = QColor(30,30,30);
}
示例#6
0
ImageView::ImageView(QWidget* parent)
  : QGraphicsView(parent)
  , m_autoZoomFit(false)
  , m_scaleFactor(1.0)
  , m_proxy(0)
  , m_item(0)
  , m_cacheTimer(0)
{
  m_scene = new QGraphicsScene(this);

  setViewportMargins(0, 0, 0, 0);
  setContentsMargins(0, 0, 0, 0);
  setLineWidth(0);
  setDragMode(ScrollHandDrag);
  setFrameStyle(Plain | NoFrame);

  setScene(m_scene);
}
示例#7
0
SmbView::SmbView(QWidget *parent, const char *name) : KListView(parent, name)
{
    addColumn(i18n("Printer"));
    addColumn(i18n("Comment"));
    setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
    setLineWidth(1);
    setAllColumnsShowFocus(true);
    setRootIsDecorated(true);

    m_state = Idle;
    m_current = 0;
    m_proc = new KProcess();
    m_proc->setUseShell(true);
    m_passwdFile = 0;
    connect(m_proc, SIGNAL(processExited(KProcess *)), SLOT(slotProcessExited(KProcess *)));
    connect(m_proc, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(slotReceivedStdout(KProcess *, char *, int)));
    connect(this, SIGNAL(selectionChanged(QListViewItem *)), SLOT(slotSelectionChanged(QListViewItem *)));
}
示例#8
0
int QFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Shape*>(_v) = frameShape(); break;
        case 1: *reinterpret_cast< Shadow*>(_v) = frameShadow(); break;
        case 2: *reinterpret_cast< int*>(_v) = lineWidth(); break;
        case 3: *reinterpret_cast< int*>(_v) = midLineWidth(); break;
        case 4: *reinterpret_cast< int*>(_v) = frameWidth(); break;
        case 5: *reinterpret_cast< QRect*>(_v) = frameRect(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setFrameShape(*reinterpret_cast< Shape*>(_v)); break;
        case 1: setFrameShadow(*reinterpret_cast< Shadow*>(_v)); break;
        case 2: setLineWidth(*reinterpret_cast< int*>(_v)); break;
        case 3: setMidLineWidth(*reinterpret_cast< int*>(_v)); break;
        case 5: setFrameRect(*reinterpret_cast< QRect*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
示例#9
0
main (void)
{
  initGraph ();

  /* 背景 */
  floodFill (320, 240, BLACK, LIGHTBLUE);
  waitButtonPress ();

  /* 頭 */
  fillEllipse (320, 240, 240, 180, WHITE);

  /* 耳 */
  fillEllipse (480, 140, 60, 80, WHITE);
  fillEllipse (160, 140, 60, 80, WHITE);
  waitButtonPress ();

  /* 目 */
  fillEllipse (200, 300, 15, 20, BLACK);
  fillEllipse (440, 300, 15, 20, BLACK);
  waitButtonPress ();

  /* 鼻 */
  fillEllipse (320, 340, 10, 14, YELLOW);
  setLineWidth (2);
  waitButtonPress ();

  /* ひげ */
  drawLine (125, 300, 40, 305, BLACK);
  drawLine (130, 320, 50, 330, BLACK);
  drawLine (140, 340, 40, 355, BLACK);

  drawLine (515, 300, 600, 305, BLACK);
  drawLine (510, 320, 590, 330, BLACK);
  drawLine (500, 340, 600, 355, BLACK);
  waitButtonPress ();

  /* リボン */
  fillTriangle (480, 160, 430, 70, 380, 160, RED);
  fillTriangle (480, 160, 530, 250, 580, 160, RED);
  fillCircle (480, 160, 20, RED);
  waitButtonPress ();

  closeGraph ();
}
示例#10
0
文件: wGraphFrame.cpp 项目: jeez/iqr
WGraphFrame::WGraphFrame(WGraphWidget *p) 
  : QFrame(p,"",WRepaintNoErase|WResizeNoErase),
    zoomEnabled(false), autoDisableZoom(false),
    panEnabled(false),
    xGridVisible(true), yGridVisible(true),
    parent(p),
    zoomRectPen(QColor(255,255,255),0,DotLine),
    gridPen(QColor(128,128,128),0,DotLine) {

  setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
			    QSizePolicy::Expanding));
  
  paintPixmap.setOptimization(QPixmap::BestOptim);
  
  setZoomCursor(crossCursor);
  setPanCursor(sizeAllCursor);
  setFrameStyle(QFrame::Sunken|QFrame::Panel);
  setLineWidth(2);
}
void DotPolygonHit::draw(){
    
    
    ofSetColor(0);
    setLineWidth(1);
    ofSetCircleResolution(20);
    for (int i=0; i<numPoints; i++){
        lines[i].draw();
    }
    
    ofFill();
    
    for (int i=0; i<numPoints; i++){
        ofSetColor(0);
        ofDrawCircle(points[i].x, points[i].y, pointSize[i]);
        ofSetColor(whiteVal);
        ofDrawCircle(points[i].x, points[i].y, pointSize[i]*0.75);
    }
}
示例#12
0
ProgressFrame::ProgressFrame( QWidget *parent ) :
    QFrame( parent ),
    m_itemType( 0 ),
    m_progressEnabled( false ),
    m_clockEnabled( false ),
    m_reverse( false ),
    m_watch( NULL ),
    m_value( 0 )
{
    m_textPushTimer.setSingleShot( true );
    connect( &m_textPushTimer, SIGNAL( timeout() ), this, SLOT( popText() ) );
    m_clockPushTimer.setSingleShot( true );
    connect( &m_clockPushTimer, SIGNAL( timeout() ), this, SLOT( popClockText() ) );

    setMinimumHeight( 22 );
    setMinimumWidth( 22 );
    setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
    setLineWidth( 1 );
}
示例#13
0
DrawingPad::DrawingPad(QWidget *parent)
    : QWidget(parent)
    , m_shapeType(Shape::TYPE_FREEHAND)
{
    setAutoFillBackground(true);
    setPalette(Qt::white);

    FreeHandMaker *freeHandMaker = new FreeHandMaker();
    RectangleMaker *rectangleMaker = new RectangleMaker();

    m_shapeMakerMap[Shape::TYPE_FREEHAND] = freeHandMaker;
    m_shapeMakerMap[Shape::TYPE_RECTANGLE] = rectangleMaker;

    connect(freeHandMaker,SIGNAL(newShapeAvailable()),this,SLOT(newShapeAvailable()));
    connect(rectangleMaker,SIGNAL(newShapeAvailable()),this,SLOT(newShapeAvailable()));

    setLineColor(Qt::black);
    setLineWidth(0);
}
示例#14
0
KateArgumentHintTree::KateArgumentHintTree( KateCompletionWidget* parent ) : ExpandingTree(0), m_parent(parent) { //Do not use the completion-widget as widget-parent, because the argument-hint-tree will be rendered separately

  setFrameStyle( QFrame::Box | QFrame::Plain );
  setLineWidth( 1 );

  connect( parent, SIGNAL(destroyed(QObject*)), this, SLOT(deleteLater()) );
  setFrameStyle(QFrame::NoFrame);
  setFrameStyle( QFrame::Box | QFrame::Plain );
  setFocusPolicy(Qt::NoFocus);
  setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
  setUniformRowHeights(false);
  setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
  header()->hide();
  setRootIsDecorated(false);
  setIndentation(0);
  setAllColumnsShowFocus(true);
  setAlternatingRowColors(true);
  setItemDelegate(new KateCompletionDelegate(parent->argumentHintModel(), parent));
}
示例#15
0
void Hairpin::read(XmlReader& e)
      {
      foreach(SpannerSegment* seg, spannerSegments())
            delete seg;
      spannerSegments().clear();

      int id = e.intAttribute("id", -1);
      e.addSpanner(id, this);

      while (e.readNextStartElement()) {
            const QStringRef& tag(e.name());
            if (tag == "subtype")
                  setHairpinType(Type(e.readInt()));
            else if (tag == "lineWidth") {
                  setLineWidth(Spatium(e.readDouble()));
                  lineWidthStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "hairpinHeight") {
                  setHairpinHeight(Spatium(e.readDouble()));
                  hairpinHeightStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "hairpinContHeight") {
                  setHairpinContHeight(Spatium(e.readDouble()));
                  hairpinContHeightStyle = PropertyStyle::UNSTYLED;
                  }
            else if (tag == "hairpinCircledTip")
                  _hairpinCircledTip = e.readInt();
            else if (tag == "veloChange")
                  _veloChange = e.readInt();
            else if (tag == "dynType")
                  _dynRange = Dynamic::Range(e.readInt());
            else if (tag == "useTextLine") {      // obsolete
                  e.readInt();
                  if (hairpinType() == Type::CRESC_HAIRPIN)
                        setHairpinType(Type::CRESC_LINE);
                  else if (hairpinType() == Type::DECRESC_HAIRPIN)
                        setHairpinType(Type::DECRESC_LINE);
                  }
            else if (!TextLine::readProperties(e))
                  e.unknown();
            }
      }
示例#16
0
bool Ambitus::setProperty(Pid propertyId, const QVariant& v)
      {
      switch (propertyId) {
            case Pid::HEAD_GROUP:
                  setNoteHeadGroup( NoteHead::Group(v.toInt()) );
                  break;
            case Pid::HEAD_TYPE:
                  setNoteHeadType( NoteHead::Type(v.toInt()) );
                  break;
            case Pid::MIRROR_HEAD:
                  setDirection(MScore::DirectionH(v.toInt()) );
                  break;
            case Pid::GHOST:                 // recycled property = _hasLine
                  setHasLine(v.toBool());
                  break;
            case Pid::LINE_WIDTH:
                  setLineWidth(v.value<Spatium>());
                  break;
            case Pid::TPC1:
                  setTopTpc(v.toInt());
                  break;
            case Pid::FBPARENTHESIS1:        // recycled property = _bottomTpc
                  setBottomTpc(v.toInt());
                  break;
            case Pid::PITCH:
                  setTopPitch(v.toInt());
                  break;
            case Pid::FBPARENTHESIS2:        // recycled property = _bottomPitch
                  setBottomPitch(v.toInt());
                  break;
            case Pid::FBPARENTHESIS3:        // recycled property = octave of _topPitch
                  setTopPitch(topPitch() % 12 + v.toInt() * 12);
                  break;
            case Pid::FBPARENTHESIS4:        // recycled property = octave of _bottomPitch
                  setBottomPitch(bottomPitch() % 12 + v.toInt() * 12);
                  break;
            default:
                  return Element::setProperty(propertyId, v);
            }
      triggerLayout();
      return true;
      }
示例#17
0
PropertyWidget_PathText::PropertyWidget_PathText(QWidget* parent) : QFrame(parent)
{
	m_ScMW = 0;
	m_doc  = 0;
	m_unitRatio  = 1.0;

	setupUi(this);

	setFrameStyle(QFrame::Box | QFrame::Plain);
	setLineWidth(1);
	layout()->setAlignment( Qt::AlignTop );
	
	startOffset->setValues(0, 30000, 2, 0);
	startOffset->setSingleStep(10);

	distFromCurve->setValues(-300, 300, 2, 0);
	distFromCurve->setSingleStep(10);

	languageChange();
}
示例#18
0
bool TremoloBar::setProperty(Pid propertyId, const QVariant& v)
      {
      switch (propertyId) {
            case Pid::LINE_WIDTH:
                  lineWidthStyle = PropertyFlags::UNSTYLED;
                  setLineWidth(v.value<Spatium>());
                  break;
            case Pid::MAG:
                  setUserMag(v.toDouble());
                  break;
            case Pid::PLAY:
                  setPlay(v.toBool());
                  score()->setPlaylistDirty();
                  break;
            default:
                  return Element::setProperty(propertyId, v);
            }
      score()->setLayoutAll();
      return true;
      }
LineNumberDisplay::LineNumberDisplay(QTextEdit *te, QWidget *parent)
    : QTextEdit(parent), d_text_edit(te)
{
    setReadOnly(true);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setFrameStyle(QFrame::Panel | QFrame::Raised);
    setMaximumWidth(0);
    setLineWidth(0);
    setFocusPolicy(Qt::NoFocus);
    setCurrentFont(te->currentFont());

    if (te) {
        connect(te->document(), SIGNAL(contentsChanged()), this, SLOT(updateLineNumbers()));
        connect((QObject *)te->verticalScrollBar(), SIGNAL(valueChanged(int)),
                (QObject *)verticalScrollBar(), SLOT(setValue(int)));
        connect(te, SIGNAL(currentCharFormatChanged (const QTextCharFormat &)),
                this, SLOT(changeCharFormat (const QTextCharFormat &)));
    }
}
示例#20
0
ImageView::ImageView(QWidget* parent):
  QGraphicsView(parent),
  scene_(new QGraphicsScene(this)),
  imageItem_(new QGraphicsRectItem()),
  gifMovie_(nullptr),
  cacheTimer_(nullptr),
  cursorTimer_(nullptr),
  scaleFactor_(1.0),
  autoZoomFit_(false),
  isSVG(false) {

  setViewportMargins(0, 0, 0, 0);
  setContentsMargins(0, 0, 0, 0);
  setLineWidth(0);

  setScene(scene_);
  imageItem_->hide();
  imageItem_->setPen(QPen(Qt::NoPen)); // remove the border
  scene_->addItem(imageItem_);
}
示例#21
0
StatusLabel::StatusLabel(QWidget * parent)
: QFrame(parent)
{
	setFrameStyle(QFrame::Panel | QFrame::Sunken);
	setLineWidth(1);
//	setStyleSheet("* { background-color: rgb(245, 245, 5); }");
	label = new QLabel();
	QFont font = label->font();
	font.setPixelSize(11);
	label->setFont(font);
	label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
	setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
	QHBoxLayout * layout = new QHBoxLayout();
	layout->addWidget(label);
	layout->setMargin(0);
	layout->setContentsMargins(2, 0, 0, 0);
	setLayout(layout);
	
	setStyleSheet("* { color: rgb(80, 80, 80); }");
}
示例#22
0
BasicPlot::BasicPlot(QWidget *parent) :
  QwtPlot(parent)
{
  setFrameStyle(QFrame::NoFrame);
  setLineWidth(0);
  setCanvasLineWidth(2);
  plotLayout()->setAlignCanvasToScales(true);
  QwtPlotGrid *grid = new QwtPlotGrid;
  grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
  grid->attach(this);
  setCanvasBackground(QColor(29, 100, 141)); // nice blue

  // enable zooming
  Zoomer *zoomer = new Zoomer(canvas());
  zoomer->setRubberBandPen(QPen(Qt::white, 2, Qt::DotLine));
  zoomer->setTrackerPen(QPen(Qt::white));
  QObject::connect(this, SIGNAL(setNewBase(QwtScaleDiv*,QwtScaleDiv*)), zoomer,
      SLOT(setNewBase(QwtScaleDiv*,QwtScaleDiv*)));

}
示例#23
0
myPopup::myPopup(QWidget *parent, const QString &text, const QString &text2, const QString &flagFile) : QFrame(parent)
{
    QHBoxLayout *lay = new QHBoxLayout(this);
    lay -> setMargin(4);
    lay -> setSpacing(4);

    QWidget *vbox = new QWidget(this);
    lay -> addWidget(vbox);
    QVBoxLayout *vboxLayout = new QVBoxLayout(vbox);
    vboxLayout -> setMargin(0);
    vboxLayout -> setSpacing(0);
    QLabel *l = new QLabel(text, vbox);
    vboxLayout -> addWidget(l);

    if (!text2.isNull())
    {
        QLabel *l2 = new QLabel(text2, vbox);
        l2 -> setAlignment(Qt::AlignCenter);
        vboxLayout -> addWidget(l2);
    }

    if (!flagFile.isNull())
    {
        QLabel *flag = new QLabel(this);
        lay -> addWidget(flag);
        QImage flagImg(flagFile);
        flag -> setPixmap(flagImg.smoothScale(flagImg.width() / 5, flagImg. height() / 5));
        flag -> setAlignment(Qt::AlignCenter);
    }

    l -> setAlignment(Qt::AlignCenter);
    QFont f = l -> font();
    f.setBold(true);
    l -> setFont(f);


    setFrameStyle(QFrame::Box | QFrame::Plain);
    setLineWidth(2);

    setFixedSize(sizeHint());
}
示例#24
0
文件: WarningBox.cpp 项目: C-CINA/2dx
WarningBox::WarningBox(resultsFile *file, QWidget *parent)
: QFrame(parent) {
    results = file;
    warning = 0;

    if (file != NULL)
        connect(results, SIGNAL(loaded()), this, SLOT(load()));

    timer.setSingleShot(true);
    connect(&timer, SIGNAL(timeout()), this, SLOT(load()));

    setFrameStyle(QFrame::Box | QFrame::Raised);
    setLineWidth(1);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->setMargin(1);
    layout->setSpacing(0);
    setLayout(layout);

    setAutoFillBackground(true);

    QPalette pal(palette());
    pal.setColor(QPalette::Window, Qt::white);
    setPalette(pal);

    labelFont = font();
    labelFont.setPointSize(labelFont.pointSize() - 2);
    setFont(labelFont);

    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    label = new QLabel(this);
    label->setAlignment(Qt::AlignLeft);
    label->setAutoFillBackground(true);
    //    pal.setColor(QPalette::WindowText,QColor(201,24,24));
    pal.setColor(QPalette::Window, QColor(255, 255, 220));
    label->setPalette(pal);
    label->setFont(labelFont);
    layout->addWidget(label);
    hide();
}
示例#25
0
/**
 *  \brief Constructor for the \c CommandLine class
 *
 *  The constructor uses a \c QHBoxLayout to place a QLabel and a \c QLineEdit
 *  in the \c QFrame which is the container for the widgets.  The label is
 *  placed to the left of the line edit widget. The line edit input field
 *  starts empty.
 */
CommandLine::CommandLine(QWidget *parent)
    : QFrame(parent)
{
    setFrameStyle(QFrame::Panel | QFrame::Plain);
    setLineWidth(0);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->setSpacing(10);
    layout->setContentsMargins(5, 5, 5, 5);
    QLabel *label = new QLabel(tr("Command line"));
    layout->addWidget(label);
    lineEdit = new QLineEdit();
    lineEdit->setToolTip(tr("Enter extra parameters for the command line\n"
        "for your program when it runs.  The command\n"
        "line parameters are the parameters to main\n"
        "in C and C++(argc and argv).  The first is\n"
        "always the name of the program."));
    layout->addWidget(lineEdit);
    setLayout(layout);
    setVisible(ebe["command/visible"].toBool());
}
Tile::Tile(QWidget *parent)
: QFrame(parent)
{

	alive = false;
	setFrameStyle(QFrame::Box);

	rect = new QWidget;

    cellSize = 10;
	rect->setMinimumSize(cellSize, cellSize);

	layout = new QHBoxLayout;
	layout->addWidget(rect);
	setLayout(layout);

	layout->setContentsMargins(0,0,0,0);
	setLineWidth(1);
    redraw(qRgba(0, 0, 0, 255));

}
示例#27
0
KCompletionBox::KCompletionBox( QWidget *parent )
 :KListWidget( parent), d(new KCompletionBoxPrivate)
{
    d->m_parent        = parent;
    d->tabHandling     = true;
    d->upwardBox       = false;
    d->emitSelected    = true;

    setWindowFlags( Qt::ToolTip ); // calls setVisible, so must be done after initializations

    setLineWidth( 1 );
    setFrameStyle( QFrame::Box | QFrame::Plain );

    setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    connect( this, SIGNAL( itemDoubleClicked( QListWidgetItem * )),
             SLOT( slotActivated( QListWidgetItem * )) );
    connect( this, SIGNAL( itemClicked( QListWidgetItem * )),
             SLOT( slotItemClicked( QListWidgetItem * )) );
}
示例#28
0
DrawWidget::DrawWidget(QWidget *parent, const char* /*name*/, Qt::WFlags f)
: QWidget(parent, NULL/*name*/, f)
{
#ifdef SHARED_DRAWING_BUFFER
  _buffer = gdata->drawingBuffer();
  _buffer->resize(_buffer->size().expandedTo(size()));
  paintDevice = _buffer;
#elif SINGLE_DRAWING_BUFFER
  paintDevice = this;
#else
  _buffer = new QPixmap(size());
  paintDevice = _buffer;
#endif
  
  setLineWidth(3);
  
  // With double buffering, we don't want QT to clear the display all the time
  //setBackgroundMode(Qt::NoBackground);
  setAttribute(Qt::WA_OpaquePaintEvent);
  //setAutoFillBackground(false);
}
示例#29
0
BasicMibView::BasicMibView (QWidget * parent) : QTreeWidget(parent)
{
    // Set some properties for the TreeView
    header()->hide();
    setSortingEnabled( false );
    setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
    header()->setSortIndicatorShown( false );
    setLineWidth( 2 );
    setAllColumnsShowFocus( false );
    setFrameShape(QFrame::WinPanel);
    setFrameShadow(QFrame::Plain);
    setRootIsDecorated( true );
    
    // Create context menu actions
    expandAct = new QAction(tr("Expand"), this);
    expandAct->setIcon(QIcon(":/images/expand.png"));
    connect(expandAct, SIGNAL(triggered()), this, SLOT(ExpandFromNode()));
    collapseAct = new QAction(tr("Collapse"), this);
    collapseAct->setIcon(QIcon(":/images/collapse.png"));
    connect(collapseAct, SIGNAL(triggered()), this, SLOT(CollapseFromNode()));
    findAct = new QAction(tr("Find"), this);
    connect(findAct, SIGNAL(triggered()), this, SLOT(FindFromNode()));
    
    // Connect some signals
    connect( this, SIGNAL( itemExpanded( QTreeWidgetItem * ) ),
             this, SLOT( ExpandNode( QTreeWidgetItem * ) ) );
    connect( this, SIGNAL( itemCollapsed( QTreeWidgetItem * ) ),
             this, SLOT( CollapseNode( QTreeWidgetItem * ) ) );
    connect( this, SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem * ) ),
             this, SLOT( SelectedNode( QTreeWidgetItem *, QTreeWidgetItem * ) ) );

    // Force initial refresh
    isdirty = 1;

    find_string = "";
    find_last = model()->index(0, 0, QModelIndex());
    find_back = false;
    find_cs = false;
    find_word = false;
}
示例#30
0
MarkListTable::MarkListTable( QWidget * parent , const char * name )
	: QTableView( parent, name ), sel(-1), drag(-1), items()
{
	setFrameStyle( Panel | Sunken );
        setTableFlags( Tbl_autoVScrollBar | Tbl_cutCellsV
                         | Tbl_snapToVGrid | Tbl_clipCellPainting);
        setLineWidth( 1 );
        setCellHeight( fontMetrics().lineSpacing()+4 );
   	setNumCols( 2 );
//	setBackgroundColor( colorGroup().normal().light(120) );
	pup = new QPopupMenu(0, "pup");
	pup->insertItem( i18n("Mark current page"), this, SLOT(markSelected()) );
	pup->insertItem( i18n("Mark all pages"), this, SLOT(markAll()) );
	pup->insertItem( i18n("Mark even pages"), this, SLOT(markEven()) );
	pup->insertItem( i18n("Mark odd pages"), this, SLOT(markOdd()) );
	pup->insertItem( i18n("Toggle page marks"), this, SLOT(toggleMarks()) );
	pup->insertItem( i18n("Remove page marks"), this, SLOT(removeMarks()) );
//	items.setAutoDelete( TRUE );
	selectColor = QColor( black );
	selectTextColor = QColor( white );
	
}