Example #1
0
DataLoader::DataLoader(DataManager::ptr dataManager, QWidget *parent) :
    QWidget(parent),
    dataManager(dataManager),
    dataFinder(new OfflineDataFinder())
{
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setAlignment(Qt::AlignTop);

    QComboBox* dataTypeSelector = this->setupDataSelectorBox();
    layout->addWidget(dataTypeSelector);
    layout->addWidget(dataFinder);

    connect(dataFinder, SIGNAL(signalNewDataSource(DataSource::ptr)),
            this, SLOT(newDataSource(DataSource::ptr)));

    this->setLayout(layout);
}
Example #2
0
WebViewWindow::WebViewWindow(QWidget *parent) :
    QMainWindow(parent)
{
    QAction* reloadAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_BrowserReload), tr("Reload"), this);
    reloadAction->setShortcut(QKeySequence(QKeySequence::Refresh));

    QToolBar* toolBar = new QToolBar(tr("ToolBar"), this);
    mAddressBar = new QLineEdit(toolBar);
    mAddressBar->setReadOnly(true);
    toolBar->addWidget(mAddressBar);
    toolBar->addAction(reloadAction);
    toolBar->setMovable(false);
    toolBar->hide();
    toolBar->installEventFilter(this);
    mToolBar = toolBar;
    addToolBar(toolBar);

    QMenuBar* menuBar = this->menuBar();
    QMenu* fileMenu = menuBar->addMenu(tr("&File"));
    fileMenu->addAction(reloadAction);
    QAction* quitAction = fileMenu->addAction(QIcon(":/media/application_exit.png"), tr("Quit"));
    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
    QMenu* viewMenu = menuBar->addMenu(tr("&View"));
    viewMenu->addAction(toolBar->toggleViewAction());
    QMenu* debugMenu = menuBar->addMenu(tr("&Debug"));
    QAction* inspectAction = debugMenu->addAction(tr("Inspect"));
    connect(inspectAction, SIGNAL(triggered()), this, SLOT(showWebInspector()));

    mWebView = new QWebView(this);
    mWebInspector = 0;
    QWebSettings* webSettings = mWebView->settings();
    webSettings->setAttribute(QWebSettings::LocalStorageEnabled, true);
    webSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

    QWidget* centralWidget = new QWidget(this);
    QVBoxLayout* layout = new QVBoxLayout(centralWidget);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(mWebView);
    layout->setAlignment(mWebView, Qt::AlignCenter);
    setCentralWidget(centralWidget);
    setWindowModality(Qt::WindowModal);

    connect(reloadAction, SIGNAL(triggered()), mWebView, SLOT(reload()));

    loadWebInspector();
}
Example #3
0
UrlDialog::UrlDialog(QWidget* parent) : QDialog(parent)
{
	setModal(true);
	buttons = new QDialogButtonBox;
	buttons->setOrientation(Qt::Horizontal);
	ok = buttons->addButton(QString(tr("Ok")), QDialogButtonBox::ActionRole);
	cancel = buttons->addButton(QString(tr("Cancel")), QDialogButtonBox::ActionRole);
	connect(buttons, SIGNAL(clicked(QAbstractButton*)), this, SLOT(editComplete(QAbstractButton*)));
	urlPath = new QLineEdit();
	QVBoxLayout* layout = new QVBoxLayout(this);
	layout->addWidget(urlPath);
	layout->addWidget(buttons);
	layout->setAlignment (Qt::AlignCenter);
	this->setLayout(layout);
	QDesktopWidget *d = QApplication::desktop();
	this->setFixedWidth (2*d->width()/3);
	this->setFocusProxy(urlPath);
}
/**
 * @brief setChildWidget 设置控件是否居中显示
 * @param childWidget
 * @param isCenter
 */
void WMouseInOutWidget::setChildWidget(QWidget* childWidget,bool isCenter)
{
    m_childWidget = childWidget;
    QVBoxLayout* lay = new QVBoxLayout(this);
    if(!isCenter)
        lay->addWidget(m_childWidget);
    else
    {
        QHBoxLayout* hlay = new QHBoxLayout(this);
        hlay->addWidget(m_childWidget);
        hlay->setAlignment(hlay,Qt::AlignHCenter);
        lay->addLayout(hlay);
        lay->setAlignment(lay,Qt::AlignVCenter);
    }
    lay->setContentsMargins(0,0,0,0);
    setLayout(lay);
    m_childWidget->setVisible(false);
}
Example #5
0
void TerrainManager::initTerrainList()
{
	// TODO // I suppose this should be contained in a file

	QSignalMapper *mapper = new QSignalMapper(this);
	QVBoxLayout *layout = new QVBoxLayout;
	layout->setAlignment(Qt::AlignTop);
	for (BTech::Terrain terrain : BTech::terrainTypes) {
		QString terrainName = BTech::terrainStringChange[terrain];
		ClickableLabel *label = new ClickableLabel(terrainName);
		connect(label, &ClickableLabel::clicked, mapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
		mapper->setMapping(label, terrainName);
		layout->addSpacerItem(new QSpacerItem(BTech::LITTLE_SPACER_SIZE, BTech::SMALL_SPACER_SIZE));
		layout->addWidget(label);
	}
	setLayout(layout);
	connect(mapper, static_cast<void (QSignalMapper::*)(const QString &)>(&QSignalMapper::mapped), this, &TerrainManager::onTerrainChosen);
}
Example #6
0
QFrame *CentralWidget::createBottomRightPanel()
{
    hornSignalButton = new AnimatedButton(HORN_IMAGE_NORMAL,
        HORN_IMAGE_HOVERED, HORN_IMAGE_PRESSED);
    connect(hornSignalButton, SIGNAL(pressed()), this,
        SLOT(slotHornSignalStart()));
    connect(hornSignalButton, SIGNAL(released()), this,
        SLOT(slotHornSignalStop()));

    QVBoxLayout *bottomRightPanelLayout = new QVBoxLayout;
    bottomRightPanelLayout->setAlignment(Qt::AlignTop | Qt::AlignRight);
    bottomRightPanelLayout->addWidget(hornSignalButton);

    QFrame *bottomRightPanel = new QFrame;
    bottomRightPanel->setLayout(bottomRightPanelLayout);

    return bottomRightPanel;
}
Example #7
0
YuvWidget::YuvWidget(QWidget *parent)
    : QWidget(parent)
{
    imageLabel = new QLabel(this);
    imageLabel->setBackgroundRole(QPalette::Base);
    imageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);  // todo
    //imageLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    //imageLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    imageLabel->setScaledContents(true);
    imageLabel->setAlignment(Qt::AlignCenter);
    imageLabel->setText("YUV output");
    imageLabel->setStyleSheet("QLabel { background-color : transparent; color : grey; font: italic;}");

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    layout->addWidget(imageLabel);
    setLayout(layout);
}
Example #8
0
ProbeWidget::ProbeWidget(VolumeViewer *volumeViewer) : volumeViewer(volumeViewer), isEnabled(false)
{
  if (!volumeViewer)
    throw std::runtime_error("ProbeWidget: NULL volumeViewer");

  osprayWindow = volumeViewer->getWindow();
  boundingBox = volumeViewer->getBoundingBox();

  if (!osprayWindow)
    throw std::runtime_error("ProbeWidget: NULL osprayWindow");

  // Setup UI elments.
  QVBoxLayout *layout = new QVBoxLayout();
  layout->setAlignment(Qt::AlignTop);
  setLayout(layout);

  QCheckBox *enabledCheckBox = new QCheckBox("Enable probe");
  layout->addWidget(enabledCheckBox);
  connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(setEnabled(bool)));

  QGroupBox *coordinatesGroupBox = new QGroupBox("Coordinates");
  QVBoxLayout *coordinatesLayout = new QVBoxLayout();
  coordinatesGroupBox->setLayout(coordinatesLayout);
  connect(this, SIGNAL(enabled(bool)), coordinatesGroupBox, SLOT(setEnabled(bool)));

  probeCoordinateWidgets.push_back(new ProbeCoordinateWidget("x", ospcommon::vec2f(boundingBox.lower.x, boundingBox.upper.x)));
  probeCoordinateWidgets.push_back(new ProbeCoordinateWidget("y", ospcommon::vec2f(boundingBox.lower.y, boundingBox.upper.y)));
  probeCoordinateWidgets.push_back(new ProbeCoordinateWidget("z", ospcommon::vec2f(boundingBox.lower.z, boundingBox.upper.z)));

  for (int i=0; i<3; i++) {
    coordinatesLayout->addWidget(probeCoordinateWidgets[i]);
    connect(probeCoordinateWidgets[i], SIGNAL(probeCoordinateChanged()), this, SIGNAL(probeChanged()));
  }

  layout->addWidget(coordinatesGroupBox);

  layout->addWidget(&sampleValueLabel);
  connect(this, SIGNAL(enabled(bool)), &sampleValueLabel, SLOT(setEnabled(bool)));

  connect(this, SIGNAL(probeChanged()), this, SLOT(updateProbe()), Qt::UniqueConnection);

  // Probe disabled by default
  emit enabled(false);
}
Example #9
0
void HelpWidget::placeWidgets()
{
    QLabel *iconLabel = new QLabel(pWidget);
    iconLabel->setPixmap(QPixmap(":/ArpmanetDC/Resources/Logo.png").scaled(100,100, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));

    QLabel *gplLabel = new QLabel(pWidget);
    gplLabel->setPixmap(QPixmap(":/ArpmanetDC/Resources/GPLv3 Logo 128px.png").scaled(48,20, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
   
    QHBoxLayout *aboutLayout = new QHBoxLayout();
    aboutLayout->addWidget(iconLabel);
    
    QLabel *aboutLabel = new QLabel(tr("<b><a href=\"http://code.google.com/p/arpmanetdc/\">ArpmanetDC</a></b><br/>Version %1 Alpha<br/>Copyright (C) 2012, Arpmanet Community<p>Free software licenced under <a href=\"http://www.gnu.org/licenses/\">GPLv3</a></p>").arg(VERSION_STRING), pWidget);
    aboutLabel->setOpenExternalLinks(true);

    QVBoxLayout *aboutVLayout = new QVBoxLayout();
    aboutVLayout->addStretch(1);
    aboutVLayout->addWidget(aboutLabel);
    aboutVLayout->addWidget(gplLabel);
    aboutVLayout->addStretch(1);

    QVBoxLayout *progressLayout = new QVBoxLayout;
    progressLayout->setAlignment(Qt::AlignCenter);
    progressLayout->addStretch(1);
    progressLayout->addWidget(updateLabel);
    progressLayout->addWidget(progress);
    progressLayout->addWidget(updateButton);
    //progressLayout->addStretch(1);

    aboutLayout->addLayout(aboutVLayout);
    aboutLayout->addStretch(1);
    aboutLayout->addLayout(progressLayout);

    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addLayout(aboutLayout);
    vlayout->addSpacing(20);

    browser->scrollToAnchor("ArpmanetDC");
    vlayout->addWidget(browser);

    vlayout->setStretchFactor(aboutLayout, 0);
    vlayout->setStretchFactor(browser, 1);

    pWidget->setLayout(vlayout);
}
Example #10
0
    DialogDistance::DialogDistance(interfaces::ControlCenter* c)
      : main_gui::BaseWidget(0, c->cfg, "DialogDistance"),
        pDialog(new main_gui::PropertyDialog(NULL)) {
      filled = false;
      control = c;
      selection = distance = ap1 = ap2 = rp1 = rp2 = NULL;
 
      this->setWindowTitle(tr("Object Distance Info"));
 
      pDialog->setPropCallback(this);
      pDialog->hideAllButtons();


      viewNodes = pDialog->addGenericProperty("../Nodes", QVariant::Bool, true);
      viewJoints = pDialog->addGenericProperty("../Joints", QVariant::Bool, true);
  
      objectList = new QListWidget(NULL);
      objectList->setSelectionMode(QAbstractItemView::MultiSelection);
      connect(objectList, SIGNAL(itemSelectionChanged()), this, SLOT(selectObjects()));

      control->nodes->getListNodes(&simNodes);

      for (unsigned int i =0 ; i<simNodes.size(); i++ )
        objectList->addItem("Node " + QString::number(simNodes[i].index) + 
                            ":" + QString::fromStdString(simNodes[i].name));

      control->joints->getListJoints(&simJoints);

      for (unsigned int i =0 ; i<simJoints.size(); i++ )
        objectList->addItem("Joint " + QString::number(simJoints[i].index) + 
                            ":" + QString::fromStdString(simJoints[i].name));

      QVBoxLayout *vLayout = new QVBoxLayout;
      vLayout->setAlignment(Qt::AlignTop);
      vLayout->addWidget(pDialog);

      QGridLayout *layout = new QGridLayout;
      layout->addWidget(objectList, 0, 0);
      layout->addLayout(vLayout, 0, 1);
      layout->setColumnStretch(1, 1);

      this->setLayout(layout);
      filled = true;
    }
Example #11
0
UnitsManager::UnitsManager(Map *map)
	: map(map), currentUnit(EmptyUid)
{
	initMechList();

	playersComboBox = new QComboBox;
	connect(playersComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &UnitsManager::onPlayerChosen);
	updatePlayersComboBox();

	/* layout */

	QVBoxLayout *layout = new QVBoxLayout;
	layout->setAlignment(Qt::AlignTop);

	layout->addWidget(playersComboBox);
	layout->addItem(mechListLayout);

	setLayout(layout);
}
Example #12
0
AboutWindow::AboutWindow()
{
    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setAlignment(Qt::AlignHCenter);
    setWindowTitle(tr("About 3DMEditor"));

    QTextEdit *info = new QTextEdit;
    info->setHtml(tr("ABOUT_TEXT", "text of about window"));
    info->setReadOnly(true);
    layout->addWidget(info);

    QPushButton *ok = new QPushButton(tr("ok"));
    connect(ok, SIGNAL(clicked()), this, SLOT(close()));
    ok->setMaximumWidth(80);
    QHBoxLayout *hlayout = new QHBoxLayout;
    layout->addLayout(hlayout);
    hlayout->addWidget(ok);
    hlayout->setAlignment(Qt::AlignHCenter);
}
Example #13
0
TabPreview::TabPreview(BrowserWindow* window, QWidget* parent)
    : QFrame(parent)
    , m_window(window)
    , m_previewIndex(-1)
    , m_animationsEnabled(true)
    , m_stepX(0)
    , m_stepY(0)
    , m_stepWidth(0)
    , m_stepHeight(0)
{
    m_pixmapLabel = new QLabel(this);
    m_pixmapLabel->setAlignment(Qt::AlignHCenter);

    m_title = new QLabel(this);
    m_title->setAlignment(Qt::AlignHCenter);
    m_title->setWordWrap(true);

    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->addWidget(m_pixmapLabel);
    layout->addWidget(m_title);
    layout->setMargin(0);
    layout->setAlignment(Qt::AlignCenter);
    setLayout(layout);

    setBackgroundRole(QPalette::ToolTipBase);
    setForegroundRole(QPalette::ToolTipText);

    setContentsMargins(5, 5, 5, 5);
    setMaximumWidth(250);
    setMaximumHeight(170);

#ifdef ENABLE_OPACITY_EFFECT
    setGraphicsEffect(&m_opacityEffect);
    m_opacityEffect.setOpacity(0.0);
    connect(&m_opacityTimeLine, SIGNAL(frameChanged(int)), this, SLOT(setOpacity(int)));
#endif

    m_animation.setDuration(400);
    m_animation.setFrameRange(0, 100);
    m_animation.setUpdateInterval(20); // 50 fps
    connect(&m_animation, SIGNAL(frameChanged(int)), this, SLOT(setAnimationFrame(int)));
}
ScrollBarSettingsEditor::ScrollBarSettingsEditor(QWidget *parent)
    : QWidget(parent),
      ui(new Ui::ScrollBarSettingsForm),
      m_verticalScrollbar(new QtMaterialScrollBar),
      m_horizontalScrollbar(new QtMaterialScrollBar)
{
    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);

    QWidget *widget = new QWidget;
    layout->addWidget(widget);

    QWidget *canvas = new QWidget;
    canvas->setStyleSheet("QWidget { background: white; }");
    layout->addWidget(canvas);

    ui->setupUi(widget);
    layout->setContentsMargins(20, 20, 20, 20);

    layout = new QVBoxLayout;
    canvas->setLayout(layout);
    canvas->setMaximumHeight(400);

    QTextEdit *edit = new QTextEdit;
    edit->setText("<p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p><p>The distinction between the subjects of syntax and semantics has its origin in the study of natural languages.</p>");
    edit->setLineWrapMode(QTextEdit::NoWrap);
    edit->update();
    edit->setMaximumHeight(200);

    edit->setVerticalScrollBar(m_verticalScrollbar);
    edit->setHorizontalScrollBar(m_horizontalScrollbar);

    //m_verticalScrollbar->setHideOnMouseOut(false);

    //m_horizontalScrollbar->setHideOnMouseOut(false);
    m_horizontalScrollbar->setOrientation(Qt::Horizontal);

    layout->addWidget(edit);
    layout->setAlignment(edit, Qt::AlignHCenter);

    setupForm();
}
Example #15
0
void MainWindow::createLogoWidget(){
    logoWidget = new QWidget(this);
    QLabel* logoLabel = new QLabel(logoWidget);
    logoLabel->setPixmap(QPixmap(":/images/images/HBStats_Icon_Sfondo.png").scaled(500, 500, Qt::KeepAspectRatio));

    QWidget* topFiller = new QWidget(logoWidget);
    topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    QWidget* bottomFiller = new QWidget(logoWidget);
    bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    QVBoxLayout* layout = new QVBoxLayout;
    layout->addWidget(topFiller);
    layout->addWidget(logoLabel);
    layout->addWidget(bottomFiller);

    layout->setAlignment(logoLabel, Qt::AlignHCenter);

    logoWidget->setLayout(layout);
}
Example #16
0
ActionDialog::ActionDialog(const QString &title, QWidget *parent)
	: QDialog(parent)
{
	setWindowTitle(title);

	m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
	connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
	connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

	m_mainWidget = new QWidget(this);
	m_mainLayout = new QVBoxLayout(m_mainWidget);

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->setAlignment(Qt::AlignTop);
	layout->setContentsMargins(0, 0, 0, 0);
	layout->setSpacing(5);

	layout->addWidget(m_mainWidget);
	layout->addWidget(m_buttonBox);
}
void SourceSelectionView::constructUI() {

	//Create paramLayout
	QVBoxLayout *paramLayout = new QVBoxLayout;
	paramLayout->setAlignment(Qt::AlignCenter);
	this->setLayout(paramLayout);
	
	QGroupBox* srcGroup = new QGroupBox(this);
	srcGroup->setTitle(tr("Available Signal Sources"));
	srcGroup->setAlignment(Qt::AlignCenter);
	srcGroup->setMaximumSize(300, 400);
	
	QVBoxLayout* vbox = new QVBoxLayout;
	srcGroup->setLayout(vbox);
	
	//Create source list
	sourceList = new QListWidget;
	vbox->addWidget(sourceList);
	
	
	//Create the buttons
	QPushButton* btnConnect = new QPushButton(tr("Connect"));
	QPushButton* btnRefresh = new QPushButton(tr("Refresh"));
	
	QHBoxLayout* buttonLayout = new QHBoxLayout;
	buttonLayout->addWidget(btnConnect);	
	buttonLayout->addWidget(btnRefresh);
	
	vbox->addLayout(buttonLayout);
	
	paramLayout->addWidget(srcGroup);

	
	//Make conections
	
	QObject::connect(btnConnect, SIGNAL(clicked()), this, SLOT(showConfigurationDialog()));
	QObject::connect(btnRefresh, SIGNAL(clicked()), this, SLOT(refreshSources()));

	

}
MusicRemoteWidgetForCircle::MusicRemoteWidgetForCircle(QWidget *parent)
    : MusicRemoteWidget(parent)
{
    setGeometry(200, 200, 100, 100);
    adjustPostion(this);

    QGridLayout* grid = new QGridLayout(this);
    m_mainWidget->setFixedSize(70, 70);
    grid->addWidget(m_PlayButton, 0, 1, Qt::AlignCenter);
    grid->addWidget(m_PreSongButton, 1, 0, Qt::AlignCenter);
    grid->addWidget(m_NextSongButton, 1, 2, Qt::AlignCenter);
    grid->addWidget(m_SettingButton, 2, 1, Qt::AlignCenter);
    grid->addWidget(m_mainWidget, 1, 1, Qt::AlignCenter);

    QVBoxLayout *mainWidgetLayout = new QVBoxLayout(m_mainWidget);
    mainWidgetLayout->setContentsMargins(0, 0, 0, 0);
    mainWidgetLayout->setSpacing(0);
    mainWidgetLayout->addWidget(m_showMainWindow);
    mainWidgetLayout->setAlignment(m_showMainWindow, Qt::AlignCenter);
    mainWidgetLayout->addWidget(m_volumeWidget);
}
Example #19
0
void MainWindow::SetupWidgets ()
{
    signalMapper = new QSignalMapper( this );
    ui->gridLayout->setSpacing( 10 );
    ui->gridLayout->setHorizontalSpacing( 0 );
    ui->gridLayout->setMargin( 10 );
    QVBoxLayout * vertLayout  = NULL;
    QHBoxLayout * horLayout   = NULL;
    int col = 0;
    for( int i = 0; i < plst.GetWidth() * plst.GetHeight();  )
    {
      horLayout = new QHBoxLayout( this );
      ui->gridLayout->addLayout( horLayout, 0, col  );
      vertLayout = new QVBoxLayout();
      vertLayout->setSpacing( 1 );
			vertLayout->setAlignment( Qt::AlignVCenter );
      horLayout->addLayout( vertLayout );
			horLayout->setAlignment( Qt::AlignHCenter );
      int num = (col%2 == 0) ? plst.GetHeight()-1 : plst.GetHeight();
      if( num == plst.GetHeight()-1 )
        i++;
      for( int k = 0; k < num; k++, i++ )
      {
        int ind = (col+1)*plst.GetHeight() - (k + 1);
				CCell * item = plst.getItem( ind );
        QPushButton * button = item->button;
        vertLayout->addWidget( button );
        
				connect( button, SIGNAL(clicked()), signalMapper, SLOT( map() ) ); 
        signalMapper->setMapping( button, button );
				
				item->UpdateView();
      }
      col++;
    }
    connect(signalMapper, SIGNAL(mapped(QWidget*)),
            this, SLOT(labelClicked(QWidget*)));

		ui->Steps->setValue( plst.GetSteps() );
}
Example #20
0
/*! Create a new BackupSelectorUI component with GUI elements
 *
 * \param model the underlying backup list model (displayed in combobox)
 * \param parent the parent GUI element of this widget
 */
BackupSelectorUI::BackupSelectorUI(BackupListModel *model, QWidget *parent) : QWidget(parent)
{
    m_model = model;
    m_choice = new QComboBox();
    m_choice->setModel(model);
    m_choice->setCurrentIndex(-1);

    QLabel *description = new QLabel(
        tr("Select a recently used backup from the list below, or use the menu "
           "to open an existing backup or create a new backup.")
    );

    description->setWordWrap(true);

    m_btnConf = new QPushButton(tr("Configure"));
    m_btnConf->setIcon(QIcon::fromTheme("preferences-desktop"));
    m_btnConf->setEnabled(false);

    QHBoxLayout *choiceLayout = new QHBoxLayout;
    choiceLayout->addWidget(m_choice, 1);
    choiceLayout->addWidget(m_btnConf);

    QVBoxLayout *controlLayout = new QVBoxLayout;
    controlLayout->setAlignment(Qt::AlignCenter);
    controlLayout->addWidget(description);
    controlLayout->addWidget(new QLabel(tr("Your current backup:")));
    controlLayout->addLayout(choiceLayout);

    QLabel *labelImage = new QLabel;
    labelImage->setPixmap(QApplication::windowIcon().pixmap(96, 96));

    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->addWidget(labelImage);
    mainLayout->addSpacerItem(new QSpacerItem(20, 0));
    mainLayout->addLayout(controlLayout);
    this->setLayout(mainLayout);

    connect(m_choice, SIGNAL(currentIndexChanged(int)), this, SIGNAL(backupSelected(int)));
    connect(m_btnConf, SIGNAL(clicked()), this, SIGNAL(configure()));
}
//
// GcSplitter -- The sidebar is largely comprised of this which contains a splitter (GcSubSplitter)
//               and a control (GcSplitterControl) at the bottom with icons to show/hide items.
//               The GcSplitter contains 2 or more such items (GcSplitterItem) and each of those will
//               have a special handle (GcSplitterHandle).
//
GcSplitter::GcSplitter(Qt::Orientation orientation, QWidget *parent) : QWidget(parent)
{

    setContentsMargins(0,0,0,0);

    control = new GcSplitterControl(this);

    splitter = new GcSubSplitter(orientation, control, this);
    splitter->setHandleWidth(bigHandle);
    splitter->setFrameStyle(QFrame::NoFrame);
    splitter->setContentsMargins(0,0,0,0);
    splitter->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setSpacing(0);
    layout->setAlignment(Qt::AlignBottom|Qt::AlignHCenter);
    layout->setContentsMargins(0,0,0,0);
    layout->addWidget(splitter);
    layout->addWidget(control);

    connect(splitter,SIGNAL(splitterMoved(int,int)), this, SLOT(subSplitterMoved(int,int)));
}
CudaSupportSettingsPageWidget::CudaSupportSettingsPageWidget( const QString & _msg, CudaSupportSettingsPageController * /*ctrl*/ ) :
onlyMsg(_msg){

    if( !onlyMsg.isEmpty() ) {
        //just display the centered warning message
        QHBoxLayout* hLayout = new QHBoxLayout(this);
        QLabel * msgLabel = new QLabel( onlyMsg, this );
        msgLabel->setAlignment( Qt::AlignLeft );

        hLayout->setAlignment( Qt::AlignTop | Qt::AlignLeft);
        hLayout->addWidget(msgLabel);
        hLayout->addStretch();
        setLayout(hLayout);
    } else {
        //everything is OK - adding info about all available GPUs

        QVBoxLayout * vLayout = new QVBoxLayout(this);

        QList<CudaGpuModel *> gpus = AppContext::getCudaGpuRegistry()->getRegisteredGpus();
        const QString & actualText = gpus.empty() ? tr(noGpusDiscoveredText) : tr(gpusDiscoveredText);
        QLabel * gpusDiscoveredLabel = new QLabel( actualText, this );
        vLayout->addWidget( gpusDiscoveredLabel );

        foreach( CudaGpuModel * m, gpus ) {
            vLayout->setAlignment( Qt::AlignLeft | Qt::AlignTop );
            QHBoxLayout * hLayout = new QHBoxLayout(this);

            QString gpuText = m->getName() + " " + QString::number(m->getGlobalMemorySizeBytes() / (1024*1024)) + " Mb";
            QCheckBox * check = new QCheckBox( gpuText, this );

            check->setChecked(true);

            gpuEnableChecks.push_back(check);
            hLayout->addWidget(check);
            vLayout->addLayout( hLayout );
        }
        setLayout(vLayout);
    }
Example #23
0
ProjectWindow::ProjectWindow(QWidget* parent)
: QWidget(parent) {

    QVBoxLayout* mainLayout = new QVBoxLayout;
    mainLayout->setAlignment(Qt::AlignLeft);
    mainLayout->setSpacing(5);
    mainLayout->setMargin(0);
    mainLayout->addStretch(0);
    
    mainLayout->addLayout(setupTitleContainer(), 0);

    QFrame* hLine = new QFrame(this);
    hLine->setFrameStyle(QFrame::HLine | QFrame::Sunken);
    mainLayout->addWidget(hLine, 0);

    ImageConfigChanger* configChanger = new ImageConfigChanger(this);
    
    QStringList subdirs = ScriptModuleProperties(ApplicationData::scriptsDir().canonicalPath() + "/project").subfolders();
    ExecutionWindow* exeWindow = new ExecutionWindow(subdirs);
    
    QTabWidget* tabWidget = new QTabWidget();
    tabWidget->addTab(setupParametersWidget(), ApplicationData::icon("search"), "Search Parameters");
    tabWidget->addTab(configChanger, ApplicationData::icon("sync"), "Synchronize Image Parameters");
    tabWidget->addTab(exeWindow, ApplicationData::icon("utility"), "Utility Scripts");

    mainLayout->addWidget(tabWidget, 1);

    setLayout(mainLayout);

    connect(&projectData, &ProjectData::projectNameChanged, [ = ](const QString & name){
        setProjectTitle(name);
    });
    
    connect(&projectData, &ProjectData::imageCountChanged, [ = ](int count){
        setImagesCount(count);
    });

}
Example #24
0
void menuconfigproject::configeneral()
{
    QWidget *win = new QWidget;
    QPushButton *tablesql = new QPushButton("Table sql");
    QPushButton *newtq = new QPushButton("Sauvegarder un template de question");
    QPushButton *addtq = new QPushButton("Ajouter des question a partir d'un template");
    QPushButton *newtp = new QPushButton("Sauvegarder un template de personne");
    QPushButton *addtp = new QPushButton("Ajouter des personne a partir d'un template");
    QCheckBox *afficheindex = new QCheckBox("Afficher l'index");
    afficheindex->setChecked(p->indexbool);


    //Connexions aux slots
    connect(tablesql, SIGNAL(clicked(bool)), this, SLOT(showsql()));
    connect(newtq, SIGNAL(clicked(bool)), this, SLOT(newtemplateq()));
    connect(addtq, SIGNAL(clicked(bool)), this, SLOT(addtemplateq()));
    connect(newtp, SIGNAL(clicked(bool)), this, SLOT(newtemplatep()));
    connect(addtp, SIGNAL(clicked(bool)), this, SLOT(addtemplatep()));
    connect(afficheindex, SIGNAL(clicked(bool)), this, SLOT(afficheindex(bool)));

	//Layout
	QGroupBox *groupbox = new QGroupBox("");

	QGridLayout *layoutFormulaire = new QGridLayout();

	groupbox->setLayout(layoutFormulaire);

    QVBoxLayout *layout = new QVBoxLayout();
    layout->setAlignment(Qt::AlignTop);
    layout->addWidget(tablesql);
    layout->addWidget(newtq);
    layout->addWidget(addtq);
    layout->addWidget(newtp);
    layout->addWidget(addtp);
    layout->addWidget(afficheindex);
    win->setLayout(layout);
	this->addTab(win, "general");
}
Example #25
0
FolderDialog::FolderDialog() : m_folderID(""), m_extraInformation(""), m_separator("-"), m_midasFolderName("")
{
    m_txtFolderID = new QLineEdit();

    m_txtExtraInformation = new QLineEdit();
    m_txtExtraInformation->setValidator(new QIntValidator);
    m_txtExtraInformation->setCursorPosition(0);

    m_txtMidasFolderName = new QLabel();

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->setAlignment(Qt::AlignRight);

    QFormLayout* formLayout = new QFormLayout();
    formLayout->addRow(tr("&Folder ID:"), m_txtFolderID);
    formLayout->addRow(tr("&Extra information (optional):"), m_txtExtraInformation);
    formLayout->addRow(tr("&Midas folder name:"), m_txtMidasFolderName);

    QPointer<QDialogButtonBox> buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);

    mainLayout->addLayout(formLayout);
    mainLayout->addWidget(buttonBox);

    this->setWindowTitle(QString::fromStdString("Midas folder name"));
    this->setLayout(mainLayout);

    QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    QObject::connect(m_txtFolderID, SIGNAL(textChanged(const QString&)),
            this, SLOT(onFolderIDChanged(const QString&)));
    QObject::connect(m_txtExtraInformation, SIGNAL(textChanged(const QString&)),
            this, SLOT(onExtraInformationChanged(const QString&)));

    m_folderID =  m_txtFolderID->text().toStdString();

    this->setTxtMidasFolderName();
}
Example #26
0
CSVWidget::ColorPickerPopup::ColorPickerPopup(QWidget *parent) 
    : QFrame(parent)
{
    setWindowFlags(Qt::Popup);
    setFrameStyle(QFrame::Box | QFrame::Plain);
    hide();

    mColorPicker = new QColorDialog(this);
    mColorPicker->setWindowFlags(Qt::Widget);
    mColorPicker->setOptions(QColorDialog::NoButtons | QColorDialog::DontUseNativeDialog);
    mColorPicker->installEventFilter(this);
    connect(mColorPicker,
            SIGNAL(currentColorChanged(const QColor &)),
            this,
            SIGNAL(colorChanged(const QColor &)));

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->addWidget(mColorPicker);
    layout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);
    setFixedSize(mColorPicker->size());
}
AvatarWidget::AvatarWidget(QWidget *parent)
    : QLabel(parent),

    m_hover(false),
    m_deleable(false),
    m_selected(false),

    m_delBtn(new AvatarDel)
{
    m_delBtn->setVisible(false);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);
    mainLayout->addWidget(m_delBtn);
    mainLayout->setAlignment(m_delBtn, Qt::AlignCenter);

    setLayout(mainLayout);
    setFixedSize(PIX_SIZE, PIX_SIZE);
    setObjectName("AvatarWidget");

    connect(m_delBtn, &AvatarDel::click, [=] { Q_EMIT requestDelete(m_avatarPath); });
}
Example #28
0
QFrame *CentralWidget::createBottomLeftPanel()
{
    AnimatedButton *headlightsButton =
        new AnimatedButton(HEADLIGHTS_IMAGE_NORMAL, HEADLIGHTS_IMAGE_HOVERED,
        HEADLIGHTS_IMAGE_PRESSED);
    headlightsButton->setCheckable(true);

    connect(headlightsButton, SIGNAL(toggled(bool)), this,
        SLOT(slotHeadlightsStageChange(bool)));

    QShortcut *shortcut = new QShortcut(QKeySequence("F2"), headlightsButton);
    shortcut->setAutoRepeat(false);
    connect(shortcut, SIGNAL(activated()), headlightsButton, SLOT(click()));

    QVBoxLayout *bottomLeftPanelLayout = new QVBoxLayout;
    bottomLeftPanelLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
    bottomLeftPanelLayout->addWidget(headlightsButton);

    QFrame *bottomLeftPanel = new QFrame;
    bottomLeftPanel->setLayout(bottomLeftPanelLayout);

    return bottomLeftPanel;
}
CTestSummaryWindow::CTestSummaryWindow(QWidget *parent) :
    QWidget(parent)
{   
    QVBoxLayout* topLevelLayout = new QVBoxLayout(this);

    QGroupBox* main = new QGroupBox(tr("作业总结"));
    main->setFixedSize(700,520);

    QVBoxLayout* mainLayout = new QVBoxLayout(main);
    mainLayout->setContentsMargins(40,15,40,15);
    mainLayout->setSpacing(20);

    _testSummaryTree = new QTreeWidget;
    _testSummaryTree->setColumnCount(2);
    _testSummaryTree->setHeaderLabels(QStringList() << tr("检测项目") << tr("完成情况") << tr("备注"));
    _testSummaryTree->header()->setStretchLastSection( true);
    _testSummaryTree->header()->setResizeMode( QHeaderView::ResizeToContents );
    _testSummaryTree->model()->setHeaderData(2, Qt::Horizontal, Qt::AlignHCenter, Qt::TextAlignmentRole);
    _testSummaryTree->setSelectionMode(QAbstractItemView::NoSelection);
    _testSummaryTree->setFocusPolicy(Qt::NoFocus);

    QLabel* text = new QLabel(tr("本次测试结果统计表"));
    text->setStyleSheet("font:bold 14px;color:#0099FF;max-height:26px;min-height:26px;background:#CCFF99;padding:0 15px;");

    QPushButton* button = new QPushButton(tr("保存本次记录"));
    button->setStyleSheet("font:14px;min-width:100px;min-height:26px;");

    mainLayout->addWidget(text, 0, Qt::AlignCenter);
    mainLayout->addWidget(_testSummaryTree);
    mainLayout->addWidget(button, 0, Qt::AlignCenter);

    topLevelLayout->addWidget(main, 0, Qt::AlignCenter);
    topLevelLayout->setAlignment(Qt::AlignCenter);
    //***signal
    updateTestSummary();
    connect(button, SIGNAL(clicked()), this, SLOT(finishTestJob()));
}
MusicRemoteWidgetForCircle::MusicRemoteWidgetForCircle(QWidget *parent)
    : MusicRemoteWidget(parent)
{
    setGeometry(200, 200, 100, 100);
    setAttribute(Qt::WA_TranslucentBackground);

    QSize windowSize = M_SETTING_PTR->value(MusicSettingManager::ScreenSize).toSize();
    move( windowSize.width() - width() - 150, height() + 70);

    m_PreSongButton->setStyleSheet(MusicUIObject::MPushButtonStyle04);
    m_NextSongButton->setStyleSheet(MusicUIObject::MPushButtonStyle04);
    m_PlayButton->setStyleSheet(MusicUIObject::MPushButtonStyle04);
    m_SettingButton->setStyleSheet(MusicUIObject::MPushButtonStyle04);
    m_showMainWindow->setIconSize(QSize(30, 30));
    m_mainWidget->setStyleSheet("#mainWidget{" + MusicUIObject::MCustomStyle09 + "}");

    QGridLayout* grid = new QGridLayout(this);
    m_PreSongButton->setFixedSize(30, 30);
    m_NextSongButton->setFixedSize(30, 30);
    m_PlayButton->setFixedSize(30, 30);
    m_SettingButton->setFixedSize(30, 30);
    m_mainWidget->setFixedSize(70, 70);
    grid->addWidget(m_PlayButton, 0, 1, Qt::AlignCenter);
    grid->addWidget(m_PreSongButton, 1, 0, Qt::AlignCenter);
    grid->addWidget(m_NextSongButton, 1, 2, Qt::AlignCenter);
    grid->addWidget(m_SettingButton, 2, 1, Qt::AlignCenter);
    grid->addWidget(m_mainWidget, 1, 1, Qt::AlignCenter);

    QVBoxLayout *mainWidgetLayout = new QVBoxLayout(m_mainWidget);
    mainWidgetLayout->setContentsMargins(0, 0, 0, 0);
    mainWidgetLayout->setSpacing(0);
    mainWidgetLayout->addWidget(m_showMainWindow);
    mainWidgetLayout->setAlignment(m_showMainWindow, Qt::AlignCenter);
    mainWidgetLayout->addWidget(m_volumeWidget);
    m_showMainWindow->setFixedSize(30, 30);

}