示例#1
0
CGMainWindow::CGMainWindow (QWidget* parent, Qt::WindowFlags flags)
: QMainWindow (parent, flags) {
	resize (604, 614);

	// Create a nice frame to put around the OpenGL widget
	QFrame* f = new QFrame (this);
	f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
	f->setLineWidth(2);

	// Create our OpenGL widget
	ogl = new CGView (this,f);

	// Create a menu
	QMenu *file = new QMenu("&File",this);
	file->addAction ("Quit", this, SLOT(close()), Qt::CTRL+Qt::Key_Q);

	menuBar()->addMenu(file);

    QAction *action;
	// Create a 'View' menu
	QMenu *show = new QMenu("&Show",this);
	action = show->addAction("show sphere", ogl, SLOT(toggleSphere()), Qt::Key_C);
	action->setCheckable(true);
	menuBar()->addMenu(show);

	// Put the GL widget inside the frame
	QHBoxLayout* layout = new QHBoxLayout();
	layout->addWidget(ogl);
	layout->setMargin(0);
	f->setLayout(layout);

	setCentralWidget(f);

	statusBar()->showMessage("Ready",1000);
}
示例#2
0
InspectorRest::InspectorRest(QWidget* parent)
   : InspectorElementBase(parent)
      {
      s.setupUi(addWidget());
      r.setupUi(addWidget());

      const std::vector<InspectorItem> iiList = {
            { Pid::LEADING_SPACE,  1, s.leadingSpace,  s.resetLeadingSpace  },
            { Pid::SMALL,          0, r.small,         r.resetSmall         },
            };
      const std::vector<InspectorPanel> ppList = {
            { s.title, s.panel },
            { r.title, r.panel }
            };
      mapSignals(iiList, ppList);

      //
      // Select
      //
      QLabel* l = new QLabel;
      l->setText(tr("Select"));
      QFont font(l->font());
      font.setBold(true);
      l->setFont(font);
      l->setAlignment(Qt::AlignHCenter);
      _layout->addWidget(l);
      QFrame* f = new QFrame;
      f->setFrameStyle(QFrame::HLine | QFrame::Raised);
      f->setLineWidth(2);
      _layout->addWidget(f);

      QHBoxLayout* hbox = new QHBoxLayout;
      dot1 = new QToolButton(this);
      dot1->setText(tr("Dot 1"));
      hbox->addWidget(dot1);
      dot2 = new QToolButton(this);
      dot2->setText(tr("Dot 2"));
      hbox->addWidget(dot2);
      dot3 = new QToolButton(this);
      dot3->setText(tr("Dot 3"));
      hbox->addWidget(dot3);
      dot4 = new QToolButton(this);
      dot4->setText(tr("Dot 4"));
      hbox->addWidget(dot4);
      _layout->addLayout(hbox);
      hbox = new QHBoxLayout;
      tuplet = new QToolButton(this);
      tuplet->setText(tr("Tuplet"));
      tuplet->setEnabled(false);
      hbox->addWidget(tuplet);
      _layout->addLayout(hbox);

//TODO      e.offset->setSingleStep(1.0);        // step in spatium units

      connect(dot1,     SIGNAL(clicked()),     SLOT(dot1Clicked()));
      connect(dot2,     SIGNAL(clicked()),     SLOT(dot2Clicked()));
      connect(dot3,     SIGNAL(clicked()),     SLOT(dot3Clicked()));
      connect(dot4,     SIGNAL(clicked()),     SLOT(dot4Clicked()));
      connect(tuplet,   SIGNAL(clicked()),     SLOT(tupletClicked()));
      }
