Пример #1
0
void VideoDock::fullScreen(bool b)
{
	if (b)
	{
		is_floating = isFloating();

		setTitleBarVisible(false);
		setFeatures(DockWidget::NoDockWidgetFeatures);
		setFloating(false);

		if (!isBreeze)
			setStyle(&commonStyle);
	}
	else
	{
		/* Visualizations on full screen */
		QWidget *dockedW = widget();
		if (dockedW != &iDW)
		{
			if (dockedW)
			{
				unsetCursor(dockedW);
				dockedW->setParent(nullptr);
			}
			setWidget(&iDW);
		}

		setTitleBarVisible();
		setFeatures(DockWidget::AllDockWidgetFeatures);
		setFloating(is_floating);

		if (!isBreeze)
			setStyle(nullptr);
	}
}
Пример #2
0
RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
{
  setWindowTitle(tr("Registers"));
  setAllowedAreas(Qt::AllDockWidgetAreas);

  QSettings settings;

  restoreGeometry(settings.value(QStringLiteral("registerwidget/geometry")).toByteArray());
  setFloating(settings.value(QStringLiteral("registerwidget/floating")).toBool());

  CreateWidgets();
  PopulateTable();
  ConnectWidgets();

  connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) {
    if (Settings::Instance().IsDebugModeEnabled() && Core::GetState() == Core::State::Paused)
      emit RequestTableUpdate();
  });

  connect(this, &RegisterWidget::RequestTableUpdate, [this] {
    m_updating = true;
    emit UpdateTable();
    m_updating = false;
  });

  connect(&Settings::Instance(), &Settings::RegistersVisibilityChanged,
          [this](bool visible) { setHidden(!visible); });

  connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) {
    setHidden(!enabled || !Settings::Instance().IsRegistersVisible());
  });

  setHidden(!Settings::Instance().IsRegistersVisible() ||
            !Settings::Instance().IsDebugModeEnabled());
}
Пример #3
0
MirrorDock::MirrorDock(QWidget *parent) :
    QDockWidget(parent),
    ui(new Ui::MirrorDock)
{
    ui->setupUi(this);
    setVisible(false);
    setFloating(true);
    setObjectName("mirrorDock");

    ui->rotateCustomWidgets->hide();

    connect(ui->mirrorLeft, SIGNAL(clicked()), SLOT(genMirror()));
    connect(ui->mirrorRight, SIGNAL(clicked()), SLOT(genMirror()));
    connect(ui->mirrorUp, SIGNAL(clicked()), SLOT(genMirror()));
    connect(ui->mirrorDown, SIGNAL(clicked()), SLOT(genMirror()));
	
	connect(ui->copyLeft, SIGNAL(clicked()), SLOT(genCopy()));
	connect(ui->copyRight, SIGNAL(clicked()), SLOT(genCopy()));
	connect(ui->copyUp, SIGNAL(clicked()), SLOT(genCopy()));
	connect(ui->copyDown, SIGNAL(clicked()), SLOT(genCopy()));

    connect(ui->rotate90, SIGNAL(clicked()), SLOT(genRotate()));
    connect(ui->rotate180, SIGNAL(clicked()), SLOT(genRotate()));
    connect(ui->rotate270, SIGNAL(clicked()), SLOT(genRotate()));

    connect(ui->rotateCustom, SIGNAL(clicked()), SLOT(rotateCustom()));

    connect(ui->rotateBttn, SIGNAL(clicked()), SLOT(genRotate()));
}
Пример #4
0
WorldSettingsBox::WorldSettingsBox(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WorldSettingsBox)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);

    world_settings_lock_fields=false;

    QRect mwg = mw()->geometry();
    int GOffset=240;
    mw()->addDockWidget(Qt::RightDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    #ifdef Q_OS_WIN
    setFloating(true);
    #endif
    setGeometry(
                mwg.x()+mwg.width()-width()-GOffset,
                mwg.y()+120,
                width(),
                height()
                );

    mw()->docks_world.
          addState(this, &GlobalSettings::WorldSettingsToolboxVis);
}
Пример #5
0
PythonEditorWidget::PythonEditorWidget(QWidget* parent)
    : InviwoDockWidget(tr("Python Editor"), parent)
    , settings_("Inviwo", "Inviwo")
    , infoTextColor_(153, 153, 153)
    , errorTextColor_(255, 107, 107)
    , script_()
    , unsavedChanges_(false) {
    ivwAssert(instance_ == nullptr, "This is a Singelton, constructor may only be called once")
        instance_ = this;
    setObjectName("PythonEditor");
    settings_.beginGroup("PythonEditor");
    QString lastFile = settings_.value("lastScript", "").toString();
    settings_.endGroup();
    setVisible(false);
    buildWidget();
    resize(500, 700);
    
    InviwoApplication::getPtr()->registerFileObserver(this);
    unsavedChanges_ = false;



    if (lastFile.size() != 0) loadFile(lastFile.toLocal8Bit().constData(), false);

    setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    setFloating(true);
}
Пример #6
0
WaterTool::WaterTool( QWidget* p_parent /*= 0*/ ): QDockWidget(p_parent)
{
	QWidget* contents = new QWidget();

	ui.setupUi(contents);

	setAllowedAreas(Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea);
	setGeometry(ui.gridLayout->geometry());
	setWindowTitle("Water settings");
	setFloating(true);
	hide();

	setWidget(contents);

	m_colorDialog = new QColorDialog(this);
	m_colorDialog->setWindowModality(Qt::NonModal);

	connect(m_colorDialog, SIGNAL(currentColorChanged(const QColor&)), this, SLOT(SetWaterColor(const QColor&)));


	//Connect items from UI to methods
	connect(ui.doubleSpinBox_waterSpeed,	SIGNAL(valueChanged(double)),	this, SLOT(SetWaterSpeed(double)));
	connect(ui.doubleSpinBox_waterDepth,	SIGNAL(valueChanged(double)),	this, SLOT(SetWaterDepth(double)));
	connect(ui.checkBox_waterReflections,	SIGNAL(clicked(bool)),			this, SLOT(SetWaterReflections(bool)));
	connect(ui.checkBox_waterRefractions,	SIGNAL(clicked(bool)),			this, SLOT(SetWaterRefractions(bool)));
	connect(ui.checkBox_waterNormals,		SIGNAL(clicked(bool)),			this, SLOT(SetWaterNormals(bool)));
	connect(ui.checkBox_waterPause,			SIGNAL(clicked(bool)),			this, SLOT(SetWaterPause(bool)));
	connect(ui.pushButton_waterColor,		SIGNAL(clicked()),				this, SLOT(OpenColorDialog()));
	connect(ui.pushButton_initWater,		SIGNAL(clicked()),				this, SLOT(InitWater()));
	connect(ui.pushButton_resetWater,		SIGNAL(clicked()),				this, SLOT(ResetWater()));

	
}
Пример #7
0
		void HelpViewer::showHelp(const String& org_url, String entry)
		{
			String url = org_url;
			String fragment;

			if (url.has('#'))
			{
				url = url.before("#");
				fragment = org_url.after("#");
			}

			QUrl qurl = QUrl::fromLocalFile((base_dir_ + url).c_str());
			if (fragment != "") qurl.setFragment(fragment.c_str());
 			browser_->setSource(qurl);

 			QTextCursor ct = browser_->textCursor();
 			if (!ct.atStart()) 
 			{
 				ct.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor);
				browser_->setTextCursor(ct);
 			}

			if (entry != "") browser_->find(entry.c_str(), QTextDocument::FindCaseSensitively);

			if (!isVisible())
			{
				show();
				setFloating(true);
				showMaximized();
			}
		}
