Beispiel #1
0
void ViWaveWidgetGroup::updateBindings()
{
	ViWaveWidget *widget;
	ViWaveWidgetGroup::Action action;
	foreach(widget, mWidgets)
	{
		widget->disconnect(this);
		foreach(action, mActions)
		{
			if(action == ViWaveWidgetGroup::Zoom)
			{
				QObject::connect(widget, SIGNAL(zoomChanged(qint16)), this, SLOT(changeZoom(qint16)));
			}
			else if(action == ViWaveWidgetGroup::Pointer)
			{
				QObject::connect(widget, SIGNAL(pointerChanged(qint32)), this, SLOT(changePointer(qint32)));
			}
			else if(action == ViWaveWidgetGroup::Position)
			{
				QObject::connect(widget, SIGNAL(positionChanged(ViAudioPosition)), this, SLOT(changePosition(ViAudioPosition)));
			}
			else if(action == ViWaveWidgetGroup::Toolbars)
			{
				QObject::connect(widget, SIGNAL(toolbarsShown()), this, SLOT(showToolbars()));
				QObject::connect(widget, SIGNAL(toolbarsHidden()), this, SLOT(hideToolbars()));
			}
		}
	}
Beispiel #2
0
TileView::TileView(int internalId) : PixelEditor(16, 16, 1)
{
    m_tileId = 0;
    m_internalId = internalId;
    m_allowedDragWidget = 0;
    setEditable(false);
    changeZoom(2);
    setGrid(true);
}
Beispiel #3
0
/**
 * SpinBox 내용이 변경되었을 때 호출되는 Slot
 */
void RightPanel::changeZoom()
{
	if (objectpanelMPP == spinBoxZoom->value()) return;

	if (mapcanvasMPP != spinBoxZoom->value()) {
		objectpanelMPP = spinBoxZoom->value();
		emit changeZoom(objectpanelMPP);
	}
}
void
SystemTopologyDrawing::changeZoom( double factor )
{
    // check if minimum zoom level has been reached
    int oldWidth           = getBaseLineWidth();
    int minPixelPerElement = data->getLineType() == NO_LINES ? 1 : 2;
    int minWidth           = data->getDim( XX ) * minPixelPerElement;
    //qDebug() << "changeZoom:" << oldWidth << minWidth << transform->getAbsoluteScaleFactor();
    if ( ( factor < 1 ) && ( oldWidth <= minWidth ) )
    {
        return;                                         // minimum size reached
    }
    // if BaseLineWidth isn't reduced to number of elements in x direction,
    // ensure that recursion is aborted
    bool factorTooSmall = transform->getAbsoluteScaleFactor() < ( 1. * data->getDim( XX ) / parentSize.width() );
    if ( factorTooSmall && factor < 1 )
    {
        return;
    }

    // set data
    transform->zoom( factor );

    // scale and draw topology
    double x, y, z;
    plane.getTopLeftPoint( x, y, z );
    plane.scale( x, y, z, transform->getRelativeScaleFactor() );
    int newWidth = getBaseLineWidth();


    // if result hasn't changed, try to zoom with the same factor again
    bool changed = oldWidth != newWidth;
    if ( !changed && ( newWidth >= minWidth ) )
    {
        changeZoom( factor );
    }
    else
    {
        draw();
    }
}
HtmlEditor::HtmlEditor(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui_MainWindow)
        , sourceDirty(true)
        , highlighter(0)
        , ui_dialog(0)
        , insertHtmlDialog(0)
{
    ui->setupUi(this);
    ui->tabWidget->setTabText(0, "Normal View");
    ui->tabWidget->setTabText(1, "HTML Source");
    connect(ui->tabWidget, SIGNAL(currentChanged(int)), SLOT(changeTab(int)));
    resize(600, 600);

    highlighter = new Highlighter(ui->plainTextEdit->document());

    QWidget *spacer = new QWidget(this);
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
    ui->standardToolBar->insertWidget(ui->actionZoomOut, spacer);

    zoomLabel = new QLabel;
    ui->standardToolBar->insertWidget(ui->actionZoomOut, zoomLabel);

    zoomSlider = new QSlider(this);
    zoomSlider->setOrientation(Qt::Horizontal);
    zoomSlider->setMaximumWidth(150);
    zoomSlider->setRange(25, 400);
    zoomSlider->setSingleStep(25);
    zoomSlider->setPageStep(100);
    connect(zoomSlider, SIGNAL(valueChanged(int)), SLOT(changeZoom(int)));
    ui->standardToolBar->insertWidget(ui->actionZoomIn, zoomSlider);

    connect(ui->actionFileNew, SIGNAL(triggered()), SLOT(fileNew()));
    connect(ui->actionFileOpen, SIGNAL(triggered()), SLOT(fileOpen()));
    connect(ui->actionFileSave, SIGNAL(triggered()), SLOT(fileSave()));
    connect(ui->actionFileSaveAs, SIGNAL(triggered()), SLOT(fileSaveAs()));
    connect(ui->actionExit, SIGNAL(triggered()), SLOT(close()));
    connect(ui->actionInsertImage, SIGNAL(triggered()), SLOT(insertImage()));
    connect(ui->actionCreateLink, SIGNAL(triggered()), SLOT(createLink()));
    connect(ui->actionInsertHtml, SIGNAL(triggered()), SLOT(insertHtml()));
    connect(ui->actionZoomOut, SIGNAL(triggered()), SLOT(zoomOut()));
    connect(ui->actionZoomIn, SIGNAL(triggered()), SLOT(zoomIn()));

    // these are forward to internal QWebView
    FORWARD_ACTION(ui->actionEditUndo, QWebPage::Undo);
    FORWARD_ACTION(ui->actionEditRedo, QWebPage::Redo);
    FORWARD_ACTION(ui->actionEditCut, QWebPage::Cut);
    FORWARD_ACTION(ui->actionEditCopy, QWebPage::Copy);
    FORWARD_ACTION(ui->actionEditPaste, QWebPage::Paste);
    FORWARD_ACTION(ui->actionFormatBold, QWebPage::ToggleBold);
    FORWARD_ACTION(ui->actionFormatItalic, QWebPage::ToggleItalic);
    FORWARD_ACTION(ui->actionFormatUnderline, QWebPage::ToggleUnderline);

    // Qt 4.5.0 has a bug: always returns 0 for QWebPage::SelectAll
    connect(ui->actionEditSelectAll, SIGNAL(triggered()), SLOT(editSelectAll()));

    connect(ui->actionStyleParagraph, SIGNAL(triggered()), SLOT(styleParagraph()));
    connect(ui->actionStyleHeading1, SIGNAL(triggered()), SLOT(styleHeading1()));
    connect(ui->actionStyleHeading2, SIGNAL(triggered()), SLOT(styleHeading2()));
    connect(ui->actionStyleHeading3, SIGNAL(triggered()), SLOT(styleHeading3()));
    connect(ui->actionStyleHeading4, SIGNAL(triggered()), SLOT(styleHeading4()));
    connect(ui->actionStyleHeading5, SIGNAL(triggered()), SLOT(styleHeading5()));
    connect(ui->actionStyleHeading6, SIGNAL(triggered()), SLOT(styleHeading6()));
    connect(ui->actionStylePreformatted, SIGNAL(triggered()), SLOT(stylePreformatted()));
    connect(ui->actionStyleAddress, SIGNAL(triggered()), SLOT(styleAddress()));
    connect(ui->actionFormatFontName, SIGNAL(triggered()), SLOT(formatFontName()));
    connect(ui->actionFormatFontSize, SIGNAL(triggered()), SLOT(formatFontSize()));
     connect(ui->actionFormatTextColor, SIGNAL(triggered()), SLOT(formatTextColor()));
    connect(ui->actionFormatBackgroundColor, SIGNAL(triggered()), SLOT(formatBackgroundColor()));

    // no page action exists yet for these, so use execCommand trick
    connect(ui->actionFormatStrikethrough, SIGNAL(triggered()), SLOT(formatStrikeThrough()));
    connect(ui->actionFormatAlignLeft, SIGNAL(triggered()), SLOT(formatAlignLeft()));
    connect(ui->actionFormatAlignCenter, SIGNAL(triggered()), SLOT(formatAlignCenter()));
    connect(ui->actionFormatAlignRight, SIGNAL(triggered()), SLOT(formatAlignRight()));
    connect(ui->actionFormatAlignJustify, SIGNAL(triggered()), SLOT(formatAlignJustify()));
    connect(ui->actionFormatDecreaseIndent, SIGNAL(triggered()), SLOT(formatDecreaseIndent()));
    connect(ui->actionFormatIncreaseIndent, SIGNAL(triggered()), SLOT(formatIncreaseIndent()));
    connect(ui->actionFormatNumberedList, SIGNAL(triggered()), SLOT(formatNumberedList()));
    connect(ui->actionFormatBulletedList, SIGNAL(triggered()), SLOT(formatBulletedList()));


    // necessary to sync our actions
    connect(ui->webView->page(), SIGNAL(selectionChanged()), SLOT(adjustActions()));

    connect(ui->webView->page(), SIGNAL(contentsChanged()), SLOT(adjustSource()));
    ui->webView->setFocus();

    setCurrentFileName(QString());

    QString initialFile = ":/example.html";
    const QStringList args = QCoreApplication::arguments();
    if (args.count() == 2)
        initialFile = args.at(1);

    if (!load(initialFile))
        fileNew();

    adjustActions();
    adjustSource();
    setWindowModified(false);
    changeZoom(100);
}
/**
    \fn init
*/
bool sdlRenderImpl::init( GUI_WindowInfo * window, uint32_t w, uint32_t h,renderZoom zoom)
{
    ADM_info("[SDL] Initializing video subsystem\n");

    int bpp;
    int flags;
    baseInit(w,h,zoom);

    if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
    {
        ADM_warning("[SDL] FAILED initialising video subsystem\n");
        ADM_warning("[SDL] ERROR: %s\n", SDL_GetError());
        return false;
    }
    ADM_info("[SDL] Video subsystem init ok\n");

    sdl_running=true;
    ADM_info("[SDL] Creating window (at %x,%d)\n",window->x,window->y);
    
    int nbDriver=listOfSDLDrivers.size();
    if(!nbDriver)
    {
        ADM_warning("[SDL] No driver loaded\n");
        return false;
    }
    if(sdlDriverIndex==-1 || sdlDriverIndex>=nbDriver)
    {
        ADM_warning("[SDL] No available driver found\n");
        return false;
    }
    
#if 0
    sdl_window = SDL_CreateWindow("avidemux_sdl2",
                          SDL_WINDOWPOS_UNDEFINED,
                          SDL_WINDOWPOS_UNDEFINED,
                          w, h,
                          SDL_WINDOW_BORDERLESS | SDL_WINDOW_FOREIGN*1);    
    SDL_SetWindowPosition(sdl_window,window->x,window->y);
#else
    sdl_window=SDL_CreateWindowFrom((void*)window->systemWindowId);
#endif    
    
    if(!sdl_window)
    {
        ADM_info("[SDL] Creating window failed!\n");
        ADM_warning("[SDL] ERROR: %s\n", SDL_GetError());
        cleanup();
        return false;
    }
    
    sdl_renderer = SDL_CreateRenderer(sdl_window, sdlDriverIndex, SDL_RENDERER_ACCELERATED |  SDL_RENDERER_PRESENTVSYNC);
    if(!sdl_renderer)
        sdl_renderer = SDL_CreateRenderer(sdl_window, sdlDriverIndex, 0);
    if(!sdl_renderer)
    {
        ADM_warning("[SDL] FAILED to create a renderer\n");
        cleanup();
        return false;
    }
    
    sdl_texture = SDL_CreateTexture(sdl_renderer,
                               SDL_PIXELFORMAT_YV12,
                               SDL_TEXTUREACCESS_STREAMING,
                               w, h);
    if(sdl_texture)
    {
        useYV12=true;
    }else
    {
        useYV12=false;
        sdl_texture = SDL_CreateTexture(sdl_renderer,
                               SDL_PIXELFORMAT_ARGB8888,
                               SDL_TEXTUREACCESS_STREAMING,
                               w, h);
        if(!sdl_texture)
        {
            ADM_warning("[SDL] FAILED to create a texture (rgb)\n");
            cleanup();
            return false;
        }
    }
    ADM_info("[SDL] Setting final size\n");
    changeZoom(zoom);
    ADM_info("[SDL] All init done.\n");
    return true;
}
Beispiel #7
0
void BrowserWidget::zoomOut() {
    changeZoom(1 / zoomStepFactor);
    newScene();
}
Beispiel #8
0
void BrowserWidget::zoomIn() {
    changeZoom(zoomStepFactor);
}