コード例 #1
0
ファイル: sectionWidget.cpp プロジェクト: q4a/attal
GenericSection::GenericSection( QWidget * parent, const char * name )
	: Section( parent, name )
{
	QVBoxLayout * layout = new QVBoxLayout( this );
	
	_select = new SelectionWidget( this, "select" );
	layout->addWidget( _select );
	layout->addSpacing( 5 );
	
	_mainWidget = new QWidget( this );
	_mainWidget->setWindowTitle( "main widget" );
	layout->addWidget( _mainWidget, 1 );
	layout->addSpacing( 5 );
	
	layout->activate();
	
	connect( _select, SIGNAL( sig_first() ), SLOT( slot_first() ) );
	connect( _select, SIGNAL( sig_previous() ), SLOT( slot_previous() ) );
	connect( _select, SIGNAL( sig_next() ), SLOT( slot_next() ) );
	connect( _select, SIGNAL( sig_last() ), SLOT( slot_last() ) );
	connect( _select, SIGNAL( sig_new() ), SLOT( slot_new() ) ); 
	connect( _select, SIGNAL( sig_del() ), SLOT( slot_del() ) );
}
コード例 #2
0
mainTaskWidget::mainTaskWidget(QWidget *parent) : QWidget(parent)
{
    this->setWindowFlags(Qt::FramelessWindowHint);
    this->setMouseTracking(true);
    this->setAutoFillBackground(true);    

    m_currentNum = -1;
    m_imagesNum = -1;
    m_loadOriImgThread = NULL;
    //m_loadThumbnailThreadLeft = NULL;
    //m_loadThumbnailThreadRight = NULL;
    //m_threadNum = 0;
    m_isLoaded = false;
    //m_oriImgitem = new bigPictureItem;
    //m_oriImgitem->setCacheMode(QGraphicsItem::DeviceCoordinateCache);

    m_view = new bigPictureView;

    m_1_vl = new QVBoxLayout;
    m_1_vl->setMargin(0);
    m_1_vl->setSpacing(0);
    m_1_vl->addWidget(m_view);

    this->setLayout(m_1_vl);

    m_leftPage = new scrolledButtonWidget(Left, this);
    m_rightPage = new scrolledButtonWidget(Right, this);

    //m_toolbar = new toolBarWidget(this);
    m_bottomWidget = new bottomWidgt(this);

    connect(m_rightPage, SIGNAL(sig_showAnotherDirectionButton()), m_leftPage, SLOT(slot_showDirectionButton()));
    connect(this, SIGNAL(sig_showDirectionKey()), m_rightPage, SLOT(slot_showDirectionButton()));

    connect(m_leftPage, SIGNAL(sig_hideAnotherDirectionButton()), m_rightPage, SLOT(slot_hideDirectionButton()));
    connect(this, SIGNAL(sig_hideLeftAndRight()), m_leftPage, SLOT(slot_hideDirectionButton()));

    connect(m_view, SIGNAL(sig_mapToParentPos(QPoint)), this, SLOT(slot_determineCursorPos(QPoint)));
    connect(m_view, SIGNAL(sig_threadOver()), this, SLOT(slot_updataThreadNum()));

    //connect(this, SIGNAL(sig_showBottomCtl()), m_toolbar, SLOT(slot_showToolBarWidget()));
    //connect(this, SIGNAL(sig_hideToolBar()), m_toolbar, SLOT(slot_hideToolBarWidget()));

    connect(this, SIGNAL(sig_showBottomCtl()), m_bottomWidget, SLOT(slot_showAnimation()));
    connect(this, SIGNAL(sig_hideToolBar()), m_bottomWidget, SLOT(slot_hideAnimation()));


    //切换图片信号链接
    connect(m_leftPage->m_direction, SIGNAL(clicked()), this, SLOT(slot_prev()));
    connect(m_rightPage->m_direction, SIGNAL(clicked()), this, SLOT(slot_next()));

    //工具栏信号链接
    connect(m_bottomWidget->m_toolbar->m_file, SIGNAL(clicked()), this, SLOT(slot_openFile()));
    connect(m_bottomWidget->m_toolbar->m_left, SIGNAL(clicked()), this, SLOT(slot_prev()));
    connect(m_bottomWidget->m_toolbar->m_right, SIGNAL(clicked()), this, SLOT(slot_next()));
    connect(m_bottomWidget->m_toolbar->m_rotating, SIGNAL(clicked()), m_view, SLOT(slot_rotateImage()));
    connect(m_bottomWidget->m_toolbar->m_magnifying, SIGNAL(clicked()), m_view, SLOT(slot_largerImage()));
    connect(m_bottomWidget->m_toolbar->m_reduce, SIGNAL(clicked()), m_view, SLOT(slot_reduceImage()));

    connect(m_bottomWidget->m_thumbnailView,SIGNAL(sendToDisplay(int)),
            this,SLOT(receiveFromView(int)));
    connect(m_bottomWidget->m_thumbnailView,SIGNAL(sendToDisplayImg(QImage,QSize)),
            this,SLOT(receiveFromViewImg(QImage,QSize)));
}