Пример #8
0
ToolsBar::ToolsBar(QWidget *parent)
    : QDockWidget(parent)
{
	m_currentTool = Handler;
	setWindowTitle(tr("Tools"));
	setObjectName("ToolsBar");

    setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);

    m_mainWidget = new QWidget(this);

    setWidget(m_mainWidget);

    createActions();
    createTools();

    connect(m_resetCountAct, SIGNAL(triggered(bool)), this, SLOT(resetNpcNumber()));
	connect(m_textEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(currentTextChanged(QString)));
	connect(m_npcNameEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(currentNpcNameChanged(QString)));

	connect(this, SIGNAL(topLevelChanged(bool)), this, SLOT(changeSize(bool)));

	setFloating(false);
}
Пример #9
0
TilesetItemBox::TilesetItemBox(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::TilesetItemBox)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    connect(ui->customTilesetSearchEdit, SIGNAL(textChanged(QString)), this, SLOT(makeCurrentTileset()));
    ui->TileSetsCategories->setTabPosition(GlobalSettings::TSTToolboxPos);

    this->setFocusPolicy(Qt::ClickFocus);

    lockTilesetBox = false;

    QRect dg = qApp->desktop()->availableGeometry(qApp->desktop()->primaryScreen());
    int GOffset = 240;

    mw()->addDockWidget(Qt::BottomDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    setFloating(true);
    setGeometry(
        dg.x() + GOffset,
        dg.bottom() - height() - 5,
        800,
        250
    );

    m_lastVisibilityState = isVisible();
    mw()->docks_level_and_world.
    addState(this, &m_lastVisibilityState);
}
Пример #10
0
GLFOutputWindow::GLFOutputWindow(QWidget* parent)
    : KxDockWidget(tr("Output"), parent)
{
    setFloating(true);
    setFeatures(QDockWidget::DockWidgetMovable | QDockWidget:: DockWidgetFloatable);
    setAllowedAreas(Qt::NoDockWidgetArea);
    setMinimumSize(640, 120);

    QWidget* mainWidget = new QWidget(this);
    setWidget(mainWidget);

    _pTextEdit = new QTextEdit(this);
    _pTextEdit->setReadOnly(true);

    _pSaveButton = new QPushButton(tr("Save"), this);
    _pClearButton = new QPushButton(tr("Clear"), this);

    connect(_pSaveButton, SIGNAL(clicked()), this, SLOT(onSave()));
    connect(_pClearButton, SIGNAL(clicked()), this, SLOT(onClear()));
    
    QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
    mainWidget->setLayout(mainLayout);

    mainLayout->addWidget(_pTextEdit);

    QHBoxLayout* hboxLayout = new QHBoxLayout();
    mainLayout->addLayout(hboxLayout);

    hboxLayout->addStretch();
    hboxLayout->addWidget(_pClearButton);
    hboxLayout->addWidget(_pSaveButton);
}
Пример #11
0
void DockWidget::closeEvent(QCloseEvent *event) {
    setFloating(true);
    setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, minimumSize(), qApp->desktop()->availableGeometry()));
    emit closed();
    event->accept();
    QDockWidget::closeEvent(event);
}
Пример #12
0
void LogConfigWidget::LoadSettings()
{
  auto* logmanager = LogManager::GetInstance();
  QSettings settings;

  restoreGeometry(settings.value(QStringLiteral("logconfigwidget/geometry")).toByteArray());
  setFloating(settings.value(QStringLiteral("logconfigwidget/floating")).toBool());

  // Config - Verbosity
  int verbosity = logmanager->GetLogLevel();
  m_verbosity_notice->setChecked(verbosity == 1);
  m_verbosity_error->setChecked(verbosity == 2);
  m_verbosity_warning->setChecked(verbosity == 3);
  m_verbosity_info->setChecked(verbosity == 4);

  // Config - Outputs
  m_out_file->setChecked(logmanager->IsListenerEnabled(LogListener::FILE_LISTENER));
  m_out_console->setChecked(logmanager->IsListenerEnabled(LogListener::CONSOLE_LISTENER));
  m_out_window->setChecked(logmanager->IsListenerEnabled(LogListener::LOG_WINDOW_LISTENER));

  // Config - Log Types
  for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
  {
    bool log_enabled = LogManager::GetInstance()->IsEnabled(static_cast<LogTypes::LOG_TYPE>(i));

    if (!log_enabled)
      m_all_enabled = false;

    m_types_list->item(i)->setCheckState(log_enabled ? Qt::Checked : Qt::Unchecked);
  }
}
Пример #13
0
void Walker::attachToGround(float platformLeft, float platformRight)
{
    setFloating(true);
    groundedHeight = getPosition().y;
    groundedLeft = platformLeft - getRadius();
    groundedRight = platformRight + getRadius();
    grounded = true;
}
Пример #14
0
specDockWidget::specDockWidget(QString type, QWidget* parent, bool floating) :
	QDockWidget(parent),
	widgetTypeName(type),
	Plot(0),
	changingTitle(false)
{
	setFloating(floating);
	setVisible(false) ;
}
Пример #15
0
PythonInfoWidget::PythonInfoWidget(QWidget* parent)
    :  InviwoDockWidget(tr("Python API Documentation"),parent) {
    setObjectName("PythonInfoWidget");
    setVisible(false);
    buildWidget();
    resize(500, 900);

    setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
    setFloating(true);
}
void LayoutScrollbarPart::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
{
    LayoutBlock::styleDidChange(diff, oldStyle);
    setInline(false);
    clearPositionedState();
    setFloating(false);
    setHasOverflowClip(false);
    if (oldStyle && m_scrollbar && m_part != NoPart && (diff.needsPaintInvalidation() || diff.needsLayout()))
        m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part);
}
Пример #17
0
void RenderScrollbarPart::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
    RenderBlock::styleDidChange(diff, oldStyle);
    setInline(false);
    clearPositionedState();
    setFloating(false);
    setHasOverflowClip(false);
    if (oldStyle && m_scrollbar && m_part != NoPart && diff >= StyleDifferenceRepaint)
        m_scrollbar->theme()->invalidatePart(*m_scrollbar, m_part);
}
PropertiesDock::PropertiesDock(QTabWidget *tabWidget, QWidget *parent) :
    QDockWidget(parent),
    closing(false),
    ui(new Ui::PropertiesDock),
    mTabWidget(tabWidget),
    mScene(0)
{
    ui->setupUi(this);
    setVisible(false);
    setFloating(true);
    setObjectName("propertiesDock");

    ui->rows->setValue(Settings::inst()->value("rowCount").toInt());
    ui->columns->setValue(Settings::inst()->value("stitchCount").toInt());
    ui->cellHeight->setValue(Settings::inst()->value("cellHeight").toInt());
    ui->cellWidth->setValue(Settings::inst()->value("cellWidth").toInt());

    int styleIdx = ui->ind_indicatorStyle->findText(Settings::inst()->value("chartRowIndicator").toString());
    ui->ind_indicatorStyle->setCurrentIndex(styleIdx);
    clearUi();
    connect(mTabWidget, SIGNAL(currentChanged(int)), SLOT(tabChanged(int)));

    connect(ui->gen_angle, SIGNAL(valueChanged(double)), SLOT(cellUpdateAngle(double)));
    connect(ui->gen_scaleX, SIGNAL(valueChanged(double)), SLOT(cellUpdateScaleX(double)));
    connect(ui->gen_scaleY, SIGNAL(valueChanged(double)), SLOT(cellUpdateScaleY(double)));

    connect(ui->gen_xPos, SIGNAL(valueChanged(double)), SLOT(cellUpdatePositionX(double)));
    connect(ui->gen_yPos, SIGNAL(valueChanged(double)), SLOT(cellUpdatePositionY(double)));

    connect(ui->showChartCenter, SIGNAL(toggled(bool)), SLOT(chartUpdateChartCenter(bool)));
    connect(ui->guidelinesType, SIGNAL(currentIndexChanged(QString)), SLOT(chartUpdateGuidelines()));

    connect(ui->st_stitch, SIGNAL(currentIndexChanged(QString)), SLOT(cellUpdateStitch(QString)));

    connect(ui->gen_deleteItems, SIGNAL(clicked()), SLOT(cellDeleteItems()));

    connect(ui->guidelinesType, SIGNAL(currentIndexChanged(int)), SLOT(updateGuidelinesUi()));
    updateGuidelinesUi();

    connect(ui->rows, SIGNAL(valueChanged(int)), SLOT(chartUpdateGuidelines()));
    connect(ui->cellWidth, SIGNAL(valueChanged(int)), SLOT(chartUpdateGuidelines()));
    connect(ui->columns, SIGNAL(valueChanged(int)), SLOT(chartUpdateGuidelines()));
    connect(ui->cellHeight, SIGNAL(valueChanged(int)), SLOT(chartUpdateGuidelines()));

    connect(ui->st_stBgColorBttn, SIGNAL(clicked(bool)), SLOT(cellUpdateBgColor()));
    connect(ui->st_stColorBttn, SIGNAL(clicked(bool)), SLOT(cellUpdateFgColor()));

    connect(ui->ind_indicatorStyle, SIGNAL(currentIndexChanged(int)), SLOT(indicatorUpdate()));

    setupStitchCombo();

    ui->indX_IndicatorEditText->setVisible(false);
    ui->indX_indicatorTextEdit->setVisible(false);
}
Пример #19
0
void MainDock::toggleShowComponents() {
	if (showComponents) {
		showComponents = false;
		splitter->hide();
		setFloating(true);
		adjustSize();
	}
	else {
		showComponents = true;
		splitter->show();
	}
}
Пример #20
0
ResizeUI::ResizeUI(QTabWidget* tabWidget, QWidget* parent)
	: QDockWidget(parent),
	mTabWidget(tabWidget),
	ui(new Ui::ResizeDialog)
{
    ui->setupUi(this);
    setVisible(false);
    setFloating(true);
	
	connect(this, SIGNAL(visibilityChanged(bool)), SLOT(updateContent()));	
	connect(ui->topBox, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int)));
	connect(ui->bottomBox, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int)));
	connect(ui->leftBox, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int)));
	connect(ui->rightBox, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int)));
	connect(ui->clampButton, SIGNAL(pressed()), this, SLOT(clampPressed()));
}
Пример #21
0
WChatDebugger::WChatDebugger(const QString & sName) : QDockWidget(sName, g_pwMainWindow)
	{
	setObjectName(sName);
	setVisible(false);
	setAllowedAreas(Qt::AllDockWidgetAreas);
	setFloating(true);

	QRect rc = QApplication::desktop()->screenGeometry();
	rc.adjust(rc.right() / 2, 50, -50, -100);
	int y = rc.bottom() * 3 / 4;
	if (sName == c_sMessageLog)
		rc.setBottom(y - 50);	// Position the MessageLog at the top
	else
		rc.setTop(y);		// Position the ErrorLog at the bottom
	setGeometry(rc);
	m_pwTextBrowserMessageLog = new CTextBrowserMessageLog(this);
	m_pwTextBrowserMessageLog->setTabStopWidth(16);	// Set the tab width to 16 pixels instead of 80 pixels
	setWidget(m_pwTextBrowserMessageLog);
	}
Пример #22
0
NotesDock::NotesDock(NoteModel * pNoteModel, GuiModel *pGuiModel, QWidget *parent) :
    QDockWidget(parent)
{

    _pNoteModel = pNoteModel;

    setAllowedAreas(Qt::NoDockWidgetArea);
    setFeatures(QDockWidget::DockWidgetClosable
                | QDockWidget::DockWidgetFloatable
                );

    setWindowTitle("Notes");
    setFloating(true);

    _pNotesDockWidget = new NotesDockWidget(pNoteModel, pGuiModel, this);
    this->setWidget(_pNotesDockWidget);

    this->hide();

}
Пример #23
0
WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent)
{
  // i18n: This kind of "watch" is used for watching emulated memory.
  // It's not related to timekeeping devices.
  setWindowTitle(tr("Watch"));
  setObjectName(QStringLiteral("watch"));

  setAllowedAreas(Qt::AllDockWidgetAreas);

  auto& settings = Settings::GetQSettings();

  restoreGeometry(settings.value(QStringLiteral("watchwidget/geometry")).toByteArray());
  setFloating(settings.value(QStringLiteral("watchwidget/floating")).toBool());

  CreateWidgets();
  ConnectWidgets();

  connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) {
    if (!Settings::Instance().IsDebugModeEnabled())
      return;

    m_load->setEnabled(Core::IsRunning());
    m_save->setEnabled(Core::IsRunning());

    if (state != Core::State::Starting)
      Update();
  });

  connect(&Settings::Instance(), &Settings::WatchVisibilityChanged,
          [this](bool visible) { setHidden(!visible); });

  connect(&Settings::Instance(), &Settings::DebugModeToggled,
          [this](bool enabled) { setHidden(!enabled || !Settings::Instance().IsWatchVisible()); });

  connect(&Settings::Instance(), &Settings::ThemeChanged, this, &WatchWidget::UpdateIcons);
  UpdateIcons();

  setHidden(!Settings::Instance().IsWatchVisible() || !Settings::Instance().IsDebugModeEnabled());

  Update();
}
Пример #24
0
ViewSwitcherDockWidget::ViewSwitcherDockWidget(const QString & title, QWidget * parent)
    : FDockWidget(title, parent)
{
	m_bitmap = NULL;
	m_viewSwitcher = NULL;
	m_within = true;

	bool floatFlag = true;
	QPoint initial(10,50);

#ifdef Q_WS_MAC
	initial.setY(34);
#else
	#ifdef Q_WS_X11
		floatFlag = false;
		initial.setY(60);
	#else
		#ifdef Q_WS_WIN
			OSVERSIONINFO OSversion;	
			OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
			::GetVersionEx(&OSversion);
			//DebugDialog::debug(QString("windows os version %1 %2").arg(OSversion.dwMajorVersion).arg(OSversion.dwMinorVersion));
			if (OSversion.dwMajorVersion > 5) {
				// vista and win 7 major version is 6
                initial.setX(12);
                initial.setY(60);
			}
		#endif
	#endif
#endif

	setFloating(floatFlag);
	m_offsetFromParent.setX(initial.x());
	m_offsetFromParent.setY(initial.y());

	// connect last so they doesn't trigger during construction
	connect(this, SIGNAL(topLevelChanged(bool)), this, SLOT(topLevelChangedSlot(bool)));
	connect(toggleViewAction(), SIGNAL(triggered()), this, SLOT(savePreference()), Qt::DirectConnection);
}
Пример #25
0
WLD_ItemProps::WLD_ItemProps(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WLD_ItemProps)
{
    setVisible(false);
    setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    wld_tools_lock=false;

    QRect mwg = mw()->geometry();
    int GOffset=240;
    mw()->addDockWidget(Qt::RightDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    #ifdef Q_OS_WIN
    setFloating(true);
    #endif
    setGeometry(
                mwg.x()+mwg.width()-width()-GOffset,
                mwg.y()+120,
                width(),
                height()
                );
}
Пример #26
0
PlayerWidget::PlayerWidget(QWidget *parent)
    : QDockWidget(parent), Ui::PlayerWidget()
{
    setupUi(this);
    setFloating( true );
    setAttribute( Qt::WA_DeleteOnClose );

    // Set up icons
    btnFwd->setPixmap( QPixmap(":images/dryicons_forward.png") );
    btnPausePlay->setPixmap( QPixmap(":images/dryicons_play.png") );
    btnRew->setPixmap( QPixmap(":images/dryicons_rewind.png") );
    btnStop->setPixmap( QPixmap(":images/dryicons_stop") );

    // Connect button slots
    connect( btnFwd, SIGNAL( clicked() ), this, SLOT(btn_playerSeekForward()) );
    connect( btnRew, SIGNAL( clicked() ), this, SLOT(btn_playerSeekBackward()) );
    connect( btnPausePlay, SIGNAL( clicked() ), this, SLOT(btn_playerPlayPause()) );
    connect( btnStop, SIGNAL( clicked() ), this, SLOT(btn_playerStop()) );

    seekBar->setRange( 0, 100 );
    btnPausePlay->setEnabled( true );

    playUpdate();
}
Пример #27
0
WLD_ItemProps::WLD_ItemProps(QWidget *parent) :
    QDockWidget(parent),
    MWDock_Base(parent),
    ui(new Ui::WLD_ItemProps)
{
    setVisible(false);
    //setAttribute(Qt::WA_ShowWithoutActivating);
    ui->setupUi(this);
    wld_tools_lock=false;

    QRect mwg = mw()->geometry();
    int GOffset=10;
    mw()->addDockWidget(Qt::RightDockWidgetArea, this);
    connect(mw(), SIGNAL(languageSwitched()), this, SLOT(re_translate()));
    connect(this, &QDockWidget::visibilityChanged, mw()->ui->action_Placing_ShowProperties, &QAction::setChecked);
    mw()->ui->action_Placing_ShowProperties->setChecked(isVisible());
    setFloating(true);
    setGeometry(
                mwg.right() - width() - GOffset,
                mwg.y()+120,
                width(),
                height()
                );
}
Пример #28
0
void Panel::onDockBottom()
{
	setFloating(false);
	((QMainWindow*) parent())->addDockWidget(Qt::BottomDockWidgetArea, this);
}
Пример #29
0
void Panel::show()
{
	setFloating(true);
	QWidget::show();
}
void TransferFunctionPropertyDialog::generateWidget() {
    vec2 minEditorDims = vec2(255.0f, 100.0f);

    tfEditorView_ = new TransferFunctionEditorView(tfProperty_);
    tfProperty_->get().addObserver(tfEditorView_);
    // put origin to bottom left corner
    tfEditorView_->scale(1.0, -1.0);
    tfEditorView_->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
    tfEditorView_->setMinimumSize(minEditorDims.x, minEditorDims.y);
    tfEditorView_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    tfEditorView_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    
    tfEditor_ = new TransferFunctionEditor(&tfProperty_->get(), tfEditorView_);
    connect(tfEditor_, SIGNAL(doubleClick()), this, SLOT(showColorDialog()));
    connect(tfEditor_, SIGNAL(selectionChanged()), this, SLOT(updateColorWheel()));
    tfEditorView_->setScene(tfEditor_);

    zoomVSlider_ = new RangeSliderQt(Qt::Vertical, this);
    zoomVSlider_->setRange(0, sliderRange_);
    zoomVSlider_->setMinSeparation(5);
    // flip slider values to compensate for vertical slider layout
    zoomVSlider_->setValue(sliderRange_ - static_cast<int>(tfProperty_->getZoomV().y*sliderRange_),
                           sliderRange_ - static_cast<int>(tfProperty_->getZoomV().x*sliderRange_));
    connect(zoomVSlider_, SIGNAL(valuesChanged(int, int)),
            this, SLOT(changeVerticalZoom(int, int)));
    
    zoomHSlider_ = new RangeSliderQt(Qt::Horizontal, this);
    zoomHSlider_->setRange(0, sliderRange_);
    zoomHSlider_->setMinSeparation(5);
    zoomHSlider_->setValue(static_cast<int>(tfProperty_->getZoomH().x*sliderRange_),
                           static_cast<int>(tfProperty_->getZoomH().y*sliderRange_));
    connect(zoomHSlider_, SIGNAL(valuesChanged(int, int)),
            this, SLOT(changeHorizontalZoom(int, int)));

    maskSlider_ = new RangeSliderQt(Qt::Horizontal, this);
    maskSlider_->setRange(0, sliderRange_);
    maskSlider_->setValue(static_cast<int>(tfProperty_->getMask().x*sliderRange_),
                          static_cast<int>(tfProperty_->getMask().y*sliderRange_));
    connect(maskSlider_, SIGNAL(valuesChanged(int, int)),
            this, SLOT(changeMask(int, int)));
    
    colorWheel_ = new ColorWheel();
    connect(colorWheel_, SIGNAL(colorChange(QColor)), this, SLOT(setPointColor(QColor)));
    
    btnClearTF_ = new QPushButton("Reset");
    connect(btnClearTF_, SIGNAL(clicked()), tfEditor_, SLOT(resetTransferFunction()));
    btnClearTF_->setStyleSheet(QString("min-width: 30px; padding-left: 7px; padding-right: 7px;"));
    
    btnImportTF_ = new QPushButton("Import");
    connect(btnImportTF_, SIGNAL(clicked()), this, SLOT(importTransferFunction()));
    btnImportTF_->setStyleSheet(QString("min-width: 30px; padding-left: 7px; padding-right: 7px;"));
    
    btnExportTF_ = new QPushButton("Export");
    connect(btnExportTF_, SIGNAL(clicked()), this, SLOT(exportTransferFunction()));
    btnExportTF_->setStyleSheet(QString("min-width: 30px; padding-left: 7px; padding-right: 7px;"));

    tfPreview_ = new QLabel();
    tfPreview_->setMinimumSize(1,20);
    QSizePolicy sliderPol = tfPreview_->sizePolicy();
    sliderPol.setHorizontalStretch(3);
    tfPreview_->setSizePolicy(sliderPol);
    
    cmbInterpolation_ = new QComboBox();
    cmbInterpolation_->addItem("Interpolation: Linear");
    //cmbInterpolation_->addItem("Interpolation: Cubic"); // Not implemented... (yet)
    cmbInterpolation_->setCurrentIndex(tfProperty_->get().getInterpolationType());
    connect(cmbInterpolation_, SIGNAL(currentIndexChanged(int)),
            this, SLOT(switchInterpolationType(int)));
    
    chkShowHistogram_ = new QComboBox();
    chkShowHistogram_->addItem("Histogram: Off");
    chkShowHistogram_->addItem("Histogram: 100%");
    chkShowHistogram_->addItem("Histogram: 99%");
    chkShowHistogram_->addItem("Histogram: 95%");
    chkShowHistogram_->addItem("Histogram: 90%");
    chkShowHistogram_->addItem("Histogram: Log");
    chkShowHistogram_->setCurrentIndex(tfProperty_->getShowHistogram());
    connect(chkShowHistogram_, SIGNAL(currentIndexChanged(int)), this, SLOT(showHistogram(int)));
    
    pointMoveMode_ = new QComboBox();
    pointMoveMode_->addItem("Point Movement: Free");
    pointMoveMode_->addItem("Point Movement: Restrict");
    pointMoveMode_->addItem("Point Movement: Push");
    pointMoveMode_->setCurrentIndex(0);
    connect(pointMoveMode_, SIGNAL(currentIndexChanged(int)), this, SLOT(changeMoveMode(int)));

    colorDialog_ = new QColorDialog(this);
    colorDialog_->hide();
    colorDialog_->setOption(QColorDialog::ShowAlphaChannel, true);
    colorDialog_->setOption(QColorDialog::NoButtons, true);
    colorDialog_->setWindowModality(Qt::NonModal);
    colorDialog_->setWindowTitle(QString::fromStdString(tfProperty_->getDisplayName()));
    connect(colorDialog_, SIGNAL(currentColorChanged(QColor)),
            this, SLOT(setPointColorDialog(QColor)));
    
    QFrame* leftPanel = new QFrame(this);
    QGridLayout* leftLayout = new QGridLayout();
    leftLayout->setContentsMargins(0, 0, 0, 0);
    leftLayout->setSpacing(7);
    leftLayout->addWidget(zoomVSlider_,  0, 0);
    leftLayout->addWidget(tfEditorView_, 0, 1);
    leftLayout->addWidget(zoomHSlider_,  1, 1);
    leftLayout->addWidget(tfPreview_,    2, 1);
    leftLayout->addWidget(maskSlider_,   3, 1);
    leftPanel->setLayout(leftLayout);
    
    QFrame* rightPanel = new QFrame(this);
    QVBoxLayout* rightLayout = new QVBoxLayout();
    rightLayout->setContentsMargins(0, 0, 0, 0);
    rightLayout->setSpacing(7);
    rightLayout->setAlignment(Qt::AlignTop);
    rightLayout->addWidget(colorWheel_);
    rightLayout->addWidget(cmbInterpolation_);
    rightLayout->addWidget(chkShowHistogram_);
    rightLayout->addWidget(pointMoveMode_);
    rightLayout->addStretch(3);
    QHBoxLayout* rowLayout = new QHBoxLayout();
    rowLayout->addWidget(btnClearTF_);
    rowLayout->addWidget(btnImportTF_);
    rowLayout->addWidget(btnExportTF_);
    rightLayout->addLayout(rowLayout);


    rightPanel->setLayout(rightLayout);
    
    QWidget* mainPanel = new QWidget(this);
    QHBoxLayout* mainLayout = new QHBoxLayout();
    mainLayout->setContentsMargins(7, 7, 7, 7);
    mainLayout->setSpacing(7);
    mainLayout->addWidget(leftPanel);
    mainLayout->addWidget(rightPanel);
    mainPanel->setLayout(mainLayout);
    
    setWidget(mainPanel);
    connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
            this, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
    
    initialize(tfProperty_);
    setFloating(true);
    setVisible(false);
}