示例#3
0
CGMainWindow::CGMainWindow (QWidget* parent, Qt::WindowFlags flags)
				: QMainWindow (parent, flags) {
								resize (1024, 768);
								setWindowState(Qt::WindowMaximized);

								// Create a menu
								QMenu *file = new QMenu("&File",this);
								file->addAction ("Load Polyhedron", this, SLOT(loadPolyhedron()), Qt::CTRL+Qt::Key_G);
								file->addAction ("Quit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q);
								menuBar()->addMenu(file);

								// Create a nice frame to put around the OpenGL widget
								QFrame* f = new QFrame (this);
								f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
								f->setLineWidth(2);

								// Create our OpenGL widget
								ogl = new CGView (this,f);

								// Put the GL widget inside the frame
								QHBoxLayout* layout = new QHBoxLayout();
								layout->addWidget(ogl);
								layout->setMargin(0);
								f->setLayout(layout);

								setCentralWidget(f);

								statusBar()->showMessage("Ready",1000);
				}
示例#4
0
tHoldIndicatorFluid::tHoldIndicatorFluid( QWidget* parent )
: tPanelInfoBox( Qt::AlignCenter, parent )
{
    // translation done this way so that tHoldIndicatorFluid doesn't have to have a Q_OBJECT macro 
    // and be moved to a separate file, before making any changes make sure they work!
    static const char* hold_strings[] = 
    {
        QT_TRANSLATE_NOOP( "tPageFluid", "Hold" ),
    };
    
    SetOverlayOnGL( true );
    QLabel* pName = new QLabel( qApp->translate( "tPageFluid", hold_strings[0] ) );
    QLabel* pImage = new QLabel();
    pImage->setPixmap( QPixmap( tPath::ResourceFile("lowrance/switch_screen.png") ) );
    QFrame* pHSep = new QFrame();
    pHSep->setFrameStyle( QFrame::HLine | QFrame::Plain );
    pHSep->setLineWidth( 1 );

    QVBoxLayout* pLayout = new QVBoxLayout();
    tPanelInfoBox::SetDefaultContentsMargins( pLayout );
    pLayout->addWidget( pName, 0, Qt::AlignHCenter );
    pLayout->addWidget( pHSep );
    pLayout->addWidget( pImage, 0, Qt::AlignHCenter );
    setLayout(pLayout);
    adjustSize();

    tOverlayManagerQueue::Instance()->RegisterOverlayWidget( this, tOverlayManagerQueue::OMPHoldIndicator );
}
示例#5
0
CGMainWindow::CGMainWindow(QWidget *parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags) {
    resize(604, 614);

    // Create a nice frame to put around the OpenGL widget
    QFrame *f = new QFrame(this);
    f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    f->setLineWidth(2);

    // Create our OpenGL widget
    ogl = new CGView(this, f);

    QMenu *file = new QMenu("&Plane", this);
    file->addAction("&Reset plane", this->ogl, SLOT(reset_plane()), Qt::CTRL + Qt::Key_R);
    file->addAction("&Toggle follow", this->ogl, SLOT(toggle_follow()), Qt::CTRL + Qt::Key_T);
    file->addAction("Quit", this, SLOT(close()), Qt::CTRL + Qt::Key_Q);

    menuBar()->addMenu(file);

    // Put the GL widget inside the frame
    QHBoxLayout *layout = new QHBoxLayout();
    layout->addWidget(ogl);
    layout->setMargin(0);
    f->setLayout(layout);

    setCentralWidget(f);

    statusBar()->showMessage("Ready", 1000);
}
示例#6
0
文件: globjwin.cpp 项目: RSATom/Qt
GLObjectWindow::GLObjectWindow(QWidget *parent)
    : QWidget(parent)
{
    // Create a menu
    QMenu *file = new QMenu(this);
    file->addAction(tr("Exit"), qApp, &QApplication::quit);

    // Create a menu bar
    QMenuBar *m = new QMenuBar(this);
    m->addMenu(file)->setText(tr("&File"));

    // Create a nice frame to put around the OpenGL widget
    QFrame *f = new QFrame(this);
    f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    f->setLineWidth(2);

    // Create our OpenGL widget
    GLBox *c = new GLBox(f, "glbox");

    // Create the three sliders; one for each rotation axis
    QSlider *x = new QSlider(Qt::Vertical, this);
    x->setMaximum(360);
    x->setPageStep(60);
    x->setTickPosition(QSlider::TicksLeft);
    connect(x, &QSlider::valueChanged, c, &GLBox::setXRotation);

    QSlider *y = new QSlider(Qt::Vertical, this);
    y->setMaximum(360);
    y->setPageStep(60);
    y->setTickPosition(QSlider::TicksLeft);
    connect(y, &QSlider::valueChanged, c, &GLBox::setYRotation);

    QSlider *z = new QSlider(Qt::Vertical, this);
    z->setMaximum(360);
    z->setPageStep(60);
    z->setTickPosition(QSlider::TicksLeft);
    connect(z, &QSlider::valueChanged, c, &GLBox::setZRotation);

    // Now that we have all the widgets, put them into a nice layout

    // Top level layout, puts the sliders to the left of the frame/GL widget
    QHBoxLayout *hlayout = new QHBoxLayout(this);

    // Put the sliders on top of each other
    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(x);
    vlayout->addWidget(y);
    vlayout->addWidget(z);

    // Put the GL widget inside the frame
    QHBoxLayout *flayout = new QHBoxLayout(f);
    flayout->setMargin(0);
    flayout->addWidget(c, 1);

    hlayout->setMenuBar(m);
    hlayout->addLayout(vlayout);
    hlayout->addWidget(f, 1);
}
示例#7
0
//-----------------------------------------------------------------------------
//! 
//-----------------------------------------------------------------------------
void tApErrorStateWidget::ShowUncommissioned()
{    
    QFont smallFont( font() );
    smallFont.setPixelSize( style()->pixelMetric( NPM( tNOSStyle::NPM_FontSizeSmall ) ) );

    m_pErrorIcon = new QLabel();
    m_pErrorIcon->setPixmap(ErrorPixmap());

    m_pErrorLabel1 = new QLabel( tr( "Autopilot has not been commissioned" ) );
    m_pErrorLabel1->setFont(smallFont);
    m_pErrorLabel1->setWordWrap(true);

    QHBoxLayout* hLayout = new QHBoxLayout;
    hLayout->setContentsMargins( 0, 0, 0, 0 );
    hLayout->setSpacing( 15 );

    hLayout->addWidget( m_pErrorIcon, Qt::AlignLeft );
    hLayout->addWidget( m_pErrorLabel1, Qt::AlignCenter /*Qt::AlignTop | Qt::AlignLeft*/ );

    QFrame* pHSep = new QFrame();
    pHSep->setFrameStyle( QFrame::HLine | QFrame::Plain );
    pHSep->setLineWidth( 1 );

    QLabel* pBoatLbl = new QLabel( tr( "Boat type" ) );
    QLabel* pRudderCalLbl = new QLabel( tr( "Rudder calibration" ) );
    QLabel* pRudderTestLbl = new QLabel( tr( "Rudder test" ) );
    m_pBoatCheck = new tCheckBox();
    m_pBoatCheck->setFocusPolicy( Qt::NoFocus );
    m_pRudderCalCheck = new tCheckBox();
    m_pRudderCalCheck->setFocusPolicy( Qt::NoFocus );
    m_pRudderTestCheck = new tCheckBox();
    m_pRudderTestCheck->setFocusPolicy( Qt::NoFocus );

    CreateCloseButton();

    QGridLayout* pLayout = new QGridLayout( this );
    pLayout->setContentsMargins( 5, 5, 5, 5 );
    pLayout->setSpacing( 5 );
    int row = 0;
    pLayout->addLayout( hLayout, row++, 0, 1, 3 );
    pLayout->addWidget( pHSep, row++, 0, 1, 3 );
    pLayout->addWidget( pBoatLbl, row, 0, 1, 2 );
    pLayout->addWidget( m_pBoatCheck, row++, 2, 1, 1, Qt::AlignRight );
    pLayout->addWidget( pRudderCalLbl, row, 0, 1, 2 );
    pLayout->addWidget( m_pRudderCalCheck, row++, 2, 1, 1, Qt::AlignRight );
    pLayout->addWidget( pRudderTestLbl, row, 0, 1, 2 );
    pLayout->addWidget( m_pRudderTestCheck, row++, 2, 1, 1, Qt::AlignRight );
    pLayout->addWidget( m_pCloseBtn, row, 0, 1, 3 );
    setLayout( pLayout );

    m_pCloseBtn->setFocus();

    UpdateCommissionedStatus();  // init values 

    m_pUpdateTimer = new QTimer(this);
    Connect( m_pUpdateTimer, SIGNAL( timeout() ), this, SLOT( UpdateCommissionedStatus() ) );
    m_pUpdateTimer->start( 3000 );
}
示例#8
0
void Toolbar::addsep(void)
{
  layout->addSpacing(3);
  QFrame *frame = new QFrame(this);
  frame->setLineWidth(1);
  frame->setMidLineWidth(0);
  frame->setFrameStyle(QFrame::VLine|QFrame::Sunken);
  frame->setFixedHeight(height()-4);
  layout->addWidget(frame);
  layout->addSpacing(3);
}
示例#9
0
void FreshStyle::unPolish( QWidget *w )
{
    if ( w->inherits( "QListBox" ) ||
	 w->inherits( "QListView" ) ||
	 w->inherits( "QPopupMenu" ) ||
	 w->inherits( "QSpinBox" ) ) {
	QFrame *f = (QFrame *)w;
	f->setFrameShape( QFrame::StyledPanel );
	f->setLineWidth( 2 );
    }
}
示例#10
0
QmitkKurtosisWidget::QmitkKurtosisWidget(QWidget *parent)
  : QmitkPlotWidget(parent)
{
  QFrame* canvas = qobject_cast< QFrame* >( m_Plot->canvas() );
  if( canvas )
  {
    canvas->setLineWidth(0);
    canvas->setContentsMargins(0, 0, 0, 0);
  }

}
示例#11
0
KompareSplitter::KompareSplitter( ViewSettings *settings, QWidget * parent,
                                  const char *name) :
	QSplitter( Horizontal, parent, name ),
	m_settings( settings )
{
	QFrame *scrollFrame = new QFrame( parent, "scrollFrame" );
	reparent( scrollFrame, *(new QPoint()), false );

	// Set up the scrollFrame
	scrollFrame->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
	scrollFrame->setLineWidth(scrollFrame->style().pixelMetric(QStyle::PM_DefaultFrameWidth));
	QGridLayout *pairlayout = new QGridLayout(scrollFrame, 2, 2, 0);
	m_vScroll = new QScrollBar( QScrollBar::Vertical, scrollFrame );
	pairlayout->addWidget( m_vScroll, 0, 1 );
	m_hScroll = new QScrollBar( QScrollBar::Horizontal, scrollFrame );
	pairlayout->addWidget( m_hScroll, 1, 0 );

	new KompareListViewFrame(true, m_settings, this, "source");
	new KompareListViewFrame(false, m_settings, this, "destination");
	pairlayout->addWidget( this, 0, 0 );

	// set up our looks
	setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
	setLineWidth( style().pixelMetric( QStyle::PM_DefaultFrameWidth ) );

	setHandleWidth(50);
	setChildrenCollapsible( false );
	setFrameStyle( QFrame::NoFrame );
	setSizePolicy( QSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored ));
	setOpaqueResize( true );
	setFocusPolicy( QWidget::WheelFocus );

	connect( this, SIGNAL(configChanged()), SLOT(slotConfigChanged()) );
	connect( this, SIGNAL(configChanged()), SLOT(slotDelayedRepaintHandles()) );
	connect( this, SIGNAL(configChanged()), SLOT(slotDelayedUpdateScrollBars()) );
	
	// scrolling
	connect( m_vScroll, SIGNAL(valueChanged(int)), SLOT(scrollToId(int)) );
	connect( m_vScroll, SIGNAL(sliderMoved(int)),  SLOT(scrollToId(int)) );
	connect( m_hScroll, SIGNAL(valueChanged(int)), SIGNAL(setXOffset(int)) );
	connect( m_hScroll, SIGNAL(sliderMoved(int)),  SIGNAL(setXOffset(int)) );

	m_scrollTimer=new QTimer();
	restartTimer = false;
	connect (m_scrollTimer, SIGNAL(timeout()), SLOT(timerTimeout()) );

	// we need to receive childEvents now so that d->list is ready for when
	// slotSetSelection(...) arrives
	kapp->sendPostedEvents(this, QEvent::ChildInserted);

	// init stuff
	slotUpdateScrollBars();
}
示例#12
0
GLObjectWindow::GLObjectWindow( QWidget* parent, const char* name )
    : QWidget( parent, name )
{

    // Create a menu
    QPopupMenu *file = new QPopupMenu( this );
    file->insertItem( "Exit",  qApp, SLOT(quit()), CTRL+Key_Q );

    // Create a menu bar
    QMenuBar *m = new QMenuBar( this );
    m->setSeparator( QMenuBar::InWindowsStyle );
    m->insertItem("&File", file );

    // Create a nice frame to put around the OpenGL widget
    QFrame* f = new QFrame( this, "frame" );
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );

    // Create our OpenGL widget
    GLBox* c = new GLBox( f, "glbox");

    // Create the three sliders; one for each rotation axis
    QSlider* x = new QSlider ( 0, 360, 60, 0, QSlider::Vertical, this, "xsl" );
    x->setTickmarks( QSlider::Left );
    QObject::connect( x, SIGNAL(valueChanged(int)),c,SLOT(setXRotation(int)) );

    QSlider* y = new QSlider ( 0, 360, 60, 0, QSlider::Vertical, this, "ysl" );
    y->setTickmarks( QSlider::Left );
    QObject::connect( y, SIGNAL(valueChanged(int)),c,SLOT(setYRotation(int)) );

    QSlider* z = new QSlider ( 0, 360, 60, 0, QSlider::Vertical, this, "zsl" );
    z->setTickmarks( QSlider::Left );
    QObject::connect( z, SIGNAL(valueChanged(int)),c,SLOT(setZRotation(int)) );


    // Now that we have all the widgets, put them into a nice layout

    // Put the sliders on top of each other
    QVBoxLayout* vlayout = new QVBoxLayout( 20, "vlayout");
    vlayout->addWidget( x );
    vlayout->addWidget( y );
    vlayout->addWidget( z );

    // Put the GL widget inside the frame
    QHBoxLayout* flayout = new QHBoxLayout( f, 2, 2, "flayout");
    flayout->addWidget( c, 1 );

    // Top level layout, puts the sliders to the left of the frame/GL widget
    QHBoxLayout* hlayout = new QHBoxLayout( this, 20, 20, "hlayout");
    hlayout->setMenuBar( m );
    hlayout->addLayout( vlayout );
    hlayout->addWidget( f, 1 );
}
示例#13
0
void MainWindow::createSliderWidget()
{
	SliderWidget = new QWidget;

	QFrame* f = new QFrame;
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );

	
	QHBoxLayout* flayout = new QHBoxLayout(f);
    flayout->setMargin(0);
    

	JointSlider = new QSlider(Qt::Vertical, this);
    JointSlider->setMaximum(800);
	JointSlider->setValue(20);
    JointSlider->setPageStep(1);
    JointSlider->setTickPosition( QSlider::TicksRight );
	connect( JointSlider, SIGNAL(valueChanged(int)),c,SLOT(setJointScale(int)) );

	SensorSlider = new QSlider(Qt::Vertical, this);
    SensorSlider->setMaximum(800);
	SensorSlider->setValue(20);
    SensorSlider->setPageStep(1);
    SensorSlider->setTickPosition( QSlider::TicksRight );
	connect( SensorSlider, SIGNAL(valueChanged(int)),c,SLOT(setSensorScale(int)) );

	

	QGroupBox *JointGroup = new QGroupBox(tc->toUnicode("ジョイント"));
	QGroupBox *SensorGroup = new QGroupBox(tc->toUnicode("センサ"));

	QVBoxLayout* Jointlayout = new QVBoxLayout();
	Jointlayout->addWidget(JointSlider);
	JointGroup->setLayout(Jointlayout);
	QVBoxLayout* Sensorlayout = new QVBoxLayout();
	Sensorlayout->addWidget(SensorSlider);
	SensorGroup->setLayout(Sensorlayout);
	

	flayout->addWidget( JointGroup, 0 );
	flayout->addWidget( SensorGroup, 1 );
	flayout->addWidget( toolBox, 2 );
	


	

	

	SliderWidget->setLayout(flayout);

}
QmitkPartialVolumeAnalysisWidget::QmitkPartialVolumeAnalysisWidget( QWidget * parent )
  : QmitkPlotWidget(parent)
{
//  this->SetAxisTitle( QwtPlot::xBottom, "Grayvalue" );
  //  this->SetAxisTitle( QwtPlot::yLeft, "Probability" );
//  this->Replot();
  QFrame* canvas = qobject_cast<QFrame*>(m_Plot->canvas());
  if (canvas)
  {
    canvas->setLineWidth(0);
    canvas->setContentsMargins(0,0,0,0);
  }
}
示例#15
0
//-----------------------------------------------------------------------------
// Function: AddressSpaceEditor::setupLayout()
//-----------------------------------------------------------------------------
void AddressSpaceEditor::setupLayout()
{
    QScrollArea* scrollArea = new QScrollArea(this);
    scrollArea->setWidgetResizable(true);
    scrollArea->setFrameShape(QFrame::NoFrame);

    QVBoxLayout* scrollLayout = new QVBoxLayout(this);
    scrollLayout->addWidget(scrollArea);
    scrollLayout->setContentsMargins(0, 0, 0, 0);

    QWidget* topWidget = new QWidget(scrollArea);
    topWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    QVBoxLayout* topLayout = new QVBoxLayout(topWidget);
    
    QHBoxLayout* nameAndGeneralLayout = new QHBoxLayout();
    nameAndGeneralLayout->addWidget(&nameEditor_, 0, Qt::AlignTop);
    nameAndGeneralLayout->addWidget(&generalEditor_);
    topLayout->addLayout(nameAndGeneralLayout);
    topLayout->addWidget(&segmentsEditor_, 1);
    topLayout->setContentsMargins(0, 0, 0, 0);

    QWidget* bottomWidget = new QWidget(scrollArea);
    bottomWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    QVBoxLayout* bottomLayout = new QVBoxLayout(bottomWidget);
    bottomLayout->addWidget(&localMemMapEditor_);
    bottomLayout->setContentsMargins(0, 0, 0, 0);

    QSplitter* verticalSplitter = new QSplitter(Qt::Vertical, scrollArea);
    verticalSplitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    verticalSplitter->addWidget(topWidget);
    verticalSplitter->addWidget(bottomWidget);
    verticalSplitter->setStretchFactor(1, 1);

    QSplitterHandle* handle = verticalSplitter->handle(1);
    QVBoxLayout* handleLayout = new QVBoxLayout(handle);
    handleLayout->setSpacing(0);
    handleLayout->setMargin(0);

    QFrame* line = new QFrame(handle);
    line->setLineWidth(2);
    line->setMidLineWidth(2);
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);
    handleLayout->addWidget(line);

    verticalSplitter->setHandleWidth(10);

    scrollArea->setWidget(verticalSplitter);
}
示例#16
0
WaitScreen::WaitScreen(QWidget *parent ) :
  QDialog( parent, Qt::FramelessWindowHint ),
  progress( 0 ),
  lastRot( 0 ),
  _screenUsage( true )
{
  setObjectName("WaitScreen");

  int scale = Layout::getIntScaledDensity();

  QGridLayout * topLayout  = new QGridLayout;
  topLayout->setMargin(5 * scale);
  topLayout->setSpacing( 10 );
  topLayout->setColumnMinimumWidth(0, 45);

  QGridLayout * backLayout = new QGridLayout(this);
  backLayout->setMargin(0);
  backLayout->addLayout(topLayout, 1, 1);
  backLayout->setRowMinimumHeight(0, 3 * scale);
  backLayout->setRowMinimumHeight(2, 3 * scale);
  backLayout->setColumnMinimumWidth(0, 3 * scale);
  backLayout->setColumnMinimumWidth(2, 3 * scale);

  QFrame* frm = new QFrame(this);
  frm->setFrameStyle(QFrame::Box | QFrame::Plain);
  frm->setLineWidth(3 * scale);
  backLayout->addWidget(frm, 0, 0, 3, 3);

  Glider = new QLabel;
  topLayout->addWidget(Glider, 0, 0, 3, 1);

  QLabel* txt = new QLabel(tr("Cumulus is working, please wait!"), this);
  topLayout->addWidget(txt, 0, 1);

  Text1 = new QLabel;
  topLayout->addWidget(Text1, 1, 1);

  Text2 = new QLabel;
  topLayout->addWidget(Text2, 2, 1);

  _gliders = GeneralConfig::instance()->loadPixmap("gliders.png", false);
  _glider = QPixmap(40, 40);
  _glider.fill( palette().color(backgroundRole()) );

  QPainter p(&_glider);
  p.drawPixmap( 0, 0, _gliders );

  Glider->setPixmap(_glider);
  setVisible( true );
}
void
Panel::initialize( QString panelName )
{
    QFont font;
    font.setFamily( "Calibri" );
    font.setPointSize( 13 );

    const int panelWidth = 256;

    QLabel *panelLabel = new QLabel( panelName );
    panelLabel->setAlignment( Qt::AlignRight );
    panelLabel->setFont( font );

    QToolButton *panelButton = new QToolButton();
    icon.addPixmap( QPixmap(":/Resources/Misc/triangle-left.png"),
		QIcon::Normal, QIcon::Off );
    icon.addPixmap( QPixmap(":/Resources/Misc/triangle-down.png"),
		QIcon::Normal, QIcon::On );
    panelButton->setIcon( icon );
    panelButton->setIconSize( QSize(16,16) );
    panelButton->setAutoRaise( true );
    panelButton->setCheckable( true );

    QFrame *line = new QFrame(); 
    line->setFixedWidth( panelWidth );
    line->setFrameShape( QFrame::HLine ); 
    line->setFrameShadow( QFrame::Sunken ); 
    line->setLineWidth( 0 ); 
    line->setMidLineWidth( 2 ); 

    QHBoxLayout *barLayout = new QHBoxLayout();
    barLayout->addWidget( panelLabel, 1, Qt::AlignVCenter );
    barLayout->addWidget( panelButton, 0, Qt::AlignVCenter );

    panelExtension = new QWidget();
    panelExtension->hide();

    QObject::connect(
	panelButton, SIGNAL(toggled(bool)),
	panelExtension, SLOT(setVisible(bool)) );

    QVBoxLayout *panelLayout = new QVBoxLayout( this );
    panelLayout->addLayout( barLayout );
    panelLayout->addWidget( panelExtension );
    //panelLayout->addSpacing( -2 );
    panelLayout->addWidget( line );

    setLayout( panelLayout );
}
示例#18
0
QmitkODFDetailsWidget::QmitkODFDetailsWidget( QWidget * parent )
  : QmitkPlotWidget(parent)
{
  QFrame* canvas = qobject_cast<QFrame*>(m_Plot->canvas());
  if (canvas)
  {
    canvas->setLineWidth(0);
    canvas->setContentsMargins(0,0,0,0);
  }

  QwtLinearScaleEngine* scale = new QwtLinearScaleEngine();
  m_Plot->setAxisScaleEngine(0, scale);

  m_Plot->setAxisScale   ( 0, -0.5, 0.5 );
}
示例#19
0
// +-----------------------------------------------------------
gc::Questionnaire::Questionnaire(QWidget *pParent): QWidget(pParent)
{
	m_pMainLayout = new QVBoxLayout(this);

	// Create the header
	QBoxLayout *pLayout = new QHBoxLayout();
	m_pMainLayout->addLayout(pLayout);

	QBoxLayout *pHeaderLayout = new QVBoxLayout();
	m_pMainLayout->addLayout(pHeaderLayout);

	m_pTitle = new QLabel(this);
	m_pTitle->setWordWrap(true);
	m_pTitle->setObjectName("questionnaireTitle");
	pHeaderLayout->addWidget(m_pTitle);

	m_pDescription = new QLabel(this);
	m_pDescription->setWordWrap(true);
	m_pDescription->setObjectName("questionnaireDescription");
	pHeaderLayout->addWidget(m_pDescription);

	// Create a separating line
	QFrame *pLine = new QFrame(this);
	pLine->setFrameStyle(QFrame::HLine | QFrame::Raised);
	pLine->setLineWidth(1);
	m_pMainLayout->addWidget(pLine);
	m_pMainLayout->addSpacing(10);

	// Create the questions area
	m_pScrollArea = new QScrollArea(this);
	m_pScrollArea->setWidgetResizable(true);
	m_pScrollArea->setLayout(new QVBoxLayout());
	m_pScrollArea->layout()->setMargin(0);
	m_pMainLayout->addWidget(m_pScrollArea);

	m_pQuestionsArea = new QWidget(this);
	m_pScrollArea->setWidget(m_pQuestionsArea);
	m_pQuestionsArea->setLayout(new QVBoxLayout());
	m_pQuestionsArea->layout()->setSizeConstraint(QLayout::SetMinAndMaxSize);
	m_pQuestionsArea->layout()->setMargin(0);

	// Connections
	m_pMapper = new QSignalMapper(this);
	connect(m_pMapper, static_cast<void(QSignalMapper::*)(int)>(&QSignalMapper::mapped), this, &Questionnaire::fieldChanged);
}
示例#20
0
QmitkIVIMWidget::QmitkIVIMWidget( QWidget * parent )
  : QmitkPlotWidget(parent)
{
  //  this->SetAxisTitle( QwtPlot::xBottom, "Grayvalue" );
  //  this->SetAxisTitle( QwtPlot::yLeft, "Probability" );
  //  this->Replot();
  QFrame* canvas = qobject_cast<QFrame*>(m_Plot->canvas());
  if (canvas)
  {
    canvas->setLineWidth(0);
    canvas->setContentsMargins(0,0,0,0);
  }

  QwtLogScaleEngine* logScale = new QwtLogScaleEngine();
  m_Plot->setAxisScaleEngine(0, logScale);

  m_Plot->setAxisScale( 0, 0.15, 1.0 );
}
//--------------------------------------------------------------------------------------------
//
//--------------------------------------------------------------------------------------------
void tApRudderFeedbackCalibrationWizard::Init()
{
    setWindowTitle( tr( "Rudder Feedback Calibration" ) );
    m_pInstruction = new QLabel(this);
    m_pInstruction->setWordWrap(true);
    m_pInstruction->setMinimumHeight( m_pInstruction->fontMetrics().height() * 3 + 20 );

    QFrame* pHSep = new QFrame(this);
    pHSep->setFrameStyle( QFrame::HLine | QFrame::Plain );
    pHSep->setLineWidth( 1 );

    if( m_bUseDriveProxy )
    {
        m_pRudderBar = new tRudderBar( m_PilotDevice.GetMedusaInterface()->GetDriveSelectedRudderRefAngle(m_xDrive), this );
        Connect(m_xDrive.get(), SIGNAL(DriveParametersChanged(const tN2kName&)), this, SLOT(OnDriveParametersChanged(const tN2kName&)));
    }
    else
    {
示例#22
0
//enables the get button and gets the title that is to be displayed in the GUI
//is called from Downloader.cpp as soon as critical section has been executed
void yLoad::getbuttonenable(QString title, int downloadslotindex)
{
 //the filename for the downloaded pages is data.txt or data(1).txt or etc
 if (title.contains(QString("data"),Qt::CaseInsensitive)==true) title = QString(""); //title = QString("Page download");
 //check if a new DownloadInfoBox must be created or not
 DownloadInfoBox* slotDownloadBox = yLoad::getDownloadInfoBox(top,downloadslotindex);
 if (slotDownloadBox == NULL) //create DownloadInfoBox
 {
  DownloadInfoBox* box = new DownloadInfoBox(this,/*top,*/title,downloadslotindex);
  connect(box, SIGNAL(cancelpushed(int)),this, SLOT(cancelled(int)),Qt::UniqueConnection);
  if (boxlayout->count()!=0)
  {
      QFrame* line = new QFrame;
      if (framelistlength+1>framelistlengthmax)
      {
          //double the list's length
          int newlength = framelistlengthmax*2;
          QFrame** newlist = new QFrame*[newlength];
          for (int i=0;i<newlength;i++)
          {
              if (i<framelistlength) newlist[i] = framelist[i];
              else newlist[i] = 0;
          }
          framelist = newlist;
          framelistlengthmax = newlength;
      }
      framelist[framelistlength] = line;
      framelistlength++;
      line->setFrameShape(QFrame::HLine);
      line->setLineWidth(1);
      boxlayout->addWidget(line);
  }
  boxlayout->addWidget(box);
  //boxcontainer->setLayout(boxlayout);
  //ui->scrollAreaDownloads->setWidget(boxcontainer);
  boxcontainer->resize(491,((boxlayout->count()/2)+1)*120);
  //set top to new DownloadInfoBox ;)
  box->previous = top;
  top = box;
  box->setStatusInformation(0); //page download
 }
示例#23
0
InspectorGroupElement::InspectorGroupElement(QWidget* parent)
   : InspectorBase(parent)
      {
      QWidget* w = new QWidget;
      ge.setupUi(w);
      _layout->insertWidget(_layout->count()-1, w);
      ge.color->setColor(Qt::black);
      connect(ge.setColor, SIGNAL(clicked()), SLOT(setColor()));
      connect(ge.setVisible, SIGNAL(clicked()), SLOT(setVisible()));
      connect(ge.setInvisible, SIGNAL(clicked()), SLOT(setInvisible()));

      //
      // Select
      //
      QLabel* l = new QLabel;
      l->setText(tr("Select"));
      QFont font(l->font());
      font.setBold(true);
      l->setFont(font);
      l->setAlignment(Qt::AlignHCenter);
      _layout->addWidget(l);
      QFrame* f = new QFrame;
      f->setFrameStyle(QFrame::HLine | QFrame::Raised);
      f->setLineWidth(2);
      _layout->addWidget(f);
      QHBoxLayout* hbox = new QHBoxLayout;

      notes = new QToolButton(this);
      notes->setText(tr("Notes"));
      notes->setEnabled(true);
      hbox->addWidget(notes);

      rests = new QToolButton(this);
      rests->setText(tr("Rests"));
      rests->setEnabled(true);
      hbox->addWidget(rests);

      _layout->addLayout(hbox);
      connect(notes, SIGNAL(clicked()), SLOT(notesClicked()));
      connect(rests, SIGNAL(clicked()), SLOT(restsClicked()));
      }
示例#24
0
CGMainWindow::CGMainWindow (QWidget* parent, Qt::WindowFlags flags)
: QMainWindow (parent, flags) {
    resize (604, 614);

    // Create a nice frame to put around the OpenGL widget
    QFrame* f = new QFrame (this);
    f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    f->setLineWidth(2);

    // Create our OpenGL widget
    ogl = new MyTorus (this,f);

	// Create a menu
    QMenu *file = new QMenu("&Draw Methode",this);
    file->addAction ("&Wireframe", this->ogl, SLOT(drawWireFrame()), Qt::CTRL+Qt::Key_W);
    file->addAction ("&Flat-Shading",this->ogl,SLOT(flating()),Qt::CTRL+Qt::Key_F ),
    file->addAction ("&exact Smooth-Shading", this->ogl, SLOT(exactSmoothing()), Qt::CTRL+Qt::Key_S+Qt::Key_E);
    file->addAction ("&Smooth-Shading", this->ogl, SLOT(smoothing()), Qt::CTRL+Qt::Key_S);
    file->addAction ("Quit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q);

    QMenu *colMenu = new QMenu("&Color",this);
    colMenu->addAction ("&Kupfer", this->ogl, SLOT(setKupfer()), Qt::CTRL+Qt::Key_K);
    colMenu->addAction ("&Rubin",this->ogl,SLOT(setRubin()),Qt::CTRL+Qt::Key_R ),
    colMenu->addAction ("&Smaragd", this->ogl, SLOT(setSmaragd()), Qt::CTRL+Qt::Key_M);
    colMenu->addAction ("&Silber", this->ogl, SLOT(setSilber()), Qt::CTRL+Qt::Key_I);

    menuBar()->addMenu(file);
    menuBar()->addMenu(colMenu);


	// Put the GL widget inside the frame
	QHBoxLayout* layout = new QHBoxLayout();
	layout->addWidget(ogl);
	layout->setMargin(0);
	f->setLayout(layout);

	setCentralWidget(f);

	statusBar()->showMessage("Ready",1000);
}
示例#25
0
LineEditDialog::LineEditDialog(QString title, QWidget* parent) : QDialog(parent, Qt::Popup) {
  QLabel* label = new QLabel(title);
  edit = new QLineEdit(this);
//  edit->setGeometry(1, 1, 150, 23);
  connect(edit, SIGNAL(editingFinished()), this, SLOT(accept()));

  QVBoxLayout* layout = new QVBoxLayout(this);
  layout->setMargin(4);
  layout->addWidget(label);
  layout->addWidget(edit);

  QFrame* frame = new QFrame();
  frame->setFrameStyle(QFrame::Panel | QFrame::Raised);
  frame->setLineWidth(2);
  frame->setLayout(layout);

  QVBoxLayout* mainLayout = new QVBoxLayout();
  mainLayout->setMargin(0);
  mainLayout->addWidget(frame);
  setLayout(mainLayout);

  QFontMetrics fontMetrics(label->font());
  const int width = std::max(200, fontMetrics.boundingRect(title).width() + 20), height = 50;

  QDesktopWidget desk;
  int screenWidth = 0, screenHeight = 0;

  for (int iScreen = 0; iScreen <= desk.screenNumber(QCursor::pos()); ++iScreen) {
    screenWidth  += desk.screenGeometry(iScreen).width();
    screenHeight += desk.screenGeometry(iScreen).height();
  }

  setGeometry(std::min(screenWidth - width - 10, QCursor::pos().x()),
      std::min(screenHeight - height - 10, QCursor::pos().y()),
      width, height);

  edit->setFocus();
}
示例#26
0
GLObjectWindow::GLObjectWindow( QWidget* parent, const char* name )
    : QWidget( parent, name )
{
    // Create a menu
    QPopupMenu *file = new QPopupMenu( this );
    file->insertItem( "Exit",  qApp, SLOT(quit()), CTRL+Key_Q );

    // Create a menu bar
    QMenuBar *m = new QMenuBar( this );
    m->setSeparator( QMenuBar::InWindowsStyle );
    m->insertItem("&File", file );

    // Create a nice frame to put around the OpenGL widget
    QFrame* f = new QFrame( this, "frame" );
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );

    // Create our OpenGL widget.
    GLTeapots* c = new GLTeapots( f, "glteapots" );

    // Check if we obtained an overlay
    if ( !c->format().hasOverlay() ) {
	QMessageBox::warning( 0, qApp->argv()[0], 
			      "Failed to get an OpenGL overlay",
			      "Ok" );
    }

    // Now that we have all the widgets, put them into a nice layout

    // Put the GL widget inside the frame
    QHBoxLayout* flayout = new QHBoxLayout( f, 2, 2, "flayout");
    flayout->addWidget( c, 1 );

    // Top level layout
    QVBoxLayout* hlayout = new QVBoxLayout( this, 20, 20, "hlayout");
    hlayout->setMenuBar( m );
    hlayout->addWidget( f, 1 );
}
示例#27
0
void HandViewWindow::initViews(Hand * h)
{
 grid = new QGridLayout(vbox2,3,1);//Set the second parameter to 1 for single column

  for(unsigned int i = 0; i < maxViewSize; ++i)
    {

      QFrame * viewWindowFrame = new QFrame(handViewWindow);
      double t = h->getPalm()->getTransparency();
      h->setTransparency(0);
      HandView * hv = new HandView(graspItGUI->getIVmgr()->getViewer(), h, *viewWindowFrame, QString::number(i));        //add a view
      h->setTransparency(t);
      if(i == 0){
        viewWindowFrame->setFrameStyle(QFrame::Box| QFrame::Plain);
        hv->getViewViewer()->setBorder(true);
      }
      else{
      viewWindowFrame->setFrameStyle(QFrame::Box | QFrame::Raised);
      }
      viewWindowFrame->setLineWidth(2);
      views.push_back(hv);
      grid->addWidget(viewWindowFrame);
    }
}
示例#28
0
文件: toolbar.cpp 项目: videolan/vlc
/* Overloading the AbstractController one, because we don't manage the
   Spacing items in the same ways */
void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
                                             int i_index,
                                             buttonType_e i_type,
                                             int i_option )
{
    /* Special case for SPACERS, who aren't QWidgets */
    if( i_type == WIDGET_SPACER || i_type == WIDGET_SPACER_EXTEND )
    {
        QLabel *label = new QLabel( this );
        label->setPixmap( ImageHelper::loadSvgToPixmap( ":/toolbar/space.svg", height(), height() ) );
        if( i_type == WIDGET_SPACER_EXTEND )
        {
            label->setSizePolicy( QSizePolicy::MinimumExpanding,
                    QSizePolicy::Preferred );

            /* Create a box around it */
            label->setFrameStyle( QFrame::Panel | QFrame::Sunken );
            label->setLineWidth ( 1 );
            label->setAlignment( Qt::AlignCenter );
        }
        else
            label->setSizePolicy( QSizePolicy::Fixed,
                    QSizePolicy::Preferred );

        /* Install event Filter for drag'n drop */
        label->installEventFilter( this );
        newControlLayout->insertWidget( i_index, label );
    }

    /* Normal Widgets */
    else
    {
        QWidget *widg = createWidget( i_type, i_option );
        if( !widg ) return;

        /* Install the Event Filter in order to catch the drag */
        widg->setParent( this );
        widg->installEventFilter( this );

        /* We are in a complex widget, we need to stop events on children too */
        if( i_type >= TIME_LABEL && i_type < SPECIAL_MAX )
        {
            QList<QObject *>children = widg->children();

            QObject *child;
            foreach( child, children )
            {
                QWidget *childWidg;
                if( ( childWidg = qobject_cast<QWidget *>( child ) ) )
                {
                    child->installEventFilter( this );
                    childWidg->setEnabled( true );
                }
            }

            /* Decorating the frames when possible */
            QFrame *frame;
            if( (i_type >= MENU_BUTTONS || i_type == TIME_LABEL) /* Don't bother to check for volume */
                && ( frame = qobject_cast<QFrame *>( widg ) ) != NULL )
            {
                frame->setFrameStyle( QFrame::Panel | QFrame::Raised );
                frame->setLineWidth ( 1 );
            }
        }
示例#29
0
文件: toolbar.cpp 项目: videolan/vlc
/************************************************
 *  Widget Listing:
 * Creation of the list of drawed lovely buttons
 ************************************************/
WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
              : QListWidget( _parent )
{
    /* We need the parent to know the options checked */
    parent = qobject_cast<ToolbarEditDialog *>(_parent);
    assert( parent );

    /* Normal options */
    setViewMode( QListView::ListMode );
    setTextElideMode( Qt::ElideNone );
    setDragEnabled( true );
    int icon_size = fontMetrics().height();
    setIconSize( QSize( icon_size * 2, icon_size ) );
    /* All the buttons do not need a special rendering */
    for( int i = 0; i < BUTTON_MAX; i++ )
    {
        QListWidgetItem *widgetItem = new QListWidgetItem( this );
        widgetItem->setText( qtr( nameL[i] ) );
        widgetItem->setSizeHint( QSize( widgetItem->sizeHint().width(), 32 ) );

        widgetItem->setIcon( QIcon( iconL[i] ) );
        widgetItem->setData( Qt::UserRole, QVariant( i ) );
        widgetItem->setToolTip( widgetItem->text() );
        addItem( widgetItem );
    }

    /* Spacers are yet again a different thing */
    QListWidgetItem *widgetItem = new QListWidgetItem( QIcon( ":/toolbar/space.svg" ),
            qtr( "Spacer" ), this );
    widgetItem->setData( Qt::UserRole, WIDGET_SPACER );
    widgetItem->setToolTip( widgetItem->text() );
    widgetItem->setSizeHint( QSize( widgetItem->sizeHint().width(), 32 ) );
    addItem( widgetItem );

    widgetItem = new QListWidgetItem( QIcon( ":/toolbar/space.svg" ),
            qtr( "Expanding Spacer" ), this );
    widgetItem->setData( Qt::UserRole, WIDGET_SPACER_EXTEND );
    widgetItem->setToolTip( widgetItem->text() );
    widgetItem->setSizeHint( QSize( widgetItem->sizeHint().width(), 32 ) );
    addItem( widgetItem );

    /**
     * For all other widgets, we create then, do a pseudo rendering in
     * a pixmaps for the view, and delete the object
     *
     * A lot of code is retaken from the Abstract, but not exactly...
     * So, rewrite.
     * They are better ways to deal with this, but I doubt that this is
     * necessary. If you feel like you have the time, be my guest.
     * --
     * jb
     **/
    for( int i = SPLITTER; i < SPECIAL_MAX; i++ )
    {
        QWidget *widget = NULL;
        QListWidgetItem *widgetItem = new QListWidgetItem;
        widgetItem->setSizeHint( QSize( widgetItem->sizeHint().width(), 32 ) );
        switch( i )
        {
        case SPLITTER:
            {
                QFrame *line = new QFrame( this );
                line->setFrameShape( QFrame::VLine );
                line->setFrameShadow( QFrame::Raised );
                line->setLineWidth( 0 ); line->setMidLineWidth( 1 );
                widget = line;
            }
            widgetItem->setText( qtr("Splitter") );
            break;
        case INPUT_SLIDER:
            {
                SeekSlider *slider = new SeekSlider( p_intf, Qt::Horizontal, this );
                widget = slider;
            }
            widgetItem->setText( qtr("Time Slider") );
            break;
        case VOLUME:
            {
                SoundWidget *snd = new SoundWidget( this, p_intf,
                        parent->getOptions() & WIDGET_SHINY );
                widget = snd;
            }
            widgetItem->setText( qtr("Volume") );
            break;
        case VOLUME_SPECIAL:
            {
                QListWidgetItem *widgetItem = new QListWidgetItem( this );
                widgetItem->setText( qtr("Small Volume") );
                widgetItem->setIcon( QIcon( ":/toolbar/volume-medium.svg" ) );
                widgetItem->setData( Qt::UserRole, QVariant( i ) );
                addItem( widgetItem );
            }
            continue;
        case TIME_LABEL:
            {
                QLabel *timeLabel = new QLabel( "12:42/2:12:42", this );
                widget = timeLabel;
            }
            widgetItem->setText( qtr("Time") );
            break;
        case MENU_BUTTONS:
            {
                QWidget *discFrame = new QWidget( this );
                //discFrame->setLineWidth( 1 );
                QHBoxLayout *discLayout = new QHBoxLayout( discFrame );
                discLayout->setSpacing( 0 ); discLayout->setMargin( 0 );

                QToolButton *prevSectionButton = new QToolButton( discFrame );
                prevSectionButton->setIcon( QIcon( ":/toolbar/dvd_prev.svg" ) );
                prevSectionButton->setToolTip( qtr("Previous Chapter/Title" ) );
                discLayout->addWidget( prevSectionButton );

                QToolButton *nextButton = new QToolButton( discFrame );
                nextButton->setIcon( QIcon( ":/toolbar/dvd_next.svg" ) );
                nextButton->setToolTip( qtr("Next Chapter/Title" ) );
                discLayout->addWidget( nextButton );

                QToolButton *menuButton = new QToolButton( discFrame );
                menuButton->setIcon( QIcon( ":/toolbar/dvd_menu.svg" ) );
                menuButton->setToolTip( qtr( "Menu" ) );
                discLayout->addWidget( menuButton );

                widget = discFrame;
            }
            widgetItem->setText( qtr("DVD menus") );
            break;
        case TELETEXT_BUTTONS:
            {
                QWidget *telexFrame = new QWidget( this );
                QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame );
                telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 );

                QToolButton *telexOn = new QToolButton( telexFrame );
                telexOn->setIcon( QIcon( ":/toolbar/tv.svg" ) );
                telexLayout->addWidget( telexOn );

                QToolButton *telexTransparent = new QToolButton;
                telexTransparent->setIcon( QIcon( ":/toolbar/tvtelx.svg" ) );
                telexTransparent->setToolTip( qtr("Teletext transparency") );
                telexLayout->addWidget( telexTransparent );

                QSpinBox *telexPage = new QSpinBox;
                telexLayout->addWidget( telexPage );

                widget = telexFrame;
            }
            widgetItem->setText( qtr("Teletext") );
            break;
        case ADVANCED_CONTROLLER:
            {
                AdvControlsWidget *advControls = new AdvControlsWidget( p_intf, this );
                widget = advControls;
            }
            widgetItem->setText( qtr("Advanced Buttons") );
            break;
        case PLAYBACK_BUTTONS:
            {
                widget = new QWidget;
                DeckButtonsLayout *layout = new DeckButtonsLayout( widget );
                BrowseButton *prev = new BrowseButton( widget, BrowseButton::Backward );
                BrowseButton *next = new BrowseButton( widget );
                RoundButton *play = new RoundButton( widget );
                layout->setBackwardButton( prev );
                layout->setForwardButton( next );
                layout->setRoundButton( play );
            }
            widgetItem->setText( qtr("Playback Buttons") );
            break;
        case ASPECT_RATIO_COMBOBOX:
            widget = new AspectRatioComboBox( p_intf, THEMIM->getAspectRatio() );
            widgetItem->setText( qtr("Aspect ratio selector") );
            break;
        case SPEED_LABEL:
            widget = new SpeedLabel( p_intf, this );
            widgetItem->setText( qtr("Speed selector") );
            break;
        case TIME_LABEL_ELAPSED:
            widget = new QLabel( "2:42", this );
            widgetItem->setText( qtr("Elapsed time") );
            break;
        case TIME_LABEL_REMAINING:
            widget = new QLabel( "-2:42", this );
            widgetItem->setText( qtr("Total/Remaining time") );
            break;
        default:
            msg_Warn( p_intf, "This should not happen %i", i );
            break;
        }

        if( widget == NULL ) continue;


        widgetItem->setIcon( QIcon( widget->grab() ) );
        widgetItem->setToolTip( widgetItem->text() );
        widget->hide();
        widgetItem->setData( Qt::UserRole, QVariant( i ) );

        addItem( widgetItem );
        delete widget;
    }
}
示例#30
0
void MainWindow::createSliderArrowWidget()
{
	SliderArrowWidget = new QWidget;

	QFrame* f = new QFrame;
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );

	
	QHBoxLayout* flayout = new QHBoxLayout(f);
    flayout->setMargin(0);
    


	ArrowForceSlider = new QSlider(Qt::Vertical, this);
    ArrowForceSlider->setMaximum(800);
	ArrowForceSlider->setValue(80);
    ArrowForceSlider->setPageStep(1);
    ArrowForceSlider->setTickPosition( QSlider::TicksRight );
	connect( ArrowForceSlider, SIGNAL(valueChanged(int)),c,SLOT(setForceArrowScale(int)) );

	
	QGroupBox *ArrowForceGroup = new QGroupBox(tc->toUnicode("力センサ"));

	
	QVBoxLayout* ArrowForcelayout = new QVBoxLayout();
	ArrowForcelayout->addWidget(ArrowForceSlider);
	ArrowForceGroup->setLayout(ArrowForcelayout);

	flayout->addWidget( ArrowForceGroup, 0 );

	ArrowGyroSlider = new QSlider(Qt::Vertical, this);
    ArrowGyroSlider->setMaximum(800);
	ArrowGyroSlider->setValue(80);
    ArrowGyroSlider->setPageStep(1);
    ArrowGyroSlider->setTickPosition( QSlider::TicksRight );
	connect( ArrowGyroSlider, SIGNAL(valueChanged(int)),c,SLOT(setGyroArrowScale(int)) );

	
	QGroupBox *ArrowGyroGroup = new QGroupBox(tc->toUnicode("ジャイロセンサ"));

	
	QVBoxLayout* ArrowGyrolayout = new QVBoxLayout();
	ArrowGyrolayout->addWidget(ArrowGyroSlider);
	ArrowGyroGroup->setLayout(ArrowGyrolayout);

	flayout->addWidget( ArrowGyroGroup, 1 );

	ArrowAccSlider = new QSlider(Qt::Vertical, this);
    ArrowAccSlider->setMaximum(800);
	ArrowAccSlider->setValue(80);
    ArrowAccSlider->setPageStep(1);
    ArrowAccSlider->setTickPosition( QSlider::TicksRight );
	connect( ArrowAccSlider, SIGNAL(valueChanged(int)),c,SLOT(setAccArrowScale(int)) );

	
	QGroupBox *ArrowAccGroup = new QGroupBox(tc->toUnicode("加速度センサ"));

	
	QVBoxLayout* ArrowAcclayout = new QVBoxLayout();
	ArrowAcclayout->addWidget(ArrowAccSlider);
	ArrowAccGroup->setLayout(ArrowAcclayout);

	flayout->addWidget( ArrowAccGroup, 2 );

	ArrowRangeSlider = new QSlider(Qt::Vertical, this);
    ArrowRangeSlider->setMaximum(800);
	ArrowRangeSlider->setValue(80);
    ArrowRangeSlider->setPageStep(1);
    ArrowRangeSlider->setTickPosition( QSlider::TicksRight );
	connect( ArrowRangeSlider, SIGNAL(valueChanged(int)),c,SLOT(setRangeArrowScale(int)) );

	
	QGroupBox *ArrowRangeGroup = new QGroupBox(tc->toUnicode("距離センサ"));

	
	QVBoxLayout* ArrowRangelayout = new QVBoxLayout();
	ArrowRangelayout->addWidget(ArrowRangeSlider);
	ArrowRangeGroup->setLayout(ArrowRangelayout);

	flayout->addWidget( ArrowRangeGroup, 3 );

	ArrowTorqueSlider = new QSlider(Qt::Vertical, this);
    ArrowTorqueSlider->setMaximum(800);
	ArrowTorqueSlider->setValue(80);
    ArrowTorqueSlider->setPageStep(1);
    ArrowTorqueSlider->setTickPosition( QSlider::TicksRight );
	connect( ArrowTorqueSlider, SIGNAL(valueChanged(int)),c,SLOT(setTorqueArrowScale(int)) );

	
	QGroupBox *ArrowTorqueGroup = new QGroupBox(tc->toUnicode("トルクセンサ"));

	
	QVBoxLayout* ArrowTorquelayout = new QVBoxLayout();
	ArrowTorquelayout->addWidget(ArrowTorqueSlider);
	ArrowTorqueGroup->setLayout(ArrowTorquelayout);

	flayout->addWidget( ArrowTorqueGroup, 4 );

	

	

	SliderArrowWidget->setLayout(flayout);

}