Example #1
1
    ExampleNode(QGraphicsScene *scene,
                QMenu *contextMenu = 0,
                QGraphicsItem *parent = 0,
                Qt::WindowFlags wFlags = 0) :
        NodeItem(NULL, wFlags, parent)
    {

        //dw new
        QFrame *outterFrame = new QFrame;
        //QWidget *outterFrame = new QWidget;
        outterFrame->setObjectName("outterFrame");
        //QFormLayout *formlayout = new QFormLayout;

        QVBoxLayout* outterLayout = new QVBoxLayout;
        outterLayout->setMargin(0);


        //QGroupBox *innerFrame = new QGroupBox(outterFrame/*"Contact Details"*/);
        //QFrame *innerFrame = new QFrame(outterFrame/*"Contact Details"*/);
        //QFrame *innerFrame = new QFrame(outterFrame);
        //QWidget *innerFrame = new QWidget(outterFrame);
        QFrame *innerFrame = new QFrame();
        innerFrame->setObjectName("innerFrame");

        //QLineEdit *numberEdit = new QLineEdit;
        //QFormLayout *layout = new QFormLayout;
        //QGridLayout  *innerGridLayout = new QGridLayout;
        innerGridLayout = new QGridLayout;
        topLayout = new QHBoxLayout();
        //innerGridLayout->addLayout(topLayout, 0, 0, 1, 2/*, Qt::AlignCenter*/);
        QFrame *topFrame = new QFrame;
        topFrame->setLayout(topLayout);
        innerGridLayout->addWidget(topFrame, 0, 0, 1, 2/*, Qt::AlignCenter*/);
        leftLayout = new QVBoxLayout();
        //innerGridLayout->addLayout(leftLayout, 1, 0, 1, 1/*, Qt::AlignLeft*/);
        QFrame *leftFrame = new QFrame;
        leftFrame->setLayout(leftLayout);
        innerGridLayout->addWidget(leftFrame, 1, 0, 1, 1/*, Qt::AlignLeft*/);
        rightLayout = new QVBoxLayout();
        //innerGridLayout->addLayout(rightLayout, 1, 1, 1, 1/*, Qt::AlignRight*/);
        QFrame *rightFrame = new QFrame;
        rightFrame->setLayout(rightLayout);
        innerGridLayout->addWidget(rightFrame, 1, 1, 1, 1/*, Qt::AlignRight*/);
        bottomLayout = new QHBoxLayout();
        //innerGridLayout->addLayout(bottomLayout, 2, 0, 1, 2/*, Qt::AlignCenter*/);
        QFrame *bottomFrame = new QFrame;
        bottomFrame->setLayout(bottomLayout);
        innerGridLayout->addWidget(bottomFrame, 2, 0, 1, 2/*, Qt::AlignCenter*/);

        topLayout->setMargin(0);
        leftLayout->setMargin(0);
        rightLayout->setMargin(0);
        bottomLayout->setMargin(0);


        innerGridLayout->setMargin(0);

        //formlayout->addWidget(innerFrame);
        //setWidget(innerFrame);
        //outterLayout->addWidget(innerFrame);

        //outterLayout->addLayout(innerGridLayout);
        innerFrame->setLayout(innerGridLayout);
        outterLayout->addWidget(innerFrame);

        //innerFrame->setLayout(innerGridLayout);
        outterFrame->setLayout(outterLayout);
        setWidget(outterFrame);

        outterFrame->setObjectName("ExampleBaseNode");
    }
Example #2
0
SvgWindow::SvgWindow(QWidget *parent)
{
    svgWidget = new SvgWidget;
    setWidget(svgWidget);
}
Example #3
0
DesignModeContext::DesignModeContext(QWidget *widget)
    : IContext(widget)
{
    setWidget(widget);
    setContext(Core::Context(Constants::C_QMLDESIGNER, Constants::C_QT_QUICK_TOOLS_MENU));
}
MainWindow::MainWindow(Settings& settings, Model& model, QWidget* parent)
    : QMainWindow(parent)
    , m_settings(settings)
    , m_model(model)
{
    m_tableView = new QTableView(this);
    m_tableView->setModel(&m_model);
    setCentralWidget(m_tableView);

    m_tableView->setAlternatingRowColors(true);
    m_tableView->sortByColumn(0, Qt::AscendingOrder);
    m_tableView->setSortingEnabled(true);
    m_tableView->setSelectionMode(QAbstractItemView::SingleSelection);
    m_tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
    m_tableView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    m_tableView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);

    m_tableView->verticalHeader()->setVisible(false);
    m_tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
    m_tableView->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);

    connect(m_tableView, &QTableView::activated, this, &MainWindow::activated);
    connect(m_tableView->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::currentChanged);

    const auto searchDock = new QDockWidget(tr("Search"), this);
    searchDock->setObjectName(QStringLiteral("searchDock"));
    addDockWidget(Qt::BottomDockWidgetArea, searchDock);

    const auto searchWidget = new QWidget(searchDock);
    searchDock->setWidget(searchWidget);

    const auto searchLayout = new QFormLayout(searchWidget);
    searchWidget->setLayout(searchLayout);

    m_searchTimer = new QTimer(this);
    m_searchTimer->setInterval(searchTimeout);

    m_channelBox = new QComboBox(searchWidget);
    m_channelBox->setModel(m_model.channels());
    m_channelBox->setEditable(true);
    m_channelBox->setMinimumContentsLength(minimumChannelLength);
    m_channelBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
    searchLayout->addRow(tr("Channel"), m_channelBox);

    m_topicBox = new QComboBox(searchWidget);
    m_topicBox->setModel(m_model.topics());
    m_topicBox->setEditable(true);
    m_topicBox->setMinimumContentsLength(minimumTopicLength);
    m_topicBox->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
    searchLayout->addRow(tr("Topic"), m_topicBox);

    m_titleEdit = new QLineEdit(searchWidget);
    m_titleEdit->setFocus();
    searchLayout->addRow(tr("Title"), m_titleEdit);

    connect(m_searchTimer, &QTimer::timeout, this, &MainWindow::timeout);

    constexpr auto startTimer = static_cast< void (QTimer::*)() >(&QTimer::start);
    connect(m_channelBox, &QComboBox::currentTextChanged, m_searchTimer, startTimer);
    connect(m_topicBox, &QComboBox::currentTextChanged, m_searchTimer, startTimer);
    connect(m_titleEdit, &QLineEdit::textChanged, m_searchTimer, startTimer);

    const auto buttonsWidget = new QWidget(searchWidget);
    searchLayout->addWidget(buttonsWidget);
    searchLayout->setAlignment(buttonsWidget, Qt::AlignRight);

    const auto buttonsLayout = new QBoxLayout(QBoxLayout::LeftToRight, buttonsWidget);
    buttonsWidget->setLayout(buttonsLayout);
    buttonsLayout->setSizeConstraint(QLayout::SetFixedSize);

    const auto resetFilterButton = new QPushButton(QIcon::fromTheme(QStringLiteral("edit-clear")), QString(), buttonsWidget);
    buttonsLayout->addWidget(resetFilterButton);

    const auto updateDatabaseButton = new QPushButton(QIcon::fromTheme(QStringLiteral("view-refresh")), QString(), buttonsWidget);
    buttonsLayout->addWidget(updateDatabaseButton);

    const auto editSettingsButton = new QPushButton(QIcon::fromTheme(QStringLiteral("preferences-system")), QString(), buttonsWidget);
    buttonsLayout->addWidget(editSettingsButton);

    connect(resetFilterButton, &QPushButton::pressed, this, &MainWindow::resetFilterPressed);
    connect(updateDatabaseButton, &QPushButton::pressed, this, &MainWindow::updateDatabasePressed);
    connect(editSettingsButton, &QPushButton::pressed, this, &MainWindow::editSettingsPressed);

    const auto detailsDock = new QDockWidget(tr("Details"), this);
    detailsDock->setObjectName(QStringLiteral("detailsDock"));
    addDockWidget(Qt::BottomDockWidgetArea, detailsDock);

    const auto detailsWidget = new QWidget(detailsDock);
    detailsDock->setWidget(detailsWidget);

    const auto detailsLayout = new QGridLayout(detailsWidget);
    detailsWidget->setLayout(detailsLayout);

    detailsLayout->setRowStretch(2, 1);
    detailsLayout->setColumnStretch(1, 1);

    m_descriptionEdit = new QTextEdit(detailsWidget);
    m_descriptionEdit->setReadOnly(true);
    m_descriptionEdit->setLineWrapMode(QTextEdit::WidgetWidth);
    detailsLayout->addWidget(m_descriptionEdit, 0, 1, 3, 1);

    m_websiteLabel = new QLabel(detailsWidget);
    detailsLayout->addWidget(m_websiteLabel, 3, 1);

    connect(m_websiteLabel, &QLabel::linkActivated, QDesktopServices::openUrl);

    const auto playButton = new QPushButton(QIcon::fromTheme(QStringLiteral("media-playback-start")), QString(), detailsWidget);
    detailsLayout->addWidget(playButton, 0, 0);

    const auto downloadButton = new QPushButton(QIcon::fromTheme(QStringLiteral("media-record")), QString(), detailsWidget);
    detailsLayout->addWidget(downloadButton, 1, 0);

    connect(playButton, &QPushButton::pressed, this, &MainWindow::playPressed);
    connect(downloadButton, &QPushButton::pressed, this, &MainWindow::downloadPressed);

    const auto quitShortcut = new QShortcut(QKeySequence::Quit, this);
    connect(quitShortcut, &QShortcut::activated, this, &MainWindow::close);

    restoreGeometry(m_settings.mainWindowGeometry());
    restoreState(m_settings.mainWindowState());

    statusBar()->showMessage(tr("Ready"), messageTimeout);
}
Example #5
0
void TimeLine::initUI()
{
    Q_ASSERT(editor() != nullptr);

    setWindowTitle(tr("Timeline"));

    QWidget* timeLineContent = new QWidget(this);

    mLayerList = new TimeLineCells(this, editor(), TIMELINE_CELL_TYPE::Layers);
    mTracks = new TimeLineCells(this, editor(), TIMELINE_CELL_TYPE::Tracks);

    mHScrollbar = new QScrollBar(Qt::Horizontal);
    mVScrollbar = new QScrollBar(Qt::Vertical);
    mVScrollbar->setMinimum(0);
    mVScrollbar->setMaximum(1);
    mVScrollbar->setPageStep(1);

    QWidget* leftWidget = new QWidget();
    leftWidget->setMinimumWidth(120);
    QWidget* rightWidget = new QWidget();

    QWidget* leftToolBar = new QWidget();
    leftToolBar->setFixedHeight(30);
    QWidget* rightToolBar = new QWidget();
    rightToolBar->setFixedHeight(30);

    // --- left widget ---
    // --------- layer buttons ---------
    QToolBar* layerButtons = new QToolBar(this);
    QLabel* layerLabel = new QLabel(tr("Layers:"));
    layerLabel->setIndent(5);

    QToolButton* addLayerButton = new QToolButton(this);
    addLayerButton->setIcon(QIcon(":icons/add.png"));
    addLayerButton->setToolTip(tr("Add Layer"));
    addLayerButton->setFixedSize(24, 24);

    QToolButton* removeLayerButton = new QToolButton(this);
    removeLayerButton->setIcon(QIcon(":icons/remove.png"));
    removeLayerButton->setToolTip(tr("Remove Layer"));
    removeLayerButton->setFixedSize(24, 24);

    layerButtons->addWidget(layerLabel);
    layerButtons->addWidget(addLayerButton);
    layerButtons->addWidget(removeLayerButton);
    layerButtons->setFixedHeight(30);

    QHBoxLayout* leftToolBarLayout = new QHBoxLayout();
    leftToolBarLayout->setMargin(0);
    leftToolBarLayout->addWidget(layerButtons);
    leftToolBar->setLayout(leftToolBarLayout);

    QAction* newBitmapLayerAct = new QAction(QIcon(":icons/layer-bitmap.png"), tr("New Bitmap Layer"), this);
    QAction* newVectorLayerAct = new QAction(QIcon(":icons/layer-vector.png"), tr("New Vector Layer"), this);
    QAction* newSoundLayerAct = new QAction(QIcon(":icons/layer-sound.png"), tr("New Sound Layer"), this);
    QAction* newCameraLayerAct = new QAction(QIcon(":icons/layer-camera.png"), tr("New Camera Layer"), this);

    QMenu* layerMenu = new QMenu(tr("&Layer", "Timeline add-layer menu"), this);
    layerMenu->addAction(newBitmapLayerAct);
    layerMenu->addAction(newVectorLayerAct);
    layerMenu->addAction(newSoundLayerAct);
    layerMenu->addAction(newCameraLayerAct);
    addLayerButton->setMenu(layerMenu);
    addLayerButton->setPopupMode(QToolButton::InstantPopup);

    QGridLayout* leftLayout = new QGridLayout();
    leftLayout->addWidget(leftToolBar, 0, 0);
    leftLayout->addWidget(mLayerList, 1, 0);
    leftLayout->setMargin(0);
    leftLayout->setSpacing(0);
    leftWidget->setLayout(leftLayout);

    // --- right widget ---
    // --------- key buttons ---------
    QToolBar* timelineButtons = new QToolBar(this);
    QLabel* keyLabel = new QLabel(tr("Keys:"));
    keyLabel->setIndent(5);

    QToolButton* addKeyButton = new QToolButton(this);
    addKeyButton->setIcon(QIcon(":icons/add.png"));
    addKeyButton->setToolTip(tr("Add Frame"));
    addKeyButton->setFixedSize(24, 24);

    QToolButton* removeKeyButton = new QToolButton(this);
    removeKeyButton->setIcon(QIcon(":icons/remove.png"));
    removeKeyButton->setToolTip(tr("Remove Frame"));
    removeKeyButton->setFixedSize(24, 24);

    QToolButton* duplicateKeyButton = new QToolButton(this);
    duplicateKeyButton->setIcon(QIcon(":icons/controls/duplicate.png"));
    duplicateKeyButton->setToolTip(tr("Duplicate Frame"));
    duplicateKeyButton->setFixedSize(24, 24);

    QLabel* zoomLabel = new QLabel(tr("Zoom:"));
    zoomLabel->setIndent(5);

    QSlider* zoomSlider = new QSlider(this);
    zoomSlider->setRange(4, 40);
    zoomSlider->setFixedWidth(74);
    zoomSlider->setValue(mTracks->getFrameSize());
    zoomSlider->setToolTip(tr("Adjust frame width"));
    zoomSlider->setOrientation(Qt::Horizontal);

    QLabel* onionLabel = new QLabel(tr("Onion skin:"));

    QToolButton* onionTypeButton = new QToolButton(this);
    onionTypeButton->setIcon(QIcon(":icons/onion_type.png"));
    onionTypeButton->setToolTip(tr("Toggle match keyframes"));
    onionTypeButton->setFixedSize(24, 24);

    timelineButtons->addWidget(keyLabel);
    timelineButtons->addWidget(addKeyButton);
    timelineButtons->addWidget(removeKeyButton);
    timelineButtons->addWidget(duplicateKeyButton);
    timelineButtons->addSeparator();
    timelineButtons->addWidget(zoomLabel);
    timelineButtons->addWidget(zoomSlider);
    timelineButtons->addSeparator();
    timelineButtons->addWidget(onionLabel);
    timelineButtons->addWidget(onionTypeButton);
    timelineButtons->addSeparator();
    timelineButtons->setFixedHeight(30);

    // --------- Time controls ---------
    mTimeControls = new TimeControls(this);
    mTimeControls->setEditor(editor());
    mTimeControls->initUI();
    mTimeControls->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
    updateLength();

    QHBoxLayout* rightToolBarLayout = new QHBoxLayout();
    rightToolBarLayout->addWidget(timelineButtons);
    rightToolBarLayout->setAlignment(Qt::AlignLeft);
    rightToolBarLayout->addWidget(mTimeControls);
    rightToolBarLayout->setMargin(0);
    rightToolBarLayout->setSpacing(0);
    rightToolBar->setLayout(rightToolBarLayout);

    QGridLayout* rightLayout = new QGridLayout();
    rightLayout->addWidget(rightToolBar, 0, 0);
    rightLayout->addWidget(mTracks, 1, 0);
    rightLayout->setMargin(0);
    rightLayout->setSpacing(0);
    rightWidget->setLayout(rightLayout);

    // --- Splitter ---
    QSplitter* splitter = new QSplitter(this);
    splitter->addWidget(leftWidget);
    splitter->addWidget(rightWidget);
    splitter->setSizes(QList<int>() << 100 << 600);


    QGridLayout* lay = new QGridLayout();
    lay->addWidget(splitter, 0, 0);
    lay->addWidget(mVScrollbar, 0, 1);
    lay->addWidget(mHScrollbar, 1, 0);
    lay->setMargin(0);
    lay->setSpacing(0);
    timeLineContent->setLayout(lay);
    setWidget(timeLineContent);

    setWindowFlags(Qt::WindowStaysOnTopHint);

    connect(mHScrollbar, &QScrollBar::valueChanged, mTracks, &TimeLineCells::hScrollChange);
    connect(mTracks, &TimeLineCells::offsetChanged, mHScrollbar, &QScrollBar::setValue);
    connect(mVScrollbar, &QScrollBar::valueChanged, mTracks, &TimeLineCells::vScrollChange);
    connect(mVScrollbar, &QScrollBar::valueChanged, mLayerList, &TimeLineCells::vScrollChange);

    connect(splitter, &QSplitter::splitterMoved, this, &TimeLine::updateLength);

    connect(addKeyButton, &QToolButton::clicked, this, &TimeLine::addKeyClick);
    connect(removeKeyButton, &QToolButton::clicked, this, &TimeLine::removeKeyClick);
    connect(duplicateKeyButton, &QToolButton::clicked, this, &TimeLine::duplicateKeyClick);
    connect(zoomSlider, &QSlider::valueChanged, mTracks, &TimeLineCells::setFrameSize);
    connect(onionTypeButton, &QToolButton::clicked, this, &TimeLine::toogleAbsoluteOnionClick);

    connect(mTimeControls, &TimeControls::soundToggled, this, &TimeLine::soundClick);
    connect(mTimeControls, &TimeControls::fpsChanged, this, &TimeLine::fpsChanged);
    connect(mTimeControls, &TimeControls::fpsChanged, this, &TimeLine::updateLength);
    connect(mTimeControls, &TimeControls::playButtonTriggered, this, &TimeLine::playButtonTriggered);

    connect(newBitmapLayerAct, &QAction::triggered, this, &TimeLine::newBitmapLayer);
    connect(newVectorLayerAct, &QAction::triggered, this, &TimeLine::newVectorLayer);
    connect(newSoundLayerAct, &QAction::triggered, this, &TimeLine::newSoundLayer);
    connect(newCameraLayerAct, &QAction::triggered, this, &TimeLine::newCameraLayer);
    connect(removeLayerButton, &QPushButton::clicked, this, &TimeLine::deleteCurrentLayer);

    connect(mLayerList, &TimeLineCells::mouseMovedY, mLayerList, &TimeLineCells::setMouseMoveY);
    connect(mLayerList, &TimeLineCells::mouseMovedY, mTracks, &TimeLineCells::setMouseMoveY);
    connect(mTracks, &TimeLineCells::lengthChanged, this, &TimeLine::updateLength);

    connect(editor(), &Editor::currentFrameChanged, this, &TimeLine::updateFrame);

    LayerManager* layer = editor()->layers();
    connect(layer, &LayerManager::layerCountChanged, this, &TimeLine::updateLayerNumber);

    scrubbing = false;
}
ConsoleWidget::ConsoleWidget(QWidget* parent)
    : InviwoDockWidget(tr("Console"), parent)
    , infoTextColor_(153, 153, 153)
    , warnTextColor_(221, 165, 8)
    , errorTextColor_(255, 107, 107)
    , errorsLabel_(nullptr)
    , warningsLabel_(nullptr)
    , infoLabel_(nullptr)
    , numErrors_(0)
    , numWarnings_(0)
    , numInfos_(0) {
    setObjectName("ConsoleWidget");
    setAllowedAreas(Qt::BottomDockWidgetArea);
    textField_ = new QTextEdit(this);
    textField_->setReadOnly(true);
    textField_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    textField_->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(textField_, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&)));

    QHBoxLayout *statusBar = new QHBoxLayout();

    errorsLabel_ = new QLabel("0", this);
    warningsLabel_ = new QLabel("0", this);
    infoLabel_ = new QLabel("0", this);

    QFrame* line1 = new QFrame();
    QFrame* line2 = new QFrame();
    QFrame* line3 = new QFrame();
    line1->setFrameShape(QFrame::VLine);
    line2->setFrameShape(QFrame::VLine);
    line3->setFrameShape(QFrame::VLine);
    
    line1->setFrameShadow(QFrame::Raised);
    line2->setFrameShadow(QFrame::Raised);
    line3->setFrameShadow(QFrame::Raised);

    statusBar->addWidget(new QLabel( "<img width='16' height='16' src=':/icons/error.png'>", this));
    statusBar->addWidget(errorsLabel_);
    statusBar->addWidget(line1);
    statusBar->addWidget(new QLabel( "<img width='16' height='16' src=':/icons/warning.png'>", this));
    statusBar->addWidget(warningsLabel_);
    statusBar->addWidget(line2);
    statusBar->addWidget(new QLabel( "<img width='16' height='16' src=':/icons/info.png'>", this));
    statusBar->addWidget(infoLabel_);
    statusBar->addWidget(line3);
    

    statusBar->addItem(new QSpacerItem(40, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
    
    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(textField_);
    layout->addLayout(statusBar);

    layout->setContentsMargins(3, 0, 0, 3);


    QWidget* w = new QWidget();
    w->setLayout(layout);
    setWidget(w);


    connect(this, SIGNAL(logMessageSignal(int, QString)), this, SLOT(logMessage(int, QString)));
    connect(this, SIGNAL(clearSignal()), this, SLOT(clear()));
}
void ChatEmoticonMenu::setEmoticons(QHash<QString, QStringList> list)
{
	clearList();
	m_widget = new QWidget;
	m_grid_layout = new QGridLayout(m_widget);
	m_grid_layout->setSpacing(1);
	m_widget->setLayout(m_grid_layout);
	int max_len_size = 0;

	m_desktop_geometry = QSize();

	QHash<int, QString> emotOrder;
	{
		QHashIterator<QString, QStringList> i(list);
		while (i.hasNext())
		{
			i.next();
			QString key = i.key();
			list.remove(key);
			int index = key.indexOf("|");
			int num = key.mid(0, index).toInt();
			key.remove(0, index+1);
			emotOrder.insert(num, key);
			list.insert(key, i.value());
		}
	}

        QHashIterator<int, QString> i(emotOrder);
	while (i.hasNext())
	{
		i.next();
		QStringList values = list.value(i.value());
		if(!values.size())
			continue;

		movieLabel *label = new movieLabel;
		labelList << label;
		QMovie *movie = new QMovie(i.value());
		movieList << movie;
		label->setMovie(movie);
		movie->setCacheMode(QMovie::CacheAll);
		movie->start();
                QSize size = movie->currentPixmap().size();
                label->setMinimumSize(size);
                sizeList << size;
		label->setToolTip(values.first());
		connect(label, SIGNAL(sendMovieTip(const QString &)), this, SIGNAL(insertSmile(const QString &)));
                label->setInsOnUp(m_insonup);
		movie->stop();
	}
//
//	int sq  = std::ceil(std::sqrt((float)list.count()));
//
//	int i = 0, j = 0;
//
//	foreach(const QString &path, emotList)
//	{
//		QStringList values = list.value(path);
//		if(!values.size())
//			continue;
//		movieLabel *l = new movieLabel;
////		QMovie *movie = new QMovie(path + "/" + list.key(name));
//		QMovie *movie = new QMovie(path);
//		movieList.append(movie);
//		l->setMovie(movie);
//		movie->setCacheMode(QMovie::CacheAll);
//		movie->start();
//		QSize movie_size = movie->currentPixmap().size();
//		l->setMinimumSize(movie_size);
//		labelList.append(l);
//		l->setToolTip(values.first());
//		connect(l, SIGNAL(sendMovieTip(const QString &)), this, SIGNAL(insertSmile(const QString &)));
//		m_grid_layout->addWidget(l,i,j);
//		if ( j < sq )
//			j++;
//		else
//		{
//			i++;
//			j = 0;
//		}
//		movie->stop();
//	}
	setWidget(m_widget);
}
AMP_ScrollWidgetAssetProp::AMP_ScrollWidgetAssetProp(const QWidget *parent) : MgScrollArea((QWidget *)parent)
{
  m_WidgetAssetProp = new AMP_WidgetAssetProp(this);
  setWidget(m_WidgetAssetProp);
  setFocusPolicy(Qt::WheelFocus);
}
 PmhContext(PmhContextualWidget *w) : Core::IContext(w)
 {
     setObjectName("PmhContext");
     setWidget(w);
 }
Example #10
0
void ImageViewer::ctor()
{
    d->imageView = new ImageView(d->file.data());

    setContext(Core::Context(Constants::IMAGEVIEWER_ID));
    setWidget(d->imageView);
    setDuplicateSupported(true);

    // toolbar
    d->toolbar = new QWidget();
    d->ui_toolbar.setupUi(d->toolbar);
    d->ui_toolbar.toolButtonExportImage->setIcon(Utils::Icons::EXPORTFILE_TOOLBAR.icon());
    d->ui_toolbar.toolButtonMultiExportImages->setIcon(Utils::Icons::MULTIEXPORTFILE_TOOLBAR.icon());
    const Utils::Icon backgroundIcon({
            {QLatin1String(":/utils/images/desktopdevicesmall.png"), Utils::Theme::IconsBaseColor}});
    d->ui_toolbar.toolButtonBackground->setIcon(backgroundIcon.icon());
    d->ui_toolbar.toolButtonOutline->setIcon(Utils::Icons::BOUNDING_RECT.icon());
    d->ui_toolbar.toolButtonZoomIn->setIcon(
        Core::ActionManager::command(Core::Constants::ZOOM_IN)->action()->icon());
    d->ui_toolbar.toolButtonZoomOut->setIcon(
        Core::ActionManager::command(Core::Constants::ZOOM_OUT)->action()->icon());
    d->ui_toolbar.toolButtonOriginalSize->setIcon(
        Core::ActionManager::command(Core::Constants::ZOOM_RESET)->action()->icon());
    d->ui_toolbar.toolButtonFitToScreen->setIcon(Utils::Icons::FITTOVIEW_TOOLBAR.icon());
    // icons update - try to use system theme
    updateButtonIconByTheme(d->ui_toolbar.toolButtonFitToScreen, QLatin1String("zoom-fit-best"));
    // a display - something is on the background
    updateButtonIconByTheme(d->ui_toolbar.toolButtonBackground, QLatin1String("video-display"));
    // "emblem to specify the directory where the user stores photographs"
    // (photograph has outline - piece of paper)
    updateButtonIconByTheme(d->ui_toolbar.toolButtonOutline, QLatin1String("emblem-photos"));

    d->ui_toolbar.toolButtonExportImage->setCommandId(Constants::ACTION_EXPORT_IMAGE);
    d->ui_toolbar.toolButtonMultiExportImages->setCommandId(Constants::ACTION_EXPORT_MULTI_IMAGES);
    d->ui_toolbar.toolButtonZoomIn->setCommandId(Core::Constants::ZOOM_IN);
    d->ui_toolbar.toolButtonZoomOut->setCommandId(Core::Constants::ZOOM_OUT);
    d->ui_toolbar.toolButtonOriginalSize->setCommandId(Core::Constants::ZOOM_RESET);
    d->ui_toolbar.toolButtonFitToScreen->setCommandId(Constants::ACTION_FIT_TO_SCREEN);
    d->ui_toolbar.toolButtonBackground->setCommandId(Constants::ACTION_BACKGROUND);
    d->ui_toolbar.toolButtonOutline->setCommandId(Constants::ACTION_OUTLINE);
    d->ui_toolbar.toolButtonPlayPause->setCommandId(Constants::ACTION_TOGGLE_ANIMATION);

    // connections
    connect(d->ui_toolbar.toolButtonExportImage, &QAbstractButton::clicked,
            d->imageView, &ImageView::exportImage);
    connect(d->ui_toolbar.toolButtonMultiExportImages, &QAbstractButton::clicked,
            d->imageView, &ImageView::exportMultiImages);
    connect(d->ui_toolbar.toolButtonZoomIn, &QAbstractButton::clicked,
            d->imageView, &ImageView::zoomIn);
    connect(d->ui_toolbar.toolButtonZoomOut, &QAbstractButton::clicked,
            d->imageView, &ImageView::zoomOut);
    connect(d->ui_toolbar.toolButtonFitToScreen, &QAbstractButton::clicked,
            d->imageView, &ImageView::fitToScreen);
    connect(d->ui_toolbar.toolButtonOriginalSize, &QAbstractButton::clicked,
            d->imageView, &ImageView::resetToOriginalSize);
    connect(d->ui_toolbar.toolButtonBackground, &QAbstractButton::toggled,
            d->imageView, &ImageView::setViewBackground);
    connect(d->ui_toolbar.toolButtonOutline, &QAbstractButton::toggled,
            d->imageView, &ImageView::setViewOutline);
    connect(d->ui_toolbar.toolButtonPlayPause, &Core::CommandButton::clicked,
            this, &ImageViewer::playToggled);
    connect(d->file.data(), &ImageViewerFile::imageSizeChanged,
            this, &ImageViewer::imageSizeUpdated);
    connect(d->file.data(), &ImageViewerFile::openFinished,
            d->imageView, &ImageView::createScene);
    connect(d->file.data(), &ImageViewerFile::openFinished,
            this, &ImageViewer::updateToolButtons);
    connect(d->file.data(), &ImageViewerFile::aboutToReload,
            d->imageView, &ImageView::reset);
    connect(d->file.data(), &ImageViewerFile::reloadFinished,
            d->imageView, &ImageView::createScene);
    connect(d->file.data(), &ImageViewerFile::isPausedChanged,
            this, &ImageViewer::updatePauseAction);
    connect(d->imageView, &ImageView::scaleFactorChanged,
            this, &ImageViewer::scaleFactorUpdate);
}
Example #11
0
LutDockerDock::LutDockerDock()
    : QDockWidget(i18n("LUT Management"))
    , m_canvas(0)
    , m_draggingSlider(false)
{
    m_exposureCompressor.reset(new KisSignalCompressorWithParam<qreal>(40, boost::bind(&LutDockerDock::setCurrentExposureImpl, this, _1)));
    m_gammaCompressor.reset(new KisSignalCompressorWithParam<qreal>(40, boost::bind(&LutDockerDock::setCurrentGammaImpl, this, _1)));

    m_page = new QWidget(this);
    setupUi(m_page);
    setWidget(m_page);

    KisConfig cfg;
    m_chkUseOcio->setChecked(cfg.useOcio());
    connect(m_chkUseOcio, SIGNAL(toggled(bool)), SLOT(updateDisplaySettings()));
    connect(m_colorManagement, SIGNAL(currentIndexChanged(int)), SLOT(slotColorManagementModeChanged()));

    m_txtConfigurationPath->setText(cfg.ocioConfigurationPath());

    m_bnSelectConfigurationFile->setToolTip(i18n("Select custom configuration file."));
    connect(m_bnSelectConfigurationFile,SIGNAL(clicked()), SLOT(selectOcioConfiguration()));

    m_txtLut->setText(cfg.ocioLutPath());

    m_bnSelectLut->setToolTip(i18n("Select LUT file"));
    connect(m_bnSelectLut, SIGNAL(clicked()), SLOT(selectLut()));
    connect(m_bnClearLut, SIGNAL(clicked()), SLOT(clearLut()));

    // See http://groups.google.com/group/ocio-dev/browse_thread/thread/ec95c5f54a74af65 -- maybe need to be reinstated
    // when people ask for it.
    m_lblLut->hide();
    m_txtLut->hide();
    m_bnSelectLut->hide();
    m_bnClearLut->hide();

    connect(m_cmbDisplayDevice, SIGNAL(currentIndexChanged(int)), SLOT(refillViewCombobox()));

    m_exposureDoubleWidget->setToolTip(i18n("Select the exposure (stops) for HDR images."));
    m_exposureDoubleWidget->setRange(-10, 10);
    m_exposureDoubleWidget->setPrecision(1);
    m_exposureDoubleWidget->setValue(0.0);
    m_exposureDoubleWidget->setSingleStep(0.25);
    m_exposureDoubleWidget->setPageStep(1);

    connect(m_exposureDoubleWidget, SIGNAL(valueChanged(double)), SLOT(exposureValueChanged(double)));
    connect(m_exposureDoubleWidget, SIGNAL(sliderPressed()), SLOT(exposureSliderPressed()));
    connect(m_exposureDoubleWidget, SIGNAL(sliderReleased()), SLOT(exposureSliderReleased()));

    // Gamma needs to be exponential (gamma *= 1.1f, gamma /= 1.1f as steps)

    m_gammaDoubleWidget->setToolTip(i18n("Select the amount of gamma modification for display. This does not affect the pixels of your image."));
    m_gammaDoubleWidget->setRange(0.1, 5);
    m_gammaDoubleWidget->setPrecision(2);
    m_gammaDoubleWidget->setValue(1.0);
    m_gammaDoubleWidget->setSingleStep(0.1);
    m_gammaDoubleWidget->setPageStep(1);

    connect(m_gammaDoubleWidget, SIGNAL(valueChanged(double)), SLOT(gammaValueChanged(double)));
    connect(m_gammaDoubleWidget, SIGNAL(sliderPressed()), SLOT(gammaSliderPressed()));
    connect(m_gammaDoubleWidget, SIGNAL(sliderReleased()), SLOT(gammaSliderReleased()));

    m_bwPointChooser = new BlackWhitePointChooser(this);

    connect(m_bwPointChooser, SIGNAL(sigBlackPointChanged(qreal)), SLOT(updateDisplaySettings()));
    connect(m_bwPointChooser, SIGNAL(sigWhitePointChanged(qreal)), SLOT(updateDisplaySettings()));

    connect(m_btnConvertCurrentColor, SIGNAL(toggled(bool)), SLOT(updateDisplaySettings()));
    connect(m_btmShowBWConfiguration, SIGNAL(clicked()), SLOT(slotShowBWConfiguration()));
    slotUpdateIcons();

    connect(m_cmbInputColorSpace, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));
    connect(m_cmbDisplayDevice, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));
    connect(m_cmbView, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));
    connect(m_cmbComponents, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));

    m_draggingSlider = false;

    connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(resetOcioConfiguration()));

    m_displayFilter = 0;

    resetOcioConfiguration();
}
Example #12
0
/// UAreaResultsTable
UAreaResultsTable::UAreaResultsTable(QWidget *parent):
    QScrollArea(parent)
{
    setWidgetResizable(true);

    mainWidget = new QWidget();
    vBoxLayoutMain = new QVBoxLayout();

    tableNotes = new UTableNotes();
    tableRecycleBin = new UTableRecycleBin();

    // убираем массовое выделение строк
    tableNotes->setSelectionMode(QAbstractItemView::SingleSelection);
    tableRecycleBin->setSelectionMode(QAbstractItemView::SingleSelection);

    groupBoxTableNotes = new QGroupBox();
    groupBoxTableRecycleBin = new QGroupBox();

    groupBoxTableNotes->setCheckable(true);
    groupBoxTableNotes->setChecked(true);
    connect(groupBoxTableNotes, SIGNAL(toggled(bool)),
            this, SLOT(setVisibleContentGroupBoxTableNotes(bool)));

    groupBoxTableRecycleBin->setCheckable(true);
    groupBoxTableRecycleBin->setChecked(true);
    connect(groupBoxTableRecycleBin, SIGNAL(toggled(bool)),
            this, SLOT(setVisibleContentGroupBoxTableRecycleBin(bool)));


    pButtonUnselectTableNotesPage = new QPushButton();
    pButtonSelectAllTableNotesPage = new QPushButton();

    connect(pButtonUnselectTableNotesPage, SIGNAL(clicked()),
            this, SLOT(unselectTableNotesPage()));
    connect(pButtonSelectAllTableNotesPage, SIGNAL(clicked()),
            this, SLOT(selectAllTableNotesPage()));

    QHBoxLayout *hBoxLayoutButtonsTableNotesPage = new QHBoxLayout();
    hBoxLayoutButtonsTableNotesPage->addWidget(pButtonSelectAllTableNotesPage);
    hBoxLayoutButtonsTableNotesPage->addWidget(pButtonUnselectTableNotesPage);
    hBoxLayoutButtonsTableNotesPage->addStretch();


    QVBoxLayout *vBoxLayoutGroupBoxTableNotes = new QVBoxLayout();
    vBoxLayoutGroupBoxTableNotes->addLayout(hBoxLayoutButtonsTableNotesPage);
    vBoxLayoutGroupBoxTableNotes->addWidget(tableNotes);
    groupBoxTableNotes->setLayout(vBoxLayoutGroupBoxTableNotes);


    pButtonUnselectTableRecycleBinPage = new QPushButton();
    pButtonSelectAllTableRecycleBinPage = new QPushButton();

    connect(pButtonUnselectTableRecycleBinPage, SIGNAL(clicked()),
            this, SLOT(unselectTableRecycleBinPage()));
    connect(pButtonSelectAllTableRecycleBinPage, SIGNAL(clicked()),
            this, SLOT(selectAllTableRecycleBinPage()));

    QHBoxLayout *hBoxLayoutButtonsTableRecycleBin = new QHBoxLayout();
    hBoxLayoutButtonsTableRecycleBin->addWidget(pButtonSelectAllTableRecycleBinPage);
    hBoxLayoutButtonsTableRecycleBin->addWidget(pButtonUnselectTableRecycleBinPage);
    hBoxLayoutButtonsTableRecycleBin->addStretch();

    QVBoxLayout *vBoxLayoutGroupBoxTableRecycleBin = new QVBoxLayout();
    vBoxLayoutGroupBoxTableRecycleBin->addLayout(hBoxLayoutButtonsTableRecycleBin);
    vBoxLayoutGroupBoxTableRecycleBin->addWidget(tableRecycleBin);
    groupBoxTableRecycleBin->setLayout(vBoxLayoutGroupBoxTableRecycleBin);

    vBoxLayoutMain->addWidget(groupBoxTableNotes);
    vBoxLayoutMain->addWidget(groupBoxTableRecycleBin);
    vBoxLayoutMain->addStretch();

    mainWidget->setLayout(vBoxLayoutMain);
    setWidget(mainWidget);


    //
    tableNotes->setItemDelegateForColumn(indexColumnTitle,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnVisible,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnDateOfCreating,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnCountTextSymbols,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnCountTextLines,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnDateLastChange,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnLock,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnDateOfLastRemoval,
                                         new ReadDelegate());
    tableNotes->setItemDelegateForColumn(indexColumnDateOfLastRestore,
                                         new ReadDelegate());


    connect(tableNotes, SIGNAL(clickActionDeleteItem()),
            this, SLOT(converterMoveNoteToRecycleBin()));
    connect(tableNotes, SIGNAL(clickActionSettingsItem()),
            this, SLOT(converterShowSettingsNote()));
    connect(tableNotes, SIGNAL(clickActionShowItem()),
            this, SLOT(converterShowNote()));
    connect(tableNotes, SIGNAL(clickActionHideItem()),
            this, SLOT(converterHideNote()));

    connect(tableRecycleBin, SIGNAL(clickActionRestoreItem(int)),
            this, SLOT(converterRestoreNote(int)));
    connect(tableRecycleBin, SIGNAL(clickActionDeleteItem(int)),
            this, SLOT(converterDeleteNote(int)));
}
DataSetValuesView::DataSetValuesView(DataSetValues* dsv) : WorkspaceDockWidget(dsv,dsv->GetName()), m_bufferValues(dsv), m_loading(false)
{
   setAcceptDrops(true);

   SetupKeyboardShortcuts();

   m_table = new QTableView();
   m_tableModel = new DataSetValuesViewTableModel(dsv);
   m_table->setModel(m_tableModel);
   m_table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

   m_scroll = new BigScrollbar(this, Qt::Vertical);

   QFont fixedFont("Monospace");
   fixedFont.setStyleHint(QFont::TypeWriter);
   m_table->setFont(fixedFont);

   m_valueColumns = new QComboBox();
   for (int i = 1; i <=16; ++i)
   {
      m_valueColumns->addItem(QString::number(i),i);
   }

   m_valueFormat = new QComboBox();
   m_valueFormat->addItem(tr("Value"),DataSetValues::DISPLAY_FORMAT_VALUE);
   m_valueFormat->addItem(tr("Hex"),DataSetValues::DISPLAY_FORMAT_HEX);
   m_valueFormat->addItem(tr("Octal"),DataSetValues::DISPLAY_FORMAT_OCT);

   m_valueDataType = new QComboBox();
   m_valueDataType->addItem(tr("uint8"),TERBIT_UINT8);
   m_valueDataType->addItem(tr("uint16"),TERBIT_UINT16);
   m_valueDataType->addItem(tr("uint32"),TERBIT_UINT32);
   m_valueDataType->addItem(tr("uint64"),TERBIT_UINT64);
   m_valueDataType->addItem(tr("int8"),TERBIT_INT8);
   m_valueDataType->addItem(tr("int16"),TERBIT_INT16);
   m_valueDataType->addItem(tr("int32"),TERBIT_INT32);
   m_valueDataType->addItem(tr("int64"),TERBIT_INT64);
   m_valueDataType->addItem(tr("float"),TERBIT_FLOAT);
   m_valueDataType->addItem(tr("double"),TERBIT_DOUBLE);

   m_indexFormat = new QComboBox();
   m_indexFormat->addItem(tr("Value"),DataSetValues::DISPLAY_FORMAT_VALUE);
   m_indexFormat->addItem(tr("Hex"),DataSetValues::DISPLAY_FORMAT_HEX);
   m_indexFormat->addItem(tr("Octal"),DataSetValues::DISPLAY_FORMAT_OCT);

   m_gotoIndex = new QLineEdit();

   m_refresh = new QPushButton(tr("Refresh"));

   QVBoxLayout* l = new QVBoxLayout();

   QHBoxLayout* settingsLayout = new QHBoxLayout();
   settingsLayout->addWidget(new QLabel(tr("Index")));
   settingsLayout->addWidget(new QLabel(tr("Format")));
   settingsLayout->addWidget(m_indexFormat);
   settingsLayout->addWidget(m_gotoIndex);
   QPushButton* btnGotoAddress = new QPushButton(tr("Go To"));
   settingsLayout->addWidget(btnGotoAddress);
   settingsLayout->addStretch();
   l->addLayout(settingsLayout);

   settingsLayout = new QHBoxLayout();
   settingsLayout->addWidget(new QLabel(tr("Data Type")));
   settingsLayout->addWidget(m_valueDataType);
   settingsLayout->addStretch();
   l->addLayout(settingsLayout);

   settingsLayout = new QHBoxLayout();
   settingsLayout->addWidget(new QLabel(tr("Format")));
   settingsLayout->addWidget(m_valueFormat);
   settingsLayout->addWidget(new QLabel(tr("Columns")));
   settingsLayout->addWidget(m_valueColumns);
   settingsLayout->addStretch();
   settingsLayout->addWidget(m_refresh);
   l->addLayout(settingsLayout);

   settingsLayout = new QHBoxLayout();
   settingsLayout->setSpacing(2);
   settingsLayout->setMargin(0);
   settingsLayout->addWidget(m_table,1);
   settingsLayout->addWidget(m_scroll,0);
   l->addLayout(settingsLayout);

   QWidget* wrapper = new QWidget();
   wrapper->setLayout(l);
   setWidget(wrapper); //must use wrapper widget for dockwidget stuffs

   //listen for gui events
   connect(m_valueDataType,SIGNAL(currentIndexChanged(int)), this, SLOT(OnDataTypeChanged(int)));
   connect(m_valueFormat,SIGNAL(currentIndexChanged(int)), this, SLOT(OnFormatChanged(int)));
   connect(m_valueColumns,SIGNAL(currentIndexChanged(int)), this, SLOT(OnColumnsChanged(int)));
   connect(m_indexFormat,SIGNAL(currentIndexChanged(int)), this, SLOT(OnIndexFormatChanged(int)));
   connect(btnGotoAddress,SIGNAL(clicked()),this,SLOT(GotoIndex()));
   connect(m_refresh,SIGNAL(clicked()),this,SLOT(OnRefreshData()));
   connect(m_scroll,SIGNAL(PositionChanged()),this,SLOT(OnTableScrolled()));

   //listen for model events
   connect(m_bufferValues,SIGNAL(ModelNewData()),this, SLOT(OnModelNewData()));
   connect(m_bufferValues,SIGNAL(ModelStructureChanged()), this, SLOT(OnModelStructureChanged()));
   connect(m_bufferValues,SIGNAL(NameChanged(DataClass*)),this, SLOT(OnModelNameChanged(DataClass*)));

   //get gui in sync with settings . . . simulate structure change
   OnModelStructureChanged();
   m_table->horizontalHeader()->resizeSections(QHeaderView::Stretch);
}
Example #14
0
TextTools::TextTools(QWidget* parent)
   : QDockWidget(parent)
      {
      setObjectName("text-tools");
      setWindowTitle(tr("Text Tools"));
      setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));
      setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);

      text = nullptr;
      cursor = nullptr;

      QToolBar* tb = new QToolBar(tr("Text Edit"));
      tb->setIconSize(QSize(preferences.iconWidth * guiScaling, preferences.iconHeight * guiScaling));

      showKeyboard = getAction("show-keys");
      showKeyboard->setCheckable(true);
      tb->addAction(showKeyboard);

      typefaceBold = tb->addAction(*icons[int(Icons::textBold_ICON)], "");
      typefaceBold->setToolTip(tr("Bold"));
      typefaceBold->setCheckable(true);

      typefaceItalic = tb->addAction(*icons[int(Icons::textItalic_ICON)], "");
      typefaceItalic->setToolTip(tr("Italic"));
      typefaceItalic->setCheckable(true);

      typefaceUnderline = tb->addAction(*icons[int(Icons::textUnderline_ICON)], "");
      typefaceUnderline->setToolTip(tr("Underline"));
      typefaceUnderline->setCheckable(true);

      tb->addSeparator();

      typefaceSubscript   = tb->addAction(*icons[int(Icons::textSub_ICON)], "");
      typefaceSubscript->setToolTip(tr("Subscript"));
      typefaceSubscript->setCheckable(true);

      typefaceSuperscript = tb->addAction(*icons[int(Icons::textSuper_ICON)], "");
      typefaceSuperscript->setToolTip(tr("Superscript"));
      typefaceSuperscript->setCheckable(true);

      tb->addSeparator();

      typefaceFamily = new QFontComboBox(this);
      typefaceFamily->setEditable(false);
      tb->addWidget(typefaceFamily);

      typefaceSize = new QDoubleSpinBox(this);
      typefaceSize->setFocusPolicy(Qt::ClickFocus);
      typefaceSize->setMinimum(1);
      tb->addWidget(typefaceSize);

      setWidget(tb);
      QWidget* w = new QWidget(this);
      setTitleBarWidget(w);
      titleBarWidget()->hide();

      connect(typefaceSize,        SIGNAL(valueChanged(double)), SLOT(sizeChanged(double)));
      connect(typefaceFamily,      SIGNAL(currentFontChanged(const QFont&)), SLOT(fontChanged(const QFont&)));
      connect(typefaceBold,        SIGNAL(triggered(bool)), SLOT(boldClicked(bool)));
      connect(typefaceItalic,      SIGNAL(triggered(bool)), SLOT(italicClicked(bool)));
      connect(typefaceUnderline,   SIGNAL(triggered(bool)), SLOT(underlineClicked(bool)));
      connect(typefaceSubscript,   SIGNAL(triggered(bool)), SLOT(subscriptClicked(bool)));
      connect(typefaceSuperscript, SIGNAL(triggered(bool)), SLOT(superscriptClicked(bool)));
      connect(showKeyboard,        SIGNAL(toggled(bool)),   SLOT(showKeyboardClicked(bool)));
      }
Example #15
0
UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent)
        : UBGraphicsProxyWidget(parent)
        , mMuted(sIsMutedByDefault)
        , mMutedByUserAction(sIsMutedByDefault)
        , mMediaFileUrl(pMediaFileUrl)
        , mInitialPos(0)
        , mVideoWidget(NULL)
        , mAudioWidget(NULL)
        , mLinkedImage(NULL)
{
    update();

    mMediaObject = new Phonon::MediaObject(this);
    if (pMediaFileUrl.toLocalFile().contains("videos")) 
    {
        mMediaType = mediaType_Video;

        mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
        mMediaObject->setTickInterval(50);
        mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
        Phonon::createPath(mMediaObject, mVideoWidget);

        /*
         * The VideoVidget should recover the size from the original movie, but this is not always true expecially on
         * windows and linux os. I don't know why?
         * In this case the wiget size is equal to QSize(1,1).
         */

        if(mVideoWidget->sizeHint() == QSize(1,1)){
            mVideoWidget->resize(320,240);
        }
        setWidget(mVideoWidget);
        haveLinkedImage = true;
    }
    else    
    if (pMediaFileUrl.toLocalFile().contains("audios"))
    {
        mMediaType = mediaType_Audio;
        mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);

        mMediaObject->setTickInterval(1000);
        mAudioWidget = new QWidget();
        mAudioWidget->resize(320,26);
        setWidget(mAudioWidget);
        haveLinkedImage = false;
    }

    Phonon::createPath(mMediaObject, mAudioOutput);
    
    mSource = Phonon::MediaSource(pMediaFileUrl);
    mMediaObject->setCurrentSource(mSource);

    UBGraphicsMediaItemDelegate* itemDelegate = new UBGraphicsMediaItemDelegate(this, mMediaObject);
    itemDelegate->init();
    setDelegate(itemDelegate);

    mDelegate->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);

    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly

    connect(mDelegate, SIGNAL(showOnDisplayChanged(bool)), this, SLOT(showOnDisplayChanged(bool)));
    connect(mMediaObject, SIGNAL(hasVideoChanged(bool)), this, SLOT(hasMediaChanged(bool)));

}
MenuToolWidget::MenuToolWidget(const QString title, QWidget* pParent ) :
    BaseDockWidget( title, pParent, Qt::Tool )
{
    setWindowFlags(Qt::FramelessWindowHint);     //也是去掉标题栏的语句
    setTitleBarWidget(new QWidget);
    QFrame* toolGroup = new QFrame();
    toolGroup->setStyleSheet("background-image: url(:icons/b2.jpg)");
    setWidget(toolGroup);

    QGridLayout* layout = new QGridLayout();

    openButton = newToolButton(QPixmap(":icons/open.png"), tr("Pencil Tool <b>(N)</b>: Sketch with pencil"));
    saveButton = newToolButton(QPixmap(":icons/save.png"), tr("Select Tool <b>(V)</b>: Select an object"));
    loadButton = newToolButton(QPixmap(":icons/mirrorV.png"), tr("Move Tool <b>(Q)</b>: Move an object"));
    cutButton = newToolButton(QPixmap(":icons/cut.png"), tr("Hand Tool <b>(H)</b>: Move the canvas"));
    copyButton = newToolButton(QPixmap(":icons/copy.png"), tr("Pen Tool <b>(P)</b>: Sketch with pen"));
    pasteButton = newToolButton(QPixmap(":icons/paste.png"), tr("Eraser Tool <b>(E)</b>: Erase"));
    undoButton = newToolButton(QPixmap(":icons/undo.png"), tr("Polyline Tool <b>(Y)</b>: Create line/curves"));
    recycleButton = newToolButton(QPixmap(":icons/redo.png"), tr("Paint Bucket Tool <b>(K)</b>: Fill selected area with a color"));
    onionupButton = newToolButton(QPixmap(":icons/onionPrev.png"), tr("Brush Tool <b>(B)</b>: Paint smooth stroke with a brush"));
    oniondownButton = newToolButton(QPixmap(":icons/onionNext.png"), tr("Eyedropper Tool <b>(I)</b>: Set color from the stage<br><b>[ALT]</b> for instant access"));


//    pencilButton->setWhatsThis(tr("Pencil Tool (N)"));
//    selectButton->setWhatsThis(tr("Select Tool (V)"));
//    moveButton->setWhatsThis(tr("Move Tool (Q)"));
//    handButton->setWhatsThis(tr("Hand Tool (H)"));
//    penButton->setWhatsThis(tr("Pen Tool (P)"));
//    eraserButton->setWhatsThis(tr("Eraser Tool (E)"));
//    polylineButton->setWhatsThis(tr("Polyline Tool (Y)"));
//    bucketButton->setWhatsThis(tr("Paint Bucket Tool(K)"));
//    colouringButton->setWhatsThis(tr("Brush Tool(B)"));
//    eyedropperButton->setWhatsThis(tr("Eyedropper Tool (I)"));
//    clearButton->setWhatsThis(tr("Clear Tool"));
//    smudgeButton->setWhatsThis(tr("Smudge Tool (A)"));

//    pencilButton->setCheckable(true);
//    penButton->setCheckable(true);
//    polylineButton->setCheckable(true);
//    bucketButton->setCheckable(true);
//    colouringButton->setCheckable(true);
//    smudgeButton->setCheckable(true);
//    eyedropperButton->setCheckable(true);
//    selectButton->setCheckable(true);
//    moveButton->setCheckable(true);
//    handButton->setCheckable(true);
//    eraserButton->setCheckable(true);
//    pencilButton->setChecked(true);

    layout->setMargin(10);
    layout->setSpacing(10);

    layout->addWidget(openButton,0,0);
    //layout->setAlignment(moveButton, Qt::AlignRight);
    layout->addWidget(saveButton,0,1);
    //layout->setAlignment(clearButton, Qt::AlignLeft);

    layout->addWidget(loadButton,0,2);
    //layout->setAlignment(selectButton, Qt::AlignRight);
    layout->addWidget(cutButton,0,3);
    //layout->setAlignment(colouringButton, Qt::AlignLeft);

    layout->addWidget(copyButton,0,4);
    //layout->setAlignment(polylineButton, Qt::AlignRight);
    layout->addWidget(pasteButton,0,5);
    //layout->setAlignment(smudgeButton, Qt::AlignLeft);

    layout->addWidget(undoButton,0,6);
    //layout->setAlignment(penButton, Qt::AlignRight);
    layout->addWidget(recycleButton,0,7);
    //layout->setAlignment(handButton, Qt::AlignLeft);

    layout->addWidget(onionupButton,0,8);
    //layout->setAlignment(pencilButton, Qt::AlignRight);
    layout->addWidget(oniondownButton,0,9);
    //layout->setAlignment(bucketButton, Qt::AlignLeft);


    toolGroup->setLayout(layout);
    toolGroup->setMaximumHeight(70);

    this->setMaximumHeight(70);


}
Example #17
0
void MainWindow::InitializeUi() {
    ui->setupUi(this);
    status_bar_label_ = new QLabel("Ready");
    statusBar()->addWidget(status_bar_label_);
    ui->itemLayout->setAlignment(Qt::AlignTop);
    ui->itemLayout->setAlignment(ui->minimapLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->typeLineLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->nameLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->imageLabel, Qt::AlignHCenter);
    ui->itemLayout->setAlignment(ui->locationLabel, Qt::AlignHCenter);

    tab_bar_ = new QTabBar;
    tab_bar_->installEventFilter(this);
    tab_bar_->setExpanding(false);
    ui->mainLayout->insertWidget(0, tab_bar_);
    tab_bar_->addTab("+");
    connect(tab_bar_, SIGNAL(currentChanged(int)), this, SLOT(OnTabChange(int)));

    Util::PopulateBuyoutTypeComboBox(ui->buyoutTypeComboBox);
    Util::PopulateBuyoutCurrencyComboBox(ui->buyoutCurrencyComboBox);

    connect(ui->buyoutCurrencyComboBox, SIGNAL(activated(int)), this, SLOT(OnBuyoutChange()));
    connect(ui->buyoutTypeComboBox, SIGNAL(activated(int)), this, SLOT(OnBuyoutChange()));
    connect(ui->buyoutValueLineEdit, SIGNAL(textEdited(QString)), this, SLOT(OnBuyoutChange()));

    ui->actionAutomatically_refresh_items->setChecked(app_->items_manager().auto_update());
    UpdateShopMenu();

    search_form_layout_ = new QVBoxLayout;
    search_form_layout_->setAlignment(Qt::AlignTop);
    search_form_layout_->setContentsMargins(0, 0, 0, 0);

    auto search_form_container = new QWidget;
    search_form_container->setLayout(search_form_layout_);

    auto scroll_area = new VerticalScrollArea;
    scroll_area->setFrameShape(QFrame::NoFrame);
    scroll_area->setWidgetResizable(true);
    scroll_area->setWidget(search_form_container);
    scroll_area->setMinimumWidth(150); // TODO(xyz): remove magic numbers
    scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    ui->horizontalLayout_2->insertWidget(0, scroll_area);
    search_form_container->show();

    ui->horizontalLayout_2->setStretchFactor(scroll_area, 1);
    ui->horizontalLayout_2->setStretchFactor(ui->itemListAndSearchFormLayout, 4);
    ui->horizontalLayout_2->setStretchFactor(ui->itemLayout, 1);

    ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);
    context_menu_.addAction("Expand All", this, SLOT(OnExpandAll()));
    context_menu_.addAction("Collapse All", this, SLOT(OnCollapseAll()));

    connect(ui->treeView, &QTreeView::customContextMenuRequested, [&](const QPoint &pos) {
        context_menu_.popup(ui->treeView->viewport()->mapToGlobal(pos));
    });

    statusBar()->addPermanentWidget(&online_label_);
    UpdateOnlineGui();

    update_button_.setStyleSheet("color: blue; font-weight: bold;");
    update_button_.setFlat(true);
    update_button_.hide();
    statusBar()->addPermanentWidget(&update_button_);
    connect(&update_button_, &QPushButton::clicked, [=](){
        UpdateChecker::AskUserToUpdate(this);
    });
}
Example #18
0
OSItemList::OSItemList(OSVectorController* vectorController,
                       bool addScrollArea,
                       QWidget * parent)
  : OSItemSelector(parent),
    m_vectorController(vectorController),
    m_vLayout(nullptr),
    m_selectedItem(nullptr),
    m_itemsDraggable(false),
    m_itemsRemoveable(false),
    m_type(OSItemType::ListItem),
    m_dirty(false)
{
  // for now we will allow this item list to manage memory of 
  OS_ASSERT(!m_vectorController->parent());
  m_vectorController->setParent(this);

  this->setObjectName("GrayWidget"); 

  QString style;

  style.append("QWidget#GrayWidget {");
  style.append(" background: #E6E6E6;");
  style.append(" border-bottom: 1px solid black;");
  style.append("}");

  setStyleSheet(style);

  auto outerVLayout = new QVBoxLayout();
  outerVLayout->setContentsMargins(0,0,0,0);
  this->setLayout(outerVLayout);

  auto outerWidget = new QWidget();

  if (addScrollArea){
    auto scrollArea = new QScrollArea();
    scrollArea->setFrameStyle(QFrame::NoFrame);
    scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    outerVLayout->addWidget(scrollArea);
    scrollArea->setWidget(outerWidget);
    scrollArea->setWidgetResizable(true);
  }else{
    outerVLayout->addWidget(outerWidget);
  }

  m_vLayout = new QVBoxLayout();
  outerWidget->setLayout(m_vLayout);
  m_vLayout->setContentsMargins(0,0,0,0);
  m_vLayout->setSpacing(0);
  m_vLayout->addStretch();

  connect(this, &OSItemList::itemsRequested, vectorController, &OSVectorController::reportItems);

  /* Vector controller does not handle removing items in list from model
  *
  connect(this, &OSItemList::itemRemoveClicked, vectorController, &OSVectorController::removeItem);
  */

  connect(vectorController, &OSVectorController::itemIds, this, &OSItemList::setItemIds);

  connect(vectorController, &OSVectorController::selectedItemId, this, &OSItemList::selectItemId);

  // allow time for OSDocument to finish constructing
  QTimer::singleShot(0, vectorController, SLOT(reportItems()));
}
Qt5FactorySettings::Qt5FactorySettings(std::string name) : Qt5Container(), m_group(new QGroupBox(QString::fromStdString(name + " settings"))) {
	setWidget(m_group);
}
Example #20
0
void UXTEditor::open( QString filename )
{
	std::vector< STRING_MANAGER::TStringInfo > &infos = d_ptr->infos;
	QString lang = getLang( filename );
	
	infos.clear();
	STRING_MANAGER::loadStringFile( filename.toUtf8().constData(), infos, false );

	if( d_ptr->infos.size() == 0 )
	{
		// The work file cannot be found, cannot proceed
		if( filename.endsWith( "wk.uxt" ) )
		{
			QMessageBox::critical( this,
									tr( "Error opening file.." ),
									tr( "There was an error opening wk.uxt" ) );
			return;
		}

		int l = filename.lastIndexOf( "/" );
		if( l == -1 )
			return;

		QString fn = filename.left( l );		
		fn += "/wk.uxt";
		
		// The work file cannot be found, cannot proceed
		STRING_MANAGER::loadStringFile( fn.toUtf8().constData(), infos, true );
		if( d_ptr->infos.size() == 0 )
		{
			QMessageBox::critical( this,
									tr( "Error opening Uxt file" ),
									tr( "Neither the specified file nor wk.uxt could be opened." ) );
			return;
		}

		d_ptr->loadedFromWK = true;
	}

	blockTableSignals( true );

	d_ptr->t->clear();
	d_ptr->t->setColumnCount( 2 );
	d_ptr->t->setRowCount( infos.size() );

	setHeaderText( "Id", lang.toUpper() + " Text" );

	int i = 0;

	std::vector< STRING_MANAGER::TStringInfo >::const_iterator itr = infos.begin();
	while( itr != infos.end() )
	{
		const STRING_MANAGER::TStringInfo &info = *itr;

		QTableWidgetItem *name = new QTableWidgetItem( info.Identifier.c_str() );
		QTableWidgetItem *text1 = new QTableWidgetItem( info.Text.toUtf8().c_str() );
		
		d_ptr->t->setItem( i, 0, name );
		d_ptr->t->setItem( i, 1, text1 );

		if( ( info.HashValue != 0 ) && !d_ptr->loadedFromWK )
		{
			markItemTranslated( name );
			markItemTranslated( text1 );
		}
		else
		{
			markItemUntranslated( name );
			markItemUntranslated( text1 );
		}
		
		++itr;
		i++;
	}

	d_ptr->t->resizeColumnsToContents();

	blockTableSignals( false );

	setWidget( d_ptr->t );

	current_file = filename;
	setWindowTitle( filename + "[*]" );
	setWindowFilePath( filename );
}
Example #21
0
Palette::Palette(Editor* editor) : QDockWidget(editor, Qt::Tool)
{
	this->editor = editor;
	
	QWidget* paletteContent = new QWidget();
	//paletteContent->setWindowFlags(Qt::FramelessWindowHint);
	
	sliderRed = new QSlider(Qt::Horizontal);
	sliderGreen = new QSlider(Qt::Horizontal);
	sliderBlue = new QSlider(Qt::Horizontal);
	sliderAlpha = new QSlider(Qt::Horizontal);
	sliderRed->setRange(0,255);
	sliderGreen->setRange(0,255);
	sliderBlue->setRange(0,255);
	sliderAlpha->setRange(0,255);
	QLabel* labelRed = new QLabel(tr("Red"));
	QLabel* labelGreen = new QLabel(tr("Green"));
	QLabel* labelBlue = new QLabel(tr("Blue"));
	QLabel* labelAlpha = new QLabel(tr("Alpha"));
	labelRed->setFont( QFont("Helvetica", 10) );
	labelGreen->setFont( QFont("Helvetica", 10) );
	labelBlue->setFont( QFont("Helvetica", 10) );
	labelAlpha->setFont( QFont("Helvetica", 10) );
	
	QGridLayout* sliderLayout = new QGridLayout();
	sliderLayout->setSpacing(3);
	sliderLayout->addWidget(labelRed, 0, 0);
	sliderLayout->addWidget(sliderRed, 0, 1);
	sliderLayout->addWidget(labelGreen, 1, 0);
	sliderLayout->addWidget(sliderGreen, 1, 1);
	sliderLayout->addWidget(labelBlue, 2, 0);
	sliderLayout->addWidget(sliderBlue, 2, 1);
	sliderLayout->addWidget(labelAlpha, 3, 0);
	sliderLayout->addWidget(sliderAlpha, 3, 1);
	sliderLayout->setMargin(10);
	sliderLayout->setSpacing(2);
	
	//QWidget* sliders = new QWidget();
	//sliders->setLayout(sliderLayout);
	//sliders->setFixedHeight(60);
	
	listOfColours = new QListWidget();
	
	QToolBar *buttons = new QToolBar();
	addButton = new QToolButton();
	removeButton = new QToolButton();
	addButton->setIcon(QIcon(":icons/add.png"));
	addButton->setToolTip("Add Colour");
	addButton->setFixedSize(30,30);
	removeButton->setIcon(QIcon(":icons/remove.png"));
	removeButton->setToolTip("Remove Colour");
	removeButton->setFixedSize(30,30);
	
	QLabel* spacer = new QLabel();
	spacer->setFixedWidth(10);
	
	colourSwatch = new QToolButton(); //QLabel();
	colourSwatch->setFixedSize( 40, 40 );
	QPixmap colourPixmap(30,30);
	colourPixmap.fill( Qt::black );
	colourSwatch->setIcon(QIcon(colourPixmap)); //colourSwatch->setPixmap(colourPixmap);
	/*QFrame* colourSwatchFrame = new QFrame();
	colourSwatchFrame->setFixedSize( 50, 50 );
	//colourSwatchFrame->setFrameStyle(QFrame::Panel | QFrame::Sunken);
	QVBoxLayout *colourSwatchLayout = new QVBoxLayout();
	colourSwatchLayout->addWidget(colourSwatch);
	colourSwatchFrame->setLayout(colourSwatchLayout);*/
	
	//QGridLayout *buttonLayout = new QGridLayout();
	buttons->addWidget(spacer);
	buttons->addWidget(colourSwatch);
	buttons->addWidget(addButton);
	buttons->addWidget(removeButton);
	//buttons->setFixedSize(100,34);
	//buttons->layout()->setMargin(0);
	//buttons->layout()->setSpacing(0);
	//buttonLayout->setMargin(0);
	//buttonLayout->setSpacing(0);
	//buttons->setLayout(buttonLayout);
	
	listOfColours->setFrameStyle(QFrame::Panel | QFrame::Sunken);
	listOfColours->setLineWidth(1);
	listOfColours->setFocusPolicy(Qt::NoFocus);
	//listOfColours->setMinimumWidth(100);
	
	QVBoxLayout *layout = new QVBoxLayout();
	layout->addLayout(sliderLayout);
	layout->addWidget(buttons);
	layout->addWidget(listOfColours);
	layout->setMargin(0);
	
	paletteContent->setLayout(layout);
	setWidget(paletteContent);
	
	#ifndef Q_WS_MAC
		setStyleSheet ("QToolBar { border: 0px none black; }");
	#endif

	//setFrameStyle(QFrame::Panel);
	//setWindowFlags(Qt::Tool);
	setWindowFlags(Qt::WindowStaysOnTopHint);
	//setWindowFlags(Qt::SubWindow);
	setFloating(true);
	//setAllowedAreas(Qt::NoDockWidgetArea);
	//setMinimumSize(100, 300);
	paletteContent->setFixedWidth(150);  /// otherwise the palette is naturally too wide. Someone please fix this.
	//setFloating(false);
	//setFixedWidth(130);
	
	//setGeometry(10,60,100, 300);
	//setFocusPolicy(Qt::NoFocus);
	//setWindowOpacity(0.7);
	setWindowTitle(tr("Colours"));
	
	connect(sliderRed, SIGNAL(sliderMoved(int)), this, SLOT(updateColour()));
	connect(sliderGreen, SIGNAL(sliderMoved(int)), this, SLOT(updateColour()));
	connect(sliderBlue, SIGNAL(sliderMoved(int)), this, SLOT(updateColour()));
	connect(sliderAlpha, SIGNAL(sliderMoved(int)), this, SLOT(updateColour()));
	
	connect(sliderRed, SIGNAL(sliderReleased()), this, SLOT(changeColour()));
	connect(sliderGreen, SIGNAL(sliderReleased()), this, SLOT(changeColour()));
	connect(sliderBlue, SIGNAL(sliderReleased()), this, SLOT(changeColour()));
	connect(sliderAlpha, SIGNAL(sliderReleased()), this, SLOT(changeColour()));

	connect(listOfColours, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(selectColour(QListWidgetItem *, QListWidgetItem *)));
	connect(listOfColours, SIGNAL(itemClicked ( QListWidgetItem *)), this, SLOT(selectAndApplyColour( QListWidgetItem *)));
	//connect(listOfColours, SIGNAL(itemDoubleClicked ( QListWidgetItem *)), this, SLOT(changeColour( QListWidgetItem *)));
	connect(listOfColours, SIGNAL(itemDoubleClicked ( QListWidgetItem *)), this, SLOT(changeColourName( QListWidgetItem *)));
	
	connect(addButton, SIGNAL(clicked()), this, SLOT(addClick()));
	connect(removeButton, SIGNAL(clicked()), this, SLOT(rmClick()));
	
	connect(colourSwatch, SIGNAL(clicked()), this, SLOT(colourSwatchClicked()));
	
	connect(this, SIGNAL(topLevelChanged(bool)), this, SLOT(closeIfDocked(bool)));
}
Example #22
0
KgAdvanced::KgAdvanced(bool first, QWidget* parent) :
        KonfiguratorPage(first, parent)
{
    QWidget *innerWidget = new QFrame(this);
    setWidget(innerWidget);
    setWidgetResizable(true);
    QGridLayout *kgAdvancedLayout = new QGridLayout(innerWidget);
    kgAdvancedLayout->setSpacing(6);

    //  -------------------------- GENERAL GROUPBOX ----------------------------------

    QGroupBox *generalGrp = createFrame(i18n("General"), innerWidget);
    QGridLayout *generalGrid = createGridLayout(generalGrp);

    KONFIGURATOR_CHECKBOX_PARAM generalSettings[] =
        //   cfg_class  cfg_name             default              text                                                        restart tooltip
    {
//     {"Advanced", "PreserveAttributes", _PreserveAttributes, i18n("Preserve attributes for local copy/move (slower)"), false,  i18n("Krusader will try to preserve all attributes (time, owner, group) of the local files according to the source depending on your permissions:<ul><li>User preserving if you are root</li><li>Group preserving if you are root or member of the group</li><li>Preserving the timestamp</li></ul><b>Note</b>: This can slow down the copy process.") },
        {"Advanced", "AutoMount",          _AutoMount,          i18n("Automount filesystems"),                            false,  i18n("When stepping into a directory which is defined as a mount point in the <b>fstab</b>, try mounting it with the defined parameters.")}
    };

    KonfiguratorCheckBoxGroup *generals = createCheckBoxGroup(1, 0, generalSettings, 1, generalGrp);

    generalGrid->addWidget(generals, 1, 0);

    addLabel(generalGrid, 2, 0, i18n("MountMan will not (un)mount the following mount-points:"),
             generalGrp);
    KonfiguratorEditBox *nonMountPoints = createEditBox("Advanced", "Nonmount Points", _NonMountPoints, generalGrp, false);
    generalGrid->addWidget(nonMountPoints, 2, 1);


#ifdef BSD
    generals->find("AutoMount")->setEnabled(false);     /* disable AutoMount on BSD */
#endif

    kgAdvancedLayout->addWidget(generalGrp, 0 , 0);

    //  ----------------------- CONFIRMATIONS GROUPBOX -------------------------------

    QGroupBox *confirmGrp = createFrame(i18n("Confirmations"), innerWidget);
    QGridLayout *confirmGrid = createGridLayout(confirmGrp);

    addLabel(confirmGrid, 0, 0, i18n("\nRequest user confirmation for the following operations:\n"),
             confirmGrp);

    KONFIGURATOR_CHECKBOX_PARAM confirmations[] =
        //   cfg_class  cfg_name                default             text                                          restart ToolTip
    {{"Advanced", "Confirm Unempty Dir",   _ConfirmUnemptyDir, i18n("Deleting non-empty directories"),   false,  ""},
        {"Advanced", "Confirm Delete",        _ConfirmDelete,     i18n("Deleting files"),                   false,  ""},
        {"Advanced", "Confirm Copy",          _ConfirmCopy,       i18n("Copying files"),                    false,  ""},
        {"Advanced", "Confirm Move",          _ConfirmMove,       i18n("Moving files"),                     false,  ""},
        {"Advanced", "Confirm Feed to Listbox",  _ConfirmFeedToListbox, i18n("Confirm feed to listbox"), false, i18n("Ask for a result name when feeding items to the listbox. By default the standard value is used.")},
        {"Notification Messages", "Confirm Remove UserAction", true, i18n("Removing Useractions"), false,  ""}
    };

    KonfiguratorCheckBoxGroup *confWnd = createCheckBoxGroup(2, 0, confirmations, 6, confirmGrp);

    confirmGrid->addWidget(confWnd, 1, 0);

    kgAdvancedLayout->addWidget(confirmGrp, 1 , 0);


    //  ------------------------ FINE-TUNING GROUPBOX --------------------------------

    QGroupBox *fineTuneGrp = createFrame(i18n("Fine-Tuning"), innerWidget);
    QGridLayout *fineTuneGrid = createGridLayout(fineTuneGrp);
    fineTuneGrid->setAlignment(Qt::AlignLeft | Qt::AlignTop);

    QLabel *label = new QLabel(i18n("Icon cache size (KB):"), fineTuneGrp);
    label->setWhatsThis(i18n("The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory."));
    fineTuneGrid->addWidget(label, 0, 0);
    KonfiguratorSpinBox *spinBox = createSpinBox("Advanced", "Icon Cache Size", _IconCacheSize,
                                   1, 8192, fineTuneGrp, false);
    spinBox->setWhatsThis(i18n("The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory."));
    spinBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    fineTuneGrid->addWidget(spinBox, 0, 1);

    addLabel(fineTuneGrid, 1, 0, i18n("Arguments of updatedb:"),
             fineTuneGrp);
    KonfiguratorEditBox *updatedbArgs = createEditBox("Locate", "UpdateDB Arguments", "", fineTuneGrp, false);
    fineTuneGrid->addWidget(updatedbArgs, 1, 1);

    kgAdvancedLayout->addWidget(fineTuneGrp, 2 , 0);
}
Example #23
0
LutDockerDock::LutDockerDock()
        : QDockWidget(i18n("LUT Management"))
        , m_canvas(0)
        , m_displayFilter(0)
        , m_draggingSlider(false)
{
    setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);

    m_page = new QWidget(this);
    setupUi(m_page);
    setWidget(m_page);

    KisConfig cfg;
    m_chkUseOcio->setChecked(cfg.useOcio());
    connect(m_chkUseOcio, SIGNAL(toggled(bool)), SLOT(updateWidgets()));

    m_chkUseOcioEnvironment->setChecked(cfg.useOcioEnvironmentVariable());
    connect(m_chkUseOcioEnvironment, SIGNAL(toggled(bool)), SLOT(updateWidgets()));

    m_txtConfigurationPath->setText(cfg.ocioConfigurationPath());

    m_bnSelectConfigurationFile->setToolTip(i18n("Select custom configuration file."));
    connect(m_bnSelectConfigurationFile,SIGNAL(clicked()), SLOT(selectOcioConfiguration()));

    m_txtLut->setText(cfg.ocioLutPath());

    m_bnSelectLut->setToolTip(i18n("Select LUT file"));
    connect(m_bnSelectLut, SIGNAL(clicked()), SLOT(selectLut()));
    connect(m_bnClearLut, SIGNAL(clicked()), SLOT(clearLut()));

    // See http://groups.google.com/group/ocio-dev/browse_thread/thread/ec95c5f54a74af65 -- maybe need to be reinstated
    // when people ask for it.
    m_lblLut->hide();
    m_txtLut->hide();
    m_bnSelectLut->hide();
    m_bnClearLut->hide();

    connect(m_cmbDisplayDevice, SIGNAL(currentIndexChanged(int)), SLOT(refillViewCombobox()));
    connect(m_cmbDisplayDevice, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));

    m_exposureDoubleWidget->setToolTip(i18n("Select the exposure (stops) for HDR images."));
    m_exposureDoubleWidget->setRange(-10, 10);
    m_exposureDoubleWidget->setPrecision(1);
    m_exposureDoubleWidget->setValue(0.0);
    m_exposureDoubleWidget->setSingleStep(0.25);
    m_exposureDoubleWidget->setPageStep(1);

    connect(m_exposureDoubleWidget, SIGNAL(valueChanged(double)), SLOT(exposureValueChanged(double)));
    connect(m_exposureDoubleWidget, SIGNAL(sliderPressed()), SLOT(exposureSliderPressed()));
    connect(m_exposureDoubleWidget, SIGNAL(sliderReleased()), SLOT(exposureSliderReleased()));

    // Gamma needs to be exponential (gamma *= 1.1f, gamma /= 1.1f as steps)

    m_gammaDoubleWidget->setToolTip(i18n("Select the amount of gamma modification for display. This does not affect the pixels of your image."));
    m_gammaDoubleWidget->setRange(0.1, 5);
    m_gammaDoubleWidget->setPrecision(2);
    m_gammaDoubleWidget->setValue(1.0);
    m_gammaDoubleWidget->setSingleStep(0.1);
    m_gammaDoubleWidget->setPageStep(1);

    connect(m_gammaDoubleWidget, SIGNAL(valueChanged(double)), SLOT(gammaValueChanged(double)));
    connect(m_gammaDoubleWidget, SIGNAL(sliderPressed()), SLOT(gammaSliderPressed()));
    connect(m_gammaDoubleWidget, SIGNAL(sliderReleased()), SLOT(gammaSliderReleased()));


    connect(m_cmbInputColorSpace, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));
    connect(m_cmbDisplayDevice, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));
    connect(m_cmbView, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));
    connect(m_cmbComponents, SIGNAL(currentIndexChanged(int)), SLOT(updateDisplaySettings()));

    m_draggingSlider = false;

    connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotImageColorSpaceChanged()));

    m_displayFilter = new OcioDisplayFilter;

    resetOcioConfiguration();
}
	widgetdock_calc_laser_line::widgetdock_calc_laser_line():
		QDockWidget(tr("Laser line")),
		method_(tr("Calculation method")),
		method_threshold_(tr("Threshold")),
		method_sum_(tr("Sum")),
		threshold_(tr("Settings")),
		threshold_show_original_(tr("Show original")),
		threshold_show_binarize_(tr("Show binarized")),
		threshold_binarize_l_(tr("Threshold: ")),
		threshold_show_erode_(tr("Show eroded")),
		threshold_erode_l_(tr("Erode: ")),
		threshold_show_line_(tr("Show line")),
		threshold_subpixel_l_(tr("Subpixel: ")),
		sum_(tr("Settings")),
		sum_show_original_(tr("Show original")),
		sum_min_value_l_(tr("Minimal value: ")),
		sum_min_sum_l_(tr("Minimal sum: ")),
		sum_show_line_(tr("Show line")),
		sum_subpixel_l_(tr("Subpixel: "))
	{
		method_layout_.addWidget(&method_sum_);
		method_layout_.addWidget(&method_threshold_);

		method_sum_.setChecked(true);

		method_.setLayout(&method_layout_);


		threshold_binarize_.setRange(1, 255);
		threshold_erode_.setRange(0, 10);

		threshold_layout_.addWidget(&threshold_show_original_, 0, 0, 1, 2);
		threshold_layout_.addWidget(&threshold_show_binarize_, 1, 0, 1, 2);
		threshold_layout_.addWidget(&threshold_binarize_l_, 2, 0, 1, 1);
		threshold_layout_.addWidget(&threshold_binarize_, 2, 1, 1, 1);
		threshold_layout_.addWidget(&threshold_show_erode_, 3, 0, 1, 2);
		threshold_layout_.addWidget(&threshold_erode_l_, 4, 0, 1, 1);
		threshold_layout_.addWidget(&threshold_erode_, 4, 1, 1, 1);
		threshold_layout_.addWidget(&threshold_show_line_, 5, 0, 1, 2);
		threshold_layout_.addWidget(&threshold_subpixel_l_, 6, 0, 1, 1);
		threshold_layout_.addWidget(&threshold_subpixel_, 6, 1, 1, 1);

		threshold_show_line_.setChecked(true);

		threshold_binarize_.setValue(255);
		threshold_erode_.setValue(2);
		threshold_subpixel_.setChecked(true);

		threshold_binarize_l_.setAlignment(Qt::AlignRight | Qt::AlignVCenter);
		threshold_erode_l_.setAlignment(Qt::AlignRight | Qt::AlignVCenter);
		threshold_subpixel_l_.setAlignment(Qt::AlignRight | Qt::AlignVCenter);

		threshold_.setLayout(&threshold_layout_);


		sum_min_value_.setRange(0, 254);
		sum_min_sum_.setRange(0, 200000);

		sum_layout_.addWidget(&sum_show_original_, 0, 0, 1, 2);
		sum_layout_.addWidget(&sum_min_value_l_, 1, 0, 1, 1);
		sum_layout_.addWidget(&sum_min_value_, 1, 1, 1, 1);
		sum_layout_.addWidget(&sum_min_sum_l_, 2, 0, 1, 1);
		sum_layout_.addWidget(&sum_min_sum_, 2, 1, 1, 1);
		sum_layout_.addWidget(&sum_show_line_, 3, 0, 1, 2);
		sum_layout_.addWidget(&sum_subpixel_l_, 4, 0, 1, 1);
		sum_layout_.addWidget(&sum_subpixel_, 4, 1, 1, 1);

		sum_show_line_.setChecked(true);

		sum_min_value_.setValue(128);
		sum_min_sum_.setValue(500);
		sum_subpixel_.setChecked(true);

		sum_min_value_l_.setAlignment(Qt::AlignRight | Qt::AlignVCenter);
		sum_min_sum_l_.setAlignment(Qt::AlignRight | Qt::AlignVCenter);
		sum_subpixel_l_.setAlignment(Qt::AlignRight | Qt::AlignVCenter);

		sum_.setLayout(&sum_layout_);


		main_layout_.addWidget(&method_);
		main_layout_.addWidget(&threshold_);
		main_layout_.addWidget(&sum_);
		main_layout_.addStretch();

		main_widget_.setLayout(&main_layout_);
		setWidget(&main_widget_);


		threshold_.hide();


		constexpr auto released = &QRadioButton::released;

		constexpr auto check_released = &QAbstractButton::released;

		constexpr auto valueChanged =
			static_cast< void(QSpinBox::*)(int) >(&QSpinBox::valueChanged);

		auto const update_threshold_v = [this]{ update_threshold(); };
		auto const update_threshold_i = [this](int){ update_threshold(); };

		auto const update_sum_v = [this]{ update_sum(); };
		auto const update_sum_i = [this](int){ update_sum(); };


		connect(&method_threshold_, released, [this]{
			show_box(threshold_);
			update_threshold();
		});

		connect(&method_sum_, released, [this]{
			show_box(sum_);
			update_sum();
		});


		connect(&threshold_binarize_, valueChanged, update_threshold_i);
		connect(&threshold_erode_, valueChanged, update_threshold_i);

		connect(&threshold_subpixel_, check_released, update_threshold_v);

		connect(&threshold_show_original_, released, update_threshold_v);
		connect(&threshold_show_binarize_, released, update_threshold_v);
		connect(&threshold_show_erode_, released, update_threshold_v);
		connect(&threshold_show_line_, released, update_threshold_v);

		connect(&sum_min_value_, valueChanged, update_sum_i);
		connect(&sum_min_sum_, valueChanged, update_sum_i);

		connect(&sum_subpixel_, check_released, update_sum_v);

		connect(&sum_show_original_, released, update_sum_v);
		connect(&sum_show_line_, released, update_sum_v);

		update_threshold();
		update_sum();
	}
Example #25
0
MyScrollArea::MyScrollArea(QWidget *widget)
    : QAbstractScrollArea()
{
    setWidget(widget);
}
Example #26
0
TileStampsDock::TileStampsDock(TileStampManager *stampManager, QWidget *parent)
    : QDockWidget(parent)
    , mTileStampManager(stampManager)
    , mTileStampModel(stampManager->tileStampModel())
    , mProxyModel(new QSortFilterProxyModel(mTileStampModel))
    , mFilterEdit(new FilterEdit(this))
    , mNewStamp(new QAction(this))
    , mAddVariation(new QAction(this))
    , mDuplicate(new QAction(this))
    , mDelete(new QAction(this))
    , mChooseFolder(new QAction(this))
{
    setObjectName(QLatin1String("TileStampsDock"));

    mProxyModel->setSortLocaleAware(true);
    mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
    mProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
    mProxyModel->setSourceModel(mTileStampModel);
    mProxyModel->sort(0);

    mTileStampView = new TileStampView(this);
    mTileStampView->setModel(mProxyModel);
    mTileStampView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
    mTileStampView->header()->setStretchLastSection(false);
    mTileStampView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
    mTileStampView->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);

    mTileStampView->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(mTileStampView, &QWidget::customContextMenuRequested,
            this, &TileStampsDock::showContextMenu);

    mNewStamp->setIcon(QIcon(QLatin1String(":images/16x16/document-new.png")));
    mAddVariation->setIcon(QIcon(QLatin1String(":/images/16x16/add.png")));
    mDuplicate->setIcon(QIcon(QLatin1String(":/images/16x16/stock-duplicate-16.png")));
    mDelete->setIcon(QIcon(QLatin1String(":images/16x16/edit-delete.png")));
    mChooseFolder->setIcon(QIcon(QLatin1String(":images/16x16/document-open.png")));

    Utils::setThemeIcon(mNewStamp, "document-new");
    Utils::setThemeIcon(mAddVariation, "add");
    Utils::setThemeIcon(mDelete, "edit-delete");
    Utils::setThemeIcon(mChooseFolder, "document-open");

    mFilterEdit->setFilteredView(mTileStampView);

    connect(mFilterEdit, &QLineEdit::textChanged,
            mProxyModel, &QSortFilterProxyModel::setFilterFixedString);

    connect(mTileStampModel, &TileStampModel::stampRenamed,
            this, &TileStampsDock::ensureStampVisible);

    connect(mNewStamp, &QAction::triggered, this, &TileStampsDock::newStamp);
    connect(mAddVariation, &QAction::triggered, this, &TileStampsDock::addVariation);
    connect(mDuplicate, &QAction::triggered, this, &TileStampsDock::duplicate);
    connect(mDelete, &QAction::triggered, this, &TileStampsDock::delete_);
    connect(mChooseFolder, &QAction::triggered, this, &TileStampsDock::chooseFolder);

    mDuplicate->setEnabled(false);
    mDelete->setEnabled(false);
    mAddVariation->setEnabled(false);

    QWidget *widget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout(widget);
    layout->setMargin(0);

    QToolBar *buttonContainer = new QToolBar;
    buttonContainer->setFloatable(false);
    buttonContainer->setMovable(false);
    buttonContainer->setIconSize(Utils::smallIconSize());

    buttonContainer->addAction(mNewStamp);
    buttonContainer->addAction(mAddVariation);
    buttonContainer->addAction(mDuplicate);
    buttonContainer->addAction(mDelete);

    QWidget *stretch = new QWidget;
    stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
    buttonContainer->addWidget(stretch);

    buttonContainer->addAction(mChooseFolder);

    QVBoxLayout *listAndToolBar = new QVBoxLayout;
    listAndToolBar->setSpacing(0);
    listAndToolBar->addWidget(mFilterEdit);
    listAndToolBar->addWidget(mTileStampView);
    listAndToolBar->addWidget(buttonContainer);

    layout->addLayout(listAndToolBar);

    QItemSelectionModel *selectionModel = mTileStampView->selectionModel();
    connect(selectionModel, &QItemSelectionModel::currentRowChanged,
            this, &TileStampsDock::currentRowChanged);
    connect(mTileStampView, &QAbstractItemView::pressed,
            this, &TileStampsDock::indexPressed);

    setWidget(widget);
    retranslateUi();
}
BtBookshelfDockWidget::BtBookshelfDockWidget(QWidget *parent, Qt::WindowFlags f)
        : QDockWidget(parent, f)
{
    Q_ASSERT(m_instance == 0);
    m_instance = this;

    setObjectName("BookshelfDock");


    // Setup actions and menus:
    initMenus();

    // Setup tree model:
    m_treeModel = new BtBookshelfTreeModel(groupingOrderKey, this);

    // Get backend model:
    BtBookshelfModel *bookshelfModel = CSwordBackend::instance()->model();

    // Setup bookshelf widgets:
    m_bookshelfWidget = new BtBookshelfWidget(this);
    m_bookshelfWidget->setTreeModel(m_treeModel);
    m_bookshelfWidget->setSourceModel(bookshelfModel);
    m_bookshelfWidget->setItemContextMenu(m_itemContextMenu);
    m_bookshelfWidget->treeView()->setMouseTracking(true); // required for moduleHovered
    /// \bug The correct grouping action is not selected on startup.

    // Setup welcome widgets:
    m_welcomeWidget = new QWidget(this);
    QVBoxLayout *welcomeLayout = new QVBoxLayout;
    m_installLabel = new QLabel(this);
    m_installLabel->setWordWrap(true);
    m_installLabel->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
    welcomeLayout->addWidget(m_installLabel, 0, Qt::AlignHCenter | Qt::AlignBottom);
    m_installButton = new QPushButton(this);
    welcomeLayout->addWidget(m_installButton, 0, Qt::AlignHCenter | Qt::AlignTop);
    m_welcomeWidget->setLayout(welcomeLayout);

    // Setup stacked widget:
    m_stackedWidget = new QStackedWidget(this);
    m_stackedWidget->addWidget(m_bookshelfWidget);
    m_stackedWidget->addWidget(m_welcomeWidget);
    m_stackedWidget->setCurrentWidget(bookshelfModel->moduleList().empty()
                                      ? m_welcomeWidget
                                      : m_bookshelfWidget);
    setWidget(m_stackedWidget);

    // Connect signals:
    connect(m_bookshelfWidget->treeView(), SIGNAL(moduleActivated(CSwordModuleInfo*)),
            this,                          SLOT(slotModuleActivated(CSwordModuleInfo*)));
    connect(m_bookshelfWidget->treeView(), SIGNAL(moduleHovered(CSwordModuleInfo*)),
            this,                          SIGNAL(moduleHovered(CSwordModuleInfo*)));
    connect(m_treeModel, SIGNAL(moduleChecked(CSwordModuleInfo*, bool)),
            this,        SLOT(slotModuleChecked(CSwordModuleInfo*, bool)));
    connect(m_treeModel, SIGNAL(groupingOrderChanged(BtBookshelfTreeModel::Grouping)),
            this,        SLOT(slotGroupingOrderChanged(const BtBookshelfTreeModel::Grouping&)));
    connect(m_bookshelfWidget->showHideAction(), SIGNAL(toggled(bool)),
            m_treeModel,                         SLOT(setCheckable(bool)));
    connect(bookshelfModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
            this,           SLOT(slotModulesChanged()));
    connect(bookshelfModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
            this,           SLOT(slotModulesChanged()));
    connect(m_installButton,       SIGNAL(clicked()),
            BibleTime::instance(), SLOT(slotSwordSetupDialog()));

    retranslateUi();
}
Example #28
0
KonferencePart::KonferencePart( QWidget *parentWidget, const char *widgetName,
                                QObject *parent, const char *name )
		: KParts::ReadOnlyPart(parent, name)
{
	m_parent = parentWidget;

	//"i dont want to be marked unuseb by the compiler", says widgetName...
	if(widgetName){/* if true, do nothing :) */}

	// we need an instance
	setInstance( KonferencePartFactory::instance() );

	// widget that displays video
	m_widget = new KonferenceVideoWidget( parentWidget, "m_widget" );

	sipStack = new SipContainer();
	//tell it that we want to receive the events
	sipStack->UiOpened(this);

	int resolutionShift = KonferenceSettings::videoSize();
	//we shift the 4cif resolution by the index of our combobox
	//since they are ordered and always multiplied by 2 we can do this quite easily
	//except for sqcif(128x96)
	int w = 704 >> resolutionShift;
	int h = 576 >> resolutionShift;

	if (resolutionShift == 3)
	{
		w = 128;
		h = 96;
	}
	kdDebug() << "Res: " << w << "x" << h << endl;

	if(KonferenceSettings::videoPlugin() == KonferenceSettings::EnumVideoPlugin::V4L)
	{
		m_webcam = new WebcamV4L();
		if(!m_webcam->camOpen(KonferenceSettings::videoDevice(), w, h))
		{
			KMessageBox::error(0,"error opening the webcam. falling back to an image...");
			m_webcam = new WebcamImage();
			if(!m_webcam->camOpen(KonferenceSettings::fakeDeviceImage(), w, h))
				if(!m_webcam->camOpen(::locate("data", "konference/logo.png"), w, h))
					KMessageBox::error(0,"failed to open the fake-webcam. this should not happen!!");
		}
	}
	else
	{
		m_webcam = new WebcamImage();
		if(!m_webcam->camOpen(KonferenceSettings::fakeDeviceImage(), w, h))
			if(!m_webcam->camOpen(::locate("data", "konference/logo.png"), w, h))
				KMessageBox::error(0,"failed to open the fake-webcam. this should not happen!!");
	}

	//lets see if the webcam opened at the desired size.
	if(m_webcam->width() != w || m_webcam->height() != h)
		KMessageBox::error(0,QString("webcam opened at %1x%2 instead of the requested %3x%4").arg(m_webcam->width()).arg(m_webcam->height()).arg(w).arg(h));

	//register webcam-clients and tell the webcam module to send the events to "this"
	m_localWebcamClient = m_webcam->RegisterClient(PIX_FMT_RGBA32, 20/*fps*/, this);


	// notify the part that this is our internal widget
	setWidget(m_widget);

	setupLocationComboBox();

	// create our actions
	setupActions();

	// set our XML-UI resource file
	setXMLFile("konference_part.rc");

	m_rtpVideo = 0;
	m_rtpAudio = 0;
	h263 = new H263Container();

	// Generate a self-event to get current SIP Stack state
	QApplication::postEvent(this, new SipEvent(SipEvent::SipStateChange));
}
Example #29
0
FormEditorContext::FormEditorContext(QWidget *widget)
    : IContext(widget)
{
    setWidget(widget);
    setContext(Core::Context(Constants::C_QMLFORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU));
}
Example #30
0
RgShortestPathWidget::RgShortestPathWidget( QWidget* theParent, RoadGraphPlugin *thePlugin )   : QDockWidget( theParent ), mPlugin( thePlugin )
{
  setWindowTitle( tr( "Shortest path" ) );
  setObjectName( "ShortestPathDock" );
  setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );

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

  QVBoxLayout *v = new QVBoxLayout( myWidget );
  QHBoxLayout *h = NULL;
  QLabel *l = NULL;

  l = new QLabel( tr( "Start" ), myWidget );
  v->addWidget( l );
  h = new QHBoxLayout();
  mFrontPointLineEdit = new QLineEdit( myWidget );
  mFrontPointLineEdit->setReadOnly( true );
  QToolButton *selectFrontPoint = new QToolButton( myWidget );
  selectFrontPoint->setCheckable( true );
  selectFrontPoint->setIcon( QPixmap( ":/roadgraph/coordinate_capture.png" ) );
  h->addWidget( mFrontPointLineEdit );
  h->addWidget( selectFrontPoint );
  v->addLayout( h );

  l = new QLabel( tr( "Stop" ), myWidget );
  v->addWidget( l );
  h = new QHBoxLayout();
  mBackPointLineEdit = new QLineEdit( myWidget );
  mBackPointLineEdit->setReadOnly( true );
  QToolButton *selectBackPoint = new QToolButton( myWidget );
  selectBackPoint->setCheckable( true );
  selectBackPoint->setIcon( QPixmap( ":/roadgraph/coordinate_capture.png" ) );
  h->addWidget( mBackPointLineEdit );
  h->addWidget( selectBackPoint );
  v->addLayout( h );

  h = new QHBoxLayout();
  l = new QLabel( tr( "Criterion" ), myWidget );
  mCriterionName = new QComboBox( myWidget );
  mCriterionName->insertItem( 0, tr( "Length" ) );
  mCriterionName->insertItem( 1, tr( "Time" ) );
  h->addWidget( l );
  h->addWidget( mCriterionName );
  v->addLayout( h );

  h = new QHBoxLayout();
  l = new QLabel( tr( "Length" ), myWidget );
  mPathCostLineEdit = new QLineEdit( myWidget );
  mPathCostLineEdit->setReadOnly( true );
  h->addWidget( l );
  h->addWidget( mPathCostLineEdit );
  v->addLayout( h );

  h = new QHBoxLayout();
  l = new QLabel( tr( "Time" ), myWidget );
  mPathTimeLineEdit = new QLineEdit( myWidget );
  mPathTimeLineEdit->setReadOnly( true );
  h->addWidget( l );
  h->addWidget( mPathTimeLineEdit );
  v->addLayout( h );

  h = new QHBoxLayout();
  mCalculate = new QPushButton( tr( "Calculate" ), myWidget );
  h->addWidget( mCalculate );
  QPushButton *pbExport = new QPushButton( tr( "Export" ), myWidget );
  h->addWidget( pbExport );

  connect( pbExport, SIGNAL( clicked( bool ) ), this, SLOT( exportPath() ) );

  mClear =  new QPushButton( tr( "Clear" ), myWidget );
  h->addWidget( mClear );
  v->addLayout( h );

  h = new QHBoxLayout();
  QPushButton *helpButton = new QPushButton( tr( "Help" ), this );
  helpButton->setIcon( style()->standardIcon( QStyle::SP_DialogHelpButton ) );
  h->addWidget( helpButton );
  v->addLayout( h );

  v->addStretch();

  mFrontPointMapTool = new QgsMapToolEmitPoint( mPlugin->iface()->mapCanvas() );
  mFrontPointMapTool->setButton( selectFrontPoint );

  mBackPointMapTool  = new QgsMapToolEmitPoint( mPlugin->iface()->mapCanvas() );
  mBackPointMapTool->setButton( selectBackPoint );

  connect( selectFrontPoint, SIGNAL( clicked( bool ) ), this, SLOT( onSelectFrontPoint() ) );
  connect( mFrontPointMapTool, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ),
           this, SLOT( setFrontPoint( const QgsPoint& ) ) );

  connect( selectBackPoint, SIGNAL( clicked( bool ) ), this, SLOT( onSelectBackPoint() ) );
  connect( mBackPointMapTool, SIGNAL( canvasClicked( const QgsPoint&, Qt::MouseButton ) ),
           this, SLOT( setBackPoint( const QgsPoint& ) ) );

  connect( helpButton, SIGNAL( clicked( bool ) ), this, SLOT( helpRequested() ) );
  connect( mCalculate, SIGNAL( clicked( bool ) ), this, SLOT( findingPath() ) );
  connect( mClear, SIGNAL( clicked( bool ) ), this, SLOT( clear() ) );

  mrbFrontPoint = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Polygon );
  mrbFrontPoint->setColor( QColor( 0, 255, 0, 65 ) );
  mrbFrontPoint->setWidth( 2 );

  mrbBackPoint = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Polygon );
  mrbBackPoint->setColor( QColor( 255, 0, 0, 65 ) );
  mrbBackPoint->setWidth( 2 );

  mrbPath = new QgsRubberBand( mPlugin->iface()->mapCanvas(), QGis::Line );
  mrbPath->setWidth( 2 );

  connect( mPlugin->iface()->mapCanvas(), SIGNAL( extentsChanged() ), this, SLOT( mapCanvasExtentsChanged() ) );

} //RgShortestPathWidget::RgShortestPathWidget()