Пример #1
0
void QMainWindow::setToolTipGroup( QToolTipGroup * newToolTipGroup )
{
    if ( !newToolTipGroup || newToolTipGroup == d->ttg )
	return;
    if ( d->ttg )
	delete d->ttg;
    d->ttg = newToolTipGroup;

    connect( toolTipGroup(), SIGNAL(showTip(const char *)),
	     statusBar(), SLOT(message(const char *)) );
    connect( toolTipGroup(), SIGNAL(removeTip()),
	     statusBar(), SLOT(clear()) );
    triggerLayout();
}
Пример #2
0
void QMainWindow::setStatusBar( QStatusBar * newStatusBar )
{
    if ( !newStatusBar || newStatusBar == d->sb )
	return;
    if ( d->sb )
	delete d->sb;
    d->sb = newStatusBar;
    connect( toolTipGroup(), SIGNAL(showTip(const char *)),
	     d->sb, SLOT(message(const char *)) );
    connect( toolTipGroup(), SIGNAL(removeTip()),
	     d->sb, SLOT(clear()) );
    d->sb->installEventFilter( this );
    triggerLayout();
}
Пример #3
0
status_t TipManager::removeAll(
	BView*					view) {

	return removeTip(BRect(), view);
}
AssemblyMainWindow::AssemblyMainWindow(QWidget *parent) :
	QMainWindow( parent )
,	mpTrack( 0 )
,	mCurrentTerrainBrush( 0 )
,	ui( new Ui::AssemblyMainWindow )
,	trackView( new TrackView() )
{	
	trackView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
	trackView->setMinimumSize( 100, 100 );

	ui->setupUi(this);
	QGridLayout* container_layout = new QGridLayout( ui->viewContainer );
	//((QGridLayout*) ui->CentralFrame->layout())->addWidget( trackView, 1, 1 );

	container_layout->setContentsMargins( 0, 0, 0, 0 );
	container_layout->setSpacing( 0 );

	container_layout->addWidget( trackView, 0, 0 );

	// konfiguruje suwaki:
	ui->horizontalScrollBar->setSingleStep( 5 );
	ui->horizontalScrollBar->setPageStep( 20 );
	ui->horizontalScrollBar->setMinimum( 0 );


	ui->verticalScrollBar->setSingleStep( 5 );
	ui->verticalScrollBar->setPageStep( 20 );
	ui->verticalScrollBar->setMinimum( 0 );

	// status bar:
	connect( trackView, SIGNAL(showTip(QString)), ui->statusBar, SLOT(showMessage(QString)) );
	connect( trackView, SIGNAL(removeTip()), ui->statusBar, SLOT(clearMessage()) );

	// zakresy:
	connect( trackView, SIGNAL(horizontalSliderRangeChanged(int)), this, SLOT(setHorizontalSliderMaximum(int)) );
	connect( trackView, SIGNAL(verticalSliderRangeChanged(int)), this, SLOT(setVerticalSliderMaximum(int)) );

	// wlaczanie i wylaczanie scrollbarow:
	connect( trackView, SIGNAL(horizontalSliderEnabled(bool)), ui->horizontalScrollBar, SLOT(setEnabled(bool)));
	connect( trackView, SIGNAL(verticalSliderEnabled(bool)), ui->verticalScrollBar, SLOT(setEnabled(bool)));

	// sprzezenie zwrotne scrollbarow do TrackView:
	connect( ui->horizontalScrollBar, SIGNAL(valueChanged(int)), trackView, SLOT(setHorizontalPosition(int)) );
	connect( ui->verticalScrollBar, SIGNAL(valueChanged(int)), trackView, SLOT(setVerticalPosition(int)) );

	// guzik wczytywania obrazkow:
	connect( ui->loadImageButton, SIGNAL(clicked()), this, SLOT(loadImage()) );

	// taby:
	connect( ui->tabWidget, SIGNAL(currentChanged(int)), trackView, SLOT(setMode(int)) );
	connect( ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(prepareTab(int)) );

	// siatka:
	connect( ui->gridSlider, SIGNAL(valueChanged(int)), this, SLOT(setGridDensity(int)) );

	// menu:
	connect( ui->actionNewTrack, SIGNAL(triggered()), this, SLOT(newTrack()) );
	connect( ui->actionOpen, SIGNAL(triggered()), this, SLOT(openTrack()) );
	connect( ui->actionSave, SIGNAL(triggered()), this, SLOT(saveTrack()) );
	connect( ui->actionSaveAs, SIGNAL(triggered()), this, SLOT(saveTrackAs()) );
	connect( ui->actionClose, SIGNAL(triggered()), this, SLOT(close()) );
	connect( ui->actionDrawGrid, SIGNAL(toggled(bool)), trackView, SLOT(drawGrid(bool)) );

	// zakladka terenu:
	connect( ui->comboTerrainBrushType, SIGNAL(currentIndexChanged(int)), this, SLOT(terrainChangeBrush(int)) );
	connect( ui->comboTerrainBrushType, SIGNAL(currentIndexChanged(int)), trackView, SLOT(setBrushId(int)) );
	connect( ui->sliderTerrainBrushSize, SIGNAL(valueChanged(int)), trackView, SLOT(setBrushSize(int)) );
	connect( ui->sliderTerrainIntensity, SIGNAL(valueChanged(int)), trackView, SLOT(setBrushIntensity(int)) );
	connect( ui->sliderTerrainBrushSize, SIGNAL(valueChanged(int)),ui->lineTerrainBrushSize,SLOT(setValue(int)) );
	connect( ui->sliderTerrainIntensity, SIGNAL(valueChanged(int)),ui->lineTerrainIntensity,SLOT(setValue(int)) );

	// koncowa inicjalizacja...
	disableMenus();
}
Пример #5
0
kdvi::kdvi( char *fname, QWidget *, const char *name )
    : KTopLevelWidget( name )
{
    msg = NULL;
    ssmenu = NULL;
    hbl = NULL;
    prefs = NULL;

    keys = new KAccel(this);

    readConfig();
    setMinimumSize( 400, 60 );
    setCaption( kapp->getCaption() );
    tipgroup = new QToolTipGroup( this, "TipGroup" );
    connect( tipgroup, SIGNAL(showTip(const char *)), SLOT(showTip(const char *)) );
    connect( tipgroup, SIGNAL(removeTip()), SLOT(removeTip()) );

    // Create KPanner for toolBar2 and dviwindow

    kpan = new KPanner( this, "panner",
                        KPanner::O_VERTICAL|KPanner::U_ABSOLUTE, 100);
    setView( kpan, TRUE );
    setFrameBorderWidth( 4 );
    kpan->setAbsSeparator( pannerValue );
    connect( kpan, SIGNAL(positionChanged()), SLOT(pannerChanged()) );

    // Create a dvi window

    dviwin = new dviWindow( basedpi, mfmode, paper, makepk,
                            kpan->child1(), "dviWindow" );
    connect( dviwin, SIGNAL(currentPage(int)), SLOT(setPage(int)) );
    connect( dviwin, SIGNAL(shrinkChanged(int)), SLOT(shrinkChanged(int)) );
    connect( dviwin, SIGNAL(fileChanged()), SLOT(fileChanged()) );
    connect( dviwin, SIGNAL(statusChange(const char *)),
             SLOT(showTip(const char *)) );
    connect( dviwin, SIGNAL(setPoint(QPoint)), SLOT(showPoint(QPoint)) );

    // Create a menubar

    menuBar = NULL;
    makeMenuBar();

    // Create toolbars

    toolBar = NULL;
    makeButtons();
    makeToolBar2( kpan->child0() );

    // Create a statusbar

    statusBar = NULL;
    makeStatusBar( i18n("No document") );

    // Lay out widgets

    QBoxLayout *l;
    l = new QBoxLayout( kpan->child0(), QBoxLayout::LeftToRight );
    l->addWidget( toolBar2 );
    l->activate();
    l = new QBoxLayout( kpan->child1(), QBoxLayout::LeftToRight );
    l->addWidget( dviwin );
    l->activate();

    // Create RMB menu

    rmbmenu = new QPopupMenu;
    rmbmenu->setMouseTracking( TRUE );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Toggle Menubar")),
                          this, SLOT(toggleShowMenubar()) );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Mark page")),
                          marklist, SLOT(markSelected()) );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Redraw")),
                          dviwin, SLOT(drawPage()) );
    rmbmenu->connectItem( rmbmenu->insertItem(i18n("Preferences ...")),
                          this, SLOT(optionsPreferences()) );

    // Bind keys

    bindKeys();
    updateMenuAccel();

// Drag and drop

    KDNDDropZone * dropZone = new KDNDDropZone( this , DndURL);
    connect( dropZone, SIGNAL( dropAction( KDNDDropZone *) ),
             SLOT( dropEvent( KDNDDropZone *) ) );

    // Read config options

    applyPreferences();

    selectSmall();
    dviwin->installEventFilter( this );

    message( "" );
    openFile(QString(fname));
}