コード例 #1
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::removeTab(int index)
{
    if (validIndex(index)) {
        setUpdatesEnabled(false);

        localTabBar(index)->removeTab(toLocalIndex(index));
        updatePinnedTabBarVisibility();
        tabRemoved(index);
        setMinimumWidths();

        setUpdatesEnabled(true);
        updateTabBars();
    }
}
コード例 #2
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
QRect ComboTabBar::tabRect(int index) const
{
    QRect rect;
    if (index != -1) {
        bool mainTabBar = index >= pinnedTabsCount();
        rect = localTabBar(index)->tabRect(toLocalIndex(index));

        if (mainTabBar) {
            rect.moveLeft(rect.x() + mapFromGlobal(m_mainTabBar->mapToGlobal(QPoint(0, 0))).x());
            QRect widgetRect = m_mainTabBarWidget->scrollArea()->viewport()->rect();
            widgetRect.moveLeft(widgetRect.x() + mapFromGlobal(m_mainTabBarWidget->scrollArea()->viewport()->mapToGlobal(QPoint(0, 0))).x());
            rect = rect.intersected(widgetRect);
        }
        else {
            rect.moveLeft(rect.x() + mapFromGlobal(m_pinnedTabBar->mapToGlobal(QPoint(0, 0))).x());
            QRect widgetRect = m_pinnedTabBarWidget->scrollArea()->viewport()->rect();
            widgetRect.moveLeft(widgetRect.x() + mapFromGlobal(m_pinnedTabBarWidget->scrollArea()->viewport()->mapToGlobal(QPoint(0, 0))).x());
            rect = rect.intersected(widgetRect);
        }
    }

    return rect;
}
コード例 #3
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
QWidget* ComboTabBar::tabButton(int index, QTabBar::ButtonPosition position) const
{
    return localTabBar(index)->tabButton(toLocalIndex(index), position);
}
コード例 #4
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::setTabButton(int index, QTabBar::ButtonPosition position, QWidget* widget)
{
    localTabBar(index)->setTabButton(toLocalIndex(index), position, widget);
}
コード例 #5
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
QString ComboTabBar::tabToolTip(int index) const
{
    return localTabBar(index)->tabToolTip(toLocalIndex(index));
}
コード例 #6
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::setTabToolTip(int index, const QString &tip)
{
    localTabBar(index)->setTabToolTip(toLocalIndex(index), tip);
}
コード例 #7
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::setTabText(int index, const QString &text)
{
    localTabBar(index)->setTabText(toLocalIndex(index), text);
}
コード例 #8
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::setCurrentIndex(int index)
{
    return localTabBar(index)->setCurrentIndex(toLocalIndex(index));
}
コード例 #9
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::setTabTextColor(int index, const QColor &color)
{
    localTabBar(index)->setTabTextColor(toLocalIndex(index), color);
}
コード例 #10
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
QColor ComboTabBar::tabTextColor(int index) const
{
    return localTabBar(index)->tabTextColor(toLocalIndex(index));
}
コード例 #11
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
void ComboTabBar::setTabEnabled(int index, bool enabled)
{
    localTabBar(index)->setTabEnabled(toLocalIndex(index), enabled);
}
コード例 #12
0
ファイル: combotabbar.cpp プロジェクト: AwkwardDev/qupzilla
bool ComboTabBar::isTabEnabled(int index) const
{
    return localTabBar(index)->isTabEnabled(toLocalIndex(index));
}
コード例 #13
0
ファイル: combotabbar.cpp プロジェクト: Frankie-666/qupzilla
void ComboTabBar::setTabButton(int index, QTabBar::ButtonPosition position, QWidget* widget)
{
    if (widget)
        widget->setMinimumSize(closeButtonSize());
    localTabBar(index)->setTabButton(toLocalIndex(index), position, widget);
}
コード例 #14
0
void LBNSInitFlagsIterator::iterate(){
	IntScalarField & flags = _flowField.getFlags();



	//	// Left and right faces
	int k,j,i;

	for (int globalK = _lowerZ-1; globalK<=_upperZ+1; globalK++)
		for (int globalJ = _lowerY-1; globalJ <= _upperY+1; globalJ++)
			for(int globalI = _lowerX-1; globalI<=_upperX+1; globalI++){
				if(toLocalIndex(globalI,globalJ,globalK,i,j,k)){
					if( globalK>=_lowerZ&&globalK<=_upperZ &&
							globalJ>=_lowerY&&globalJ<=_upperY&&
							globalI>=_lowerX&&globalI<=_upperX){

						flags.getValue(i, j, k) = OBSTACLE_SELF;

						if(
								globalK>_lowerZ&&globalK<_upperZ &&
								globalJ>_lowerY&&globalJ<_upperY&&
								globalI>_lowerX&&globalI<_upperX){
							flags.getValue(i, j, k) += OBSTACLE_LEFT;
							flags.getValue(i, j, k) += OBSTACLE_RIGHT;
							flags.getValue(i, j, k) += OBSTACLE_TOP;
							flags.getValue(i, j, k) += OBSTACLE_BOTTOM;
							flags.getValue(i, j, k) += OBSTACLE_FRONT;
							flags.getValue(i, j, k) += OBSTACLE_BACK;
						}else{
							if(globalI-1>=_lowerX)
								flags.getValue(i, j, k) += OBSTACLE_LEFT;
							if(globalI+1<=_upperX)
								flags.getValue(i, j, k) += OBSTACLE_RIGHT;
							if(globalJ-1>=_lowerY)
								flags.getValue(i, j, k) += OBSTACLE_BOTTOM;
							if(globalJ+1<=_upperY)
								flags.getValue(i, j, k) += OBSTACLE_TOP;
							if(globalK-1>=_lowerZ)
								flags.getValue(i, j, k) += OBSTACLE_FRONT;
							if(globalK+1<=_upperZ)
								flags.getValue(i, j, k) += OBSTACLE_BACK;

						}

					}else{
//						if(globalI-1>=_lowerX)
//							flags.getValue(i, j, k) += OBSTACLE_LEFT;
//						if(globalI+1<=_upperX)
//							flags.getValue(i, j, k) += OBSTACLE_RIGHT;
//						if(globalJ-1>=_lowerY)
//							flags.getValue(i, j, k) += OBSTACLE_BOTTOM;
//						if(globalJ+1<=_upperY)
//							flags.getValue(i, j, k) += OBSTACLE_TOP;
//						if(globalK-1>=_lowerZ)
//							flags.getValue(i, j, k) += OBSTACLE_FRONT;
//						if(globalK+1<=_upperZ)
//							flags.getValue(i, j, k) += OBSTACLE_BACK;
					}
				}
			}

//	for (int k = _lowerZ-1; k<=_upperZ+1; k++)
//			for (int j = _lowerY-1; j <= _upperY+1; j++)
//				for(int i = _lowerX-1; i<=_upperX+1; i++){
//					if(k>=_lowerZ&&k<=_upperZ &&
//							j>=_lowerY&&j<=_upperY&&
//							i>=_lowerX&&i<=_upperX){
//						flags.getValue(i, j, k) = OBSTACLE_SELF;
//
//						if(k>_lowerZ&&k<_upperZ &&
//								j>_lowerY&&j<_upperY&&
//								i>_lowerX&&i<_upperX){
//							flags.getValue(i, j, k) += OBSTACLE_LEFT;
//							flags.getValue(i, j, k) += OBSTACLE_RIGHT;
//							flags.getValue(i, j, k) += OBSTACLE_TOP;
//							flags.getValue(i, j, k) += OBSTACLE_BOTTOM;
//							flags.getValue(i, j, k) += OBSTACLE_FRONT;
//							flags.getValue(i, j, k) += OBSTACLE_BACK;
//						}else{
//							if(i-1>=_lowerX)
//								flags.getValue(i, j, k) += OBSTACLE_LEFT;
//							if(i+1<=_upperX)
//								flags.getValue(i, j, k) += OBSTACLE_RIGHT;
//							if(j-1>=_lowerY)
//								flags.getValue(i, j, k) += OBSTACLE_BOTTOM;
//							if(j+1<=_upperY)
//								flags.getValue(i, j, k) += OBSTACLE_TOP;
//							if(k-1>=_lowerZ)
//								flags.getValue(i, j, k) += OBSTACLE_FRONT;
//							if(k+1<=_upperZ)
//								flags.getValue(i, j, k) += OBSTACLE_BACK;
//
//						}
//					}else{
//						/*if(i-1>=_lowerX)
//							flags.getValue(i, j, k) += OBSTACLE_LEFT;
//						if(i+1<=_upperX)
//							flags.getValue(i, j, k) += OBSTACLE_RIGHT;
//						if(j-1>=_lowerY)
//							flags.getValue(i, j, k) += OBSTACLE_BOTTOM;
//						if(j+1<=_upperY)
//							flags.getValue(i, j, k) += OBSTACLE_TOP;
//						if(k-1>=_lowerZ)
//							flags.getValue(i, j, k) += OBSTACLE_FRONT;
//						if(k+1<=_upperZ)
//							flags.getValue(i, j, k) += OBSTACLE_BACK;*/
//					}
//				}



}