Example #1
0
/*******************************************************************
** INDI Menu: Handles communication to server and fetching basic XML
** data.
*******************************************************************/
INDIMenu::INDIMenu(QWidget *parent) : QWidget(parent, Qt::Window)
{

    ksw = (KStars *) parent;

    mainLayout    = new QVBoxLayout(this);
    mainLayout->setMargin(10);
    mainLayout->setSpacing(10);

    mainTabWidget = new QTabWidget(this);

    mainLayout->addWidget(mainTabWidget);

    setWindowTitle(xi18n("INDI Control Panel"));
    setAttribute(Qt::WA_ShowModal, false);

    clearB      = new QPushButton(xi18n("Clear"));
    closeB      = new QPushButton(xi18n("Close"));

    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->insertStretch(0);
    buttonLayout->addWidget(clearB, 0, Qt::AlignRight);
    buttonLayout->addWidget(closeB, 0, Qt::AlignRight);
    
    mainLayout->addLayout(buttonLayout);

    connect(closeB, SIGNAL(clicked()), this, SLOT(close()));
    connect(clearB, SIGNAL(clicked()), this, SLOT(clearLog()));

    resize( 640, 480);
}
Example #2
0
ActionLineEdit::ActionLineEdit(QWidget *parent)
		: QLineEdit(parent), toolButtonStyle_(Qt::ToolButtonIconOnly)
{
	QHBoxLayout *layout = new QHBoxLayout;
	setLayout(layout);
	layout->setSpacing(0);
	layout->setMargin(0);
	layout->insertStretch(0);
}
Example #3
0
TitleBar::TitleBar(QWidget *parent, QString* title)
    {
        // Don't let this widget inherit the parent's backround color
//	setAutoFillBackground(true);
        // Use a brush with a Highlight color role to render the background 
    setBackgroundRole(QPalette::NoRole);
     
    minimize = new QToolButton(this);
	minimize->setObjectName("minimizeButton");
    maximize = new QToolButton(this);
	maximize->setObjectName("maximizeButton");
    close = new QToolButton(this);
	close->setObjectName("closeButton");
        
    // Use the style to set the button pixmaps
    QPixmap pix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);
	close->setIcon(pix);
	close->setAutoRaise(true);
        
    maxPix = style()->standardPixmap(QStyle::SP_TitleBarMaxButton);
    maximize->setIcon(maxPix);

	maximize->setAutoRaise(true);

        
    pix = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
    minimize->setIcon(pix);
	minimize->setAutoRaise(true);

	restorePix = style()->standardPixmap(QStyle::SP_TitleBarNormalButton);
        
//    minimize->setMinimumHeight(20);
//    close->setMinimumHeight(20);
//    maximize->setMinimumHeight(20);
        
    label = new QLabel(this);
	label->setAttribute(Qt::WA_Disabled);
        
    QHBoxLayout *hbox = new QHBoxLayout(this);
    hbox->setContentsMargins ( 0,0,0,0 );  
    hbox->addWidget(label);
    hbox->addWidget(minimize, 0, Qt::AlignTop);
    hbox->addWidget(maximize, 0, Qt::AlignTop);
	hbox->addWidget(close, 0, Qt::AlignTop);
        
    hbox->insertStretch(1, 500);
    hbox->setSpacing(0);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
        
    maxNormal = false;
        
    connect(close, SIGNAL( clicked() ), parent->parentWidget(), SLOT(close() ) );
    connect(minimize, SIGNAL( clicked() ), this, SLOT(showSmall() ) );
    connect(maximize, SIGNAL( clicked() ), this, SLOT(showMaxRestore() ) );
}
Example #4
0
HelpDialog::HelpDialog(QWidget *parent)
   : QDialog(parent)
{
  setModal(false);
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowTitle(tr("Qucs Attenuator Help"));


  // --------  set help text into dialog  ------------
  QString s(tr("QucsAttenuator is an attenuator synthesis program. "
	       "To create a attenuator, simply enter all "
	       "the input parameters and press the calculation button. "
	       "Immediatly, the "
	       "schematic of the attenuator is calculated and "
	       "put into the clipboard. Now go to Qucs, "
	       "open an schematic and press "
	       "CTRL-V (paste from clipboard). The attenuator "
	       "schematic can now be inserted. "
	       "Have lots of fun!"));


  // --------  create dialog widgets  ------------
  resize(250, 230);

  vLayout = new QVBoxLayout(this);

  Text = new QTextEdit(s, this);
  Text->setReadOnly(true);
  Text->setMinimumSize(200,200);
  vLayout->addWidget(Text);

  QHBoxLayout *h = new QHBoxLayout;
  vLayout->addLayout(h);

  h->insertStretch(0,40);

  QPushButton *ButtonClose = new QPushButton(tr("Close"));
  connect(ButtonClose, SIGNAL(clicked()), this, SLOT(accept()));
  ButtonClose->setFocus();
  h->addWidget(ButtonClose);
  h->insertStretch(2,40);
}
Example #5
0
void EncTtsCfgGui::setUpWindow()
{
    m_settingsList = m_settingInterface->getSettings();

    // layout
    QVBoxLayout *mainLayout = new QVBoxLayout;

    // groupbox
    QGroupBox *groupBox = new QGroupBox(this);
    QGridLayout *gridLayout = new QGridLayout(groupBox);
    // setting widgets
    for(int i = 0; i < m_settingsList.size(); i++)
    {
        QLabel *label = new QLabel(m_settingsList.at(i)->name());
        gridLayout->addWidget(label, i, 0);
        QWidget *widget = createWidgets(m_settingsList.at(i));
        gridLayout->addWidget(widget, i, 1);
        widget->setLayoutDirection(Qt::LeftToRight);
        QWidget *btn = createButton(m_settingsList.at(i));
        if(btn != NULL)
        {
            gridLayout->addWidget(btn, i, 2);
        }
    }
    // add hidden spacers to make the dialog scale properly
    QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
    gridLayout->addItem(spacer, m_settingsList.size(), 0);
    spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
    gridLayout->addItem(spacer, m_settingsList.size(), 1);

    groupBox->setLayout(gridLayout);
    mainLayout->addWidget(groupBox);

    // connect browse btn
    connect(&m_browseBtnMap,SIGNAL(mapped(QObject*)),this,SLOT(browse(QObject*)));

    // ok - cancel buttons
    QPushButton* okBtn = new QPushButton(tr("Ok"),this);
    okBtn->setDefault(true);
    okBtn->setIcon(QIcon(":icons/go-next.png"));
    QPushButton* cancelBtn = new QPushButton(tr("Cancel"),this);
    cancelBtn->setIcon(QIcon(":icons/process-stop.png"));
    connect(okBtn,SIGNAL(clicked()),this,SLOT(accept()));
    connect(cancelBtn,SIGNAL(clicked()),this,SLOT(reject()));

    QHBoxLayout *btnbox = new QHBoxLayout;
    btnbox->addWidget(okBtn);
    btnbox->addWidget(cancelBtn);
    btnbox->insertStretch(0,1);

    mainLayout->addLayout(btnbox);

    this->setLayout(mainLayout);
}
Example #6
0
void CWizTitleBar::layoutTitleBar()
{
    QHBoxLayout *hbox = new QHBoxLayout(this);

    hbox->addWidget(m_titleLabel);
    hbox->addWidget(m_minimize);
    hbox->addWidget(m_maximize);
    hbox->addWidget(m_close);

    hbox->insertStretch(1, 500);
    hbox->setSpacing(0);
}
ExprControlCollection::ExprControlCollection(QWidget* parent, bool showAddButton)
    : QWidget(parent), count(0), showAddButton(showAddButton), editableExpression(0) {
    controlLayout = new QVBoxLayout();
    controlLayout->setMargin(0);
    controlLayout->setSpacing(0);
    controlLayout->insertStretch(-1, 100);

    if (showAddButton) {
        QPushButton* button = new QPushButton("Add Widget");
        button->setFocusPolicy(Qt::NoFocus);
        QHBoxLayout* buttonLayout = new QHBoxLayout();
        buttonLayout->insertStretch(-1, 100);
        buttonLayout->addWidget(button, 0);
        controlLayout->addLayout(buttonLayout);
        connect(button, SIGNAL(clicked()), SLOT(addControlDialog()));
    }
    setLayout(controlLayout);
}
Example #8
0
 Header:: Header(QWidget *w):QFrame(w) {
    setAutoFillBackground(true); 
    QPalette pal;
    pal.setBrush(backgroundRole(),QBrush(palette().highlight().color()));
    pal.setBrush(foregroundRole(), QBrush(Qt::white));
    setPalette(pal);
    //setBackgroundRole(QPalette::Highlight);

    close= new QLabel(this); 
    pin = new QLabel(this);

    QPixmap pix = QPixmap(":core/images/close_2.png");
    close->setPixmap(pix); 

    pix = QPixmap(":/core/images/pushpin_fixed.png");
    pin->setPixmap(pix);

    pin->setMinimumHeight(12); 
    close->setMinimumHeight(12); 

    close->setToolTip(tr("close"));
    pin->setToolTip(tr("Always on top"));

    pin->installEventFilter(this);
    close->installEventFilter(this);

    QLabel *label = new QLabel(this); 
    label->setText("Notifications"); 
    w->setWindowTitle("Notifications"); 

    QHBoxLayout *hbox = new QHBoxLayout(this); 

    hbox->addWidget(label); 
    hbox->addWidget(pin); 
    hbox->addWidget(close); 

    hbox->insertStretch(1, 500); 
    hbox->setSpacing(0); 
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 

    fix = false;
}
Example #9
0
SearchDialog::SearchDialog(QWidget* parent, QString startingText,
						TextSource* currentSource) : QDialog(parent)
{
	setWindowTitle("Search");

	mScopeOptions.insert("Entire Bible", "");
	mScopeOptions.insert("Old Testament", "Genesis 1:1 - Malachi 4:6;");
	mScopeOptions.insert("New Testament", "Matthew 1:1 - Revelation 22:21;");
	mScopeOptions.insert("Gospels", "Matthew 1:1 - John 21:25;");

	// Add option for current book
	QString book = currentSource->getSuperSectionName();
	Key start(book, 0, 0);
	int numChapters = currentSource->getNumSections();
	Key end(book, numChapters, currentSource->getNumParagraphs(numChapters)-1);
	mScopeOptions.insert("Book of " + book,
						start.toString() + " - " + end.toString());

	// Construct layout
	QVBoxLayout* layout = new QVBoxLayout;

	mSearchEdit = new QLineEdit();
	mSearchEdit->setText(startingText);
	layout->addWidget(mSearchEdit);

	QHBoxLayout* buttonLayout = new QHBoxLayout;

	// Scope
	mScopeCombo = new QComboBox();
	mScopeCombo->addItems(mScopeOptions.keys());
	mScopeCombo->setCurrentIndex(mScopeOptions.keys().indexOf("Entire Bible"));
	buttonLayout->addWidget(mScopeCombo);

	buttonLayout->insertStretch(100);
	QPushButton* searchButton = new QPushButton("Search");
	buttonLayout->addWidget(searchButton);
	layout->addLayout(buttonLayout);
	setLayout(layout);

	connect(searchButton, SIGNAL(clicked()), this, SLOT(accept()));
}
Example #10
0
GUIManager::GUIManager(QWidget *parent) : QWidget(parent, Qt::Window)
{    
#ifdef Q_OS_OSX
    if(Options::independentWindowINDI())
         setWindowFlags(Qt::Window);
     else{
        setWindowFlags(Qt::Window | Qt::WindowStaysOnTopHint);
        connect(QApplication::instance(), SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(changeAlwaysOnTop(Qt::ApplicationState)));
     }
#endif

    mainLayout    = new QVBoxLayout(this);
    mainLayout->setMargin(10);
    mainLayout->setSpacing(10);

    mainTabWidget = new QTabWidget(this);

    mainLayout->addWidget(mainTabWidget);

    setWindowIcon(QIcon::fromTheme("kstars_indi", QIcon(":/icons/breeze/default/kstars_indi.svg")));

    setWindowTitle(i18n("INDI Control Panel"));
    setAttribute(Qt::WA_ShowModal, false);

    clearB      = new QPushButton(i18n("Clear"));
    closeB      = new QPushButton(i18n("Close"));

    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->insertStretch(0);
    buttonLayout->addWidget(clearB, 0, Qt::AlignRight);
    buttonLayout->addWidget(closeB, 0, Qt::AlignRight);

    mainLayout->addLayout(buttonLayout);

    connect(closeB, SIGNAL(clicked()), this, SLOT(close()));
    connect(clearB, SIGNAL(clicked()), this, SLOT(clearLog()));

    resize( 640, 480);
}
Example #11
0
TMOGUIAdjust::TMOGUIAdjust(QWidget* parent, const char * name):
	QFrame(parent, name)
{
	iMode = 0;
	pValues = 0;
	bLog = true;
	bUpdate = false;

	setFrameStyle( QFrame::Panel | QFrame::Sunken );
	QGridLayout *pLayout = new QGridLayout(this, 8, 4);
	pLayout->setColStretch(0,0);
	pLayout->setColStretch(1,1);
	pLayout->setColStretch(2,0);
	pLayout->setColStretch(3,0);
	pLayout->addColSpacing(2,20);
	
	QSlider *pSlider = new QSlider(this, "HistoSlider");
	pSlider->setFixedSize(16,64);
	pSlider->setRange(-50, 50);
	pSlider->setValue(0);
	pSlider->setOrientation(Vertical);
	pSlider->setTickmarks(QSlider::Right);
	pSlider->setTickInterval(10);
	pLayout->addMultiCellWidget(pSlider, 0, 3, 0, 0);

	pHisto = new TMOGUIHisto(this, "Histogram");
	pLayout->addMultiCellWidget(pHisto, 0, 3, 1, 1, AlignBottom);

	pLayout->addRowSpacing(4, 2);

	pToneSlider = new TMOGUIToneSlider(this, "ToneSlider");
	pLayout->addWidget(pToneSlider, 5, 1);

	pRed = new QPushButton(this, "RedButton");
	pRed->setFlat(true);
	pRed->setFixedSize(16,16);
	pRed->setPixmap(*TMOResource::pResource->IconRed->pixmap());
	QToolTip::add(pRed, "Select Red Channel");
	pLayout->addWidget(pRed, 0, 2, AlignCenter);
	
	pGreen = new QPushButton(this, "GreenButton");
	pGreen->setFlat(true);
	pGreen->setFixedSize(16,16);
	pGreen->setPixmap(*TMOResource::pResource->IconGreen->pixmap());
	QToolTip::add(pGreen, "Select Green Channel");
	pLayout->addWidget(pGreen, 1, 2, AlignCenter);

	pBlue = new QPushButton(this, "BlueButton");
	pBlue->setFlat(true);
	pBlue->setFixedSize(16,16);
	pBlue->setPixmap(*TMOResource::pResource->IconBlue->pixmap());
	QToolTip::add(pBlue, "Select Blue Channel");
	pLayout->addWidget(pBlue, 2, 2, AlignCenter);

	pLum = new QPushButton(this, "LumButton");
	pLum->setFlat(true);
	pLum->setFixedSize(16,16);
	pLum->setPixmap(*TMOResource::pResource->IconLumDown->pixmap());	
	QToolTip::add(pLum, "Select Luminance");
	pLayout->addWidget(pLum, 3, 2, AlignCenter);
	
	pLinear = new QPushButton(this, "LinearButton");
	pLinear->setFlat(true);
	pLinear->setFixedSize(32,32);
	pLinear->setPixmap(*TMOResource::pResource->IconLin->pixmap());
	QToolTip::add(pLinear, "View In Linear Distribution");
	pLayout->addMultiCellWidget(pLinear, 0, 1, 3, 3, AlignCenter);

	pLog = new QPushButton(this, "LogarithmicButton");
	pLog->setFlat(true);
	pLog->setFixedSize(32,32);
	pLog->setPixmap(*TMOResource::pResource->IconLogDown->pixmap());
	QToolTip::add(pLog, "View In Logarithmic Distribution");
	pLayout->addMultiCellWidget(pLog, 2, 3, 3, 3, AlignCenter);
	
	pLayout->addRowSpacing(6, 2);

	QHBoxLayout* hbox = new QHBoxLayout();
	QLabel* pLabel = new QLabel(this, "BlackLabel");
	pLabel->setPixmap(*TMOResource::pResource->IconBlack->pixmap());
	pLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	hbox->addWidget(pLabel);
	pBlack = new QLineEdit(this, "EditBlack");
	pBlack->setAlignment(Qt::AlignRight);
	pBlack->setFixedWidth(72);
	hbox->addWidget(pBlack);
	hbox->insertStretch(-1,1);
	pLabel = new QLabel(this, "GammaLabel");
	pLabel->setPixmap(*TMOResource::pResource->IconGamma->pixmap());
	pLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	hbox->addWidget(pLabel);
	pGamma = new QLineEdit(this, "EditGamma");
	pGamma->setAlignment(Qt::AlignRight);
	pGamma->setFixedWidth(72);
	hbox->addWidget(pGamma);
	hbox->insertStretch(-1,1);
	pLabel = new QLabel(this, "WhiteLabel");
	pLabel->setPixmap(*TMOResource::pResource->IconWhite->pixmap());
	pLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	hbox->addWidget(pLabel);
	pWhite = new QLineEdit(this, "EditWhite");
	pWhite->setAlignment(Qt::AlignRight);
	pWhite->setFixedWidth(72);
	hbox->addWidget(pWhite);
	pLayout->addLayout(hbox, 7, 1);


	connect (pSlider, SIGNAL(sliderMoved(int)), this, SLOT(scalechanged(int)));
	connect (pLinear, SIGNAL(clicked()), pHisto, SLOT(setlinear()));
	connect (pLog, SIGNAL(clicked()), pHisto, SLOT(setlog()));
	connect (pRed, SIGNAL(clicked()), pHisto, SLOT(setr()));
	connect (pGreen, SIGNAL(clicked()), pHisto, SLOT(setg()));
	connect (pBlue, SIGNAL(clicked()), pHisto, SLOT(setb()));
	connect (pLum, SIGNAL(clicked()), pHisto, SLOT(setl()));
	connect (pLinear, SIGNAL(clicked()), pToneSlider, SLOT(setlinear()));
	connect (pLog, SIGNAL(clicked()), pToneSlider, SLOT(setlog()));
	connect (pRed, SIGNAL(clicked()), pToneSlider, SLOT(setr()));
	connect (pGreen, SIGNAL(clicked()), pToneSlider, SLOT(setg()));
	connect (pBlue, SIGNAL(clicked()), pToneSlider, SLOT(setb()));
	connect (pLum, SIGNAL(clicked()), pToneSlider, SLOT(setl()));
	connect (pRed, SIGNAL(clicked()), this, SLOT(setr()));
	connect (pGreen, SIGNAL(clicked()), this, SLOT(setg()));
	connect (pBlue, SIGNAL(clicked()), this, SLOT(setb()));
	connect (pLum, SIGNAL(clicked()), this, SLOT(setl()));
	connect (pBlack, SIGNAL(textChanged(const QString &)), this, SLOT(setblack(const QString &)));
	connect (pWhite, SIGNAL(textChanged(const QString &)), this, SLOT(setwhite(const QString &)));
	connect (pGamma, SIGNAL(textChanged(const QString &)), this, SLOT(setgamma(const QString &)));
	connect (pBlack, SIGNAL(returnPressed()), this, SLOT(updateall()));
	connect (pWhite, SIGNAL(returnPressed()), this, SLOT(updateall()));
	connect (pGamma, SIGNAL(returnPressed()), this, SLOT(updateall()));
	connect (pLinear, SIGNAL(clicked()), this, SLOT(setlinear()));
	connect (pLog, SIGNAL(clicked()), this, SLOT(setlog()));
}
Example #12
0
MainWindow::MainWindow(int width, int height) : m_buffer(0xffff - 28) {
    setMinimumSize(width, height);

    centralWidget = new QWidget(this);
    setCentralWidget(centralWidget);

    m_settings = std::make_unique<Settings>("IPSettings.txt");

    m_client = new MjpegClient(m_settings->getString("streamHost"),
                               m_settings->getInt("mjpegPort"),
                               m_settings->getString("mjpegRequestPath"));

    m_stream =
        new VideoStream(m_client, this, 640, 480, &m_streamCallback, [this] {},
                        [this] { m_button->setText("Stop Stream"); },
                        [this] { m_button->setText("Start Stream"); });
    m_stream->setMaximumSize(640, 480);

    m_button = new QPushButton("Start Stream");
    connect(m_button, SIGNAL(released()), this, SLOT(toggleButton()));

    m_leftLayout = new QVBoxLayout;

    m_centerLayout = new QVBoxLayout;

    m_centerLayout->addWidget(m_stream, 0, Qt::AlignTop);

    QHBoxLayout* buttonLayout = new QHBoxLayout;
    buttonLayout->addWidget(m_button, 0, Qt::AlignTop);
    buttonLayout->insertStretch(1);
    m_centerLayout->addLayout(buttonLayout);

    m_rightLayout = new QVBoxLayout;

    m_optionLayout = new QVBoxLayout;

    m_autoSelect = new QComboBox;
    connect(m_autoSelect,
            static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
            [this](int index) {
                char data[16] = "autonSelect\r\n";
                data[13] = index;

                m_dataSocket->writeDatagram(data, sizeof(data), m_remoteIP,
                                            m_dataPort);
            });
    m_optionLayout->addWidget(m_autoSelect);
    m_optionLayout->setAlignment(m_autoSelect, Qt::AlignTop);

    QGridLayout* mainLayout = new QGridLayout;
    mainLayout->setColumnMinimumWidth(0, width / 4);
    mainLayout->setColumnMinimumWidth(1, width / 4);
    mainLayout->setColumnMinimumWidth(2, width / 4);
    mainLayout->setColumnMinimumWidth(3, width / 4);

    mainLayout->addLayout(m_leftLayout, 0, 0);
    mainLayout->addLayout(m_centerLayout, 0, 1);
    mainLayout->addLayout(m_rightLayout, 0, 2);
    mainLayout->addLayout(m_optionLayout, 0, 3);

    centralWidget->setLayout(mainLayout);

    createActions();
    createMenus();

    setUnifiedTitleAndToolBarOnMac(true);

    m_dataSocket = std::make_unique<QUdpSocket>(this);
    m_dataSocket->bind(m_settings->getInt("dsDataPort"));
    connect(m_dataSocket.get(), SIGNAL(readyRead()), this,
            SLOT(handleSocketData()));

    m_remoteIP = QString::fromUtf8(m_settings->getString("robotIP").c_str());
    m_dataPort = m_settings->getInt("robotDataPort");

    m_connectTimer = std::make_unique<QTimer>();
    connect(m_connectTimer.get(), &QTimer::timeout, [this] {
        if (!m_connectDlgOpen) {
            char data[16] = "connect\r\n";
            m_dataSocket->writeDatagram(data, sizeof(data), m_remoteIP,
                                        m_dataPort);
        }

        m_connectTimer->start(2000);
    });
    m_connectTimer->start(2000);
}
Example #13
0
ModelWindow::ModelWindow(MainWindow *parent, const QDir &home) :
    QWidget(parent), home(home), main(parent), ride(NULL), current(NULL)
{
    static preset presetsInit[] = {

        { tr("User Defined"), 0, 0, 0, 0, true, 20 },
        { tr("Natural Cadence Selection"), 0, 1, 12, 12, false, 5 }, // don't ignore zero for cadences!
        { tr("Route Visualisation"), 11, 10, 4, 4, false, 5 }, // don't ignore zero for cadences!
        { tr("Power Fatigue"), 9, 0, 12, 12, true, 5 },
        { tr("Impact of Altitude"), 4, 2, 0, 12, true, 10 },
        { "", 0, 0, 0, 0, false, 0 }
    };
    presets = presetsInit;

    // Layouts
    QVBoxLayout *mainLayout = new QVBoxLayout;
    QHBoxLayout *topLayout = new QHBoxLayout;
    QHBoxLayout *chartLayout = new QHBoxLayout;
    QHBoxLayout *control1Layout = new QHBoxLayout;
    QHBoxLayout *control2Layout = new QHBoxLayout;

    // presetValues
    presetValues = new QComboBox;
    fillPresets(presetValues);
    presetValues->setCurrentIndex(1);

    // labels
    presetLabel = new QLabel(tr("Analyse"), this);
    xLabel = new QLabel(tr("X-Axis:"), this);
    yLabel = new QLabel(tr("Y-Axis:"), this);
    zLabel = new QLabel(tr("Z-Axis:"), this);
    colorLabel = new QLabel(tr("Color:"), this);
    binLabel = new QLabel(tr("Bin Width:"), this);

    // selectors
    xSelector = new QComboBox;
    addStandardChannels(xSelector);
    xSelector->setCurrentIndex(0); // power

    ySelector = new QComboBox;
    addStandardChannels(ySelector);
    ySelector->setCurrentIndex(1); // cadence

    zSelector = new QComboBox;
    addStandardChannels(zSelector);
    zSelector->addItem(tr("Time at X&Y"), MODEL_XYTIME);
    zSelector->setCurrentIndex(12); // time at xy

    colorSelector = new QComboBox;
    addStandardChannels(colorSelector);
    colorSelector->addItem(tr("Power Zone"), MODEL_POWERZONE);
    colorSelector->addItem(tr("Time at X&Y"), MODEL_XYTIME);
    colorSelector->setCurrentIndex(12); // power zone

    styleSelector = new QComboBox;
    styleSelector->addItem(tr("Bar"));
    styleSelector->addItem(tr("Grid"));
    styleSelector->addItem(tr("Surface"));
    styleSelector->addItem(tr("Dots"));
    styleSelector->setCurrentIndex(0);

    ignore = new QCheckBox(tr("Ignore Zero"));
    ignore->setChecked(true);
    grid = new QCheckBox(tr("Show Grid"));
    grid->setChecked(true);
    frame = new QCheckBox(tr("Frame Intervals"));
    frame->setChecked(true);
    legend = new QCheckBox(tr("Legend"));
    legend->setChecked(true);

    binWidthLineEdit = new QLineEdit(this);
    binWidthLineEdit->setFixedWidth(30);
    binWidthLineEdit->setText("5");
    binWidthSlider = new QSlider(Qt::Horizontal);
    binWidthSlider->setTickPosition(QSlider::TicksBelow);
    binWidthSlider->setTickInterval(1);
    binWidthSlider->setMinimum(3);
    binWidthSlider->setMaximum(100);
    binWidthSlider->setValue(5);

    resetView = new QPushButton(tr("Reset View"));

    // the plot widget
    modelPlot= new ModelPlot(main, NULL);
    zpane = new QSlider(Qt::Vertical);
    zpane->setTickInterval(1);
    zpane->setMinimum(0);
    zpane->setMaximum(100);
    zpane->setValue(0);

    chartLayout->addWidget(zpane);
    chartLayout->addWidget(modelPlot);

    // Build Layouts
    topLayout->addWidget(presetLabel);
    topLayout->addWidget(presetValues);
    topLayout->insertStretch(-1);
    topLayout->addWidget(grid);
    topLayout->addWidget(legend);
    topLayout->addWidget(frame);
    topLayout->addWidget(styleSelector);
    topLayout->setSpacing(10);

    control1Layout->addWidget(xLabel);
    control1Layout->addWidget(xSelector);
    control1Layout->addWidget(yLabel);
    control1Layout->addWidget(ySelector);
    control1Layout->addWidget(zLabel);
    control1Layout->addWidget(zSelector);
    control1Layout->addWidget(colorLabel);
    control1Layout->addWidget(colorSelector);
    control1Layout->insertStretch(0);
    control1Layout->insertStretch(-1);
    control1Layout->setSpacing(10);

    control2Layout->addWidget(binLabel);
    control2Layout->addWidget(binWidthLineEdit);
    control2Layout->addWidget(binWidthSlider);
    control2Layout->addWidget(ignore);
    control2Layout->addWidget(resetView);
    control2Layout->setSpacing(10);

    // Now layout the screen with the new widgets
    mainLayout->addItem(topLayout);
    mainLayout->addItem(chartLayout);
    mainLayout->addItem(control1Layout);
    mainLayout->addItem(control2Layout);
    mainLayout->setContentsMargins(20, 20, 20, 20);
    setLayout(mainLayout);

    // now connect up the widgets
    connect(main, SIGNAL(rideSelected()), this, SLOT(rideSelected()));
    connect(main, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));
    connect(presetValues, SIGNAL(currentIndexChanged(int)), this, SLOT(applyPreset(int)));
    connect(xSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirty()));
    connect(ySelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirty()));
    connect(zSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirty()));
    connect(colorSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setDirty()));
    connect(grid, SIGNAL(stateChanged(int)), this, SLOT(setGrid()));
    connect(legend, SIGNAL(stateChanged(int)), this, SLOT(setLegend()));
    connect(frame, SIGNAL(stateChanged(int)), this, SLOT(setFrame()));
    connect(styleSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(styleSelected(int)));
    connect(ignore, SIGNAL(stateChanged(int)), this, SLOT(setDirty()));
    connect(binWidthSlider, SIGNAL(valueChanged(int)), this, SLOT(setBinWidthFromSlider()));
    connect(binWidthLineEdit, SIGNAL(editingFinished()), this, SLOT(setBinWidthFromLineEdit()));
    connect(resetView, SIGNAL(clicked()), this, SLOT(resetViewPoint()));
    connect(zpane, SIGNAL(valueChanged(int)), this, SLOT(setZPane(int)));
}
Example #14
0
MintingView::MintingView(QWidget *parent) :
    QWidget(parent), model(0), mintingView(0)
{
    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);

    QString legendBoxStyle = "background-color: rgb(%1,%2,%3); border: 1px solid black;";

    QLabel *youngColor = new QLabel(" ");
    youngColor->setMaximumHeight(15);
    youngColor->setMaximumWidth(10);
    youngColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_YOUNG.red()).arg(COLOR_MINT_YOUNG.green()).arg(COLOR_MINT_YOUNG.blue()));
    QLabel *youngLegend = new QLabel(tr("transaction is too young"));
    youngLegend->setContentsMargins(5,0,15,0);

    QLabel *matureColor = new QLabel(" ");
    matureColor->setMaximumHeight(15);
    matureColor->setMaximumWidth(10);
    matureColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_MATURE.red()).arg(COLOR_MINT_MATURE.green()).arg(COLOR_MINT_MATURE.blue()));
    QLabel *matureLegend = new QLabel(tr("transaction is mature"));
    matureLegend->setContentsMargins(5,0,15,0);

    QLabel *oldColor = new QLabel(" ");
    oldColor->setMaximumHeight(15);
    oldColor->setMaximumWidth(10);
    oldColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_OLD.red()).arg(COLOR_MINT_OLD.green()).arg(COLOR_MINT_OLD.blue()));
    QLabel *oldLegend = new QLabel(tr("transaction has reached maximum probability"));
    oldLegend->setContentsMargins(5,0,15,0);

    QHBoxLayout *legendLayout = new QHBoxLayout();
    legendLayout->setContentsMargins(10,10,0,0);
    legendLayout->addWidget(youngColor);
    legendLayout->addWidget(youngLegend);
    legendLayout->addWidget(matureColor);
    legendLayout->addWidget(matureLegend);
    legendLayout->addWidget(oldColor);
    legendLayout->addWidget(oldLegend);
    legendLayout->insertStretch(-1);
	
	QLabel *label1 = new QLabel(this);
	label1->setText("Staking Estimations");
	label1->setAlignment(Qt::AlignLeft);
	QFont font( "Arial", 16, QFont::Bold);
	label1->setFont(font);
	label1->setFixedWidth(250);
	
	QLabel *mintingLabel = new QLabel(tr("Check the arrow icon below for more staking information. *BETA*"));

    QLabel *mintingLabel2 = new QLabel(tr(" [Display staking probability within]: "));
    mintingCombo = new QComboBox();
    mintingCombo->addItem(tr("10 min"), Minting10min);
    mintingCombo->addItem(tr("24 hours"), Minting1day);
    mintingCombo->addItem(tr("7 days"), Minting7days);
    mintingCombo->addItem(tr("30 days"), Minting30days);
    mintingCombo->addItem(tr("60 days"), Minting60days);
    mintingCombo->addItem(tr("90 days"), Minting90days);
    mintingCombo->setFixedWidth(120);

    hlayout->insertStretch(0);
    hlayout->addWidget(mintingLabel);
	hlayout->addWidget(mintingLabel2);
    hlayout->addWidget(mintingCombo);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(view);
    vlayout->addLayout(legendLayout);

    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_WS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    mintingView = view;

    connect(mintingCombo, SIGNAL(activated(int)), this, SLOT(chooseMintingInterval(int)));

    // Actions
    QAction *copyTxIDAction = new QAction(tr("Copy transaction ID of input"), this);
    QAction *copyAddressAction = new QAction(tr("Copy address of input"), this);
    QAction *showHideAddressAction = new QAction(tr("Show/hide 'Address' column"), this);
    QAction *showHideTxIDAction = new QAction(tr("Show/hide 'Transaction' column"), this);

    contextMenu = new QMenu();
    contextMenu->addAction(copyAddressAction);
    contextMenu->addAction(copyTxIDAction);
    contextMenu->addAction(showHideAddressAction);
    contextMenu->addAction(showHideTxIDAction);

    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
    connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
    connect(showHideAddressAction, SIGNAL(triggered()), this, SLOT(showHideAddress()));
    connect(showHideTxIDAction, SIGNAL(triggered()), this, SLOT(showHideTxID()));

    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
}
Example #15
0
//создание интерфейса
void MyServer::createGui(){

    //панель управления логом
    prevButton = new QPushButton("<<",this);
    prevButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    prevButton->setEnabled(false);
    connect(prevButton, SIGNAL(clicked(bool)),this,SLOT(slotPrevButton()));

    nextButton = new QPushButton(">>",this);
    nextButton->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
    nextButton->setEnabled(false);
    connect(nextButton,SIGNAL(clicked(bool)),this,SLOT(slotNextButton()));

    logNumber = new QLabel("1",this);
    logNumber->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);

    QHBoxLayout *logButtonsLayout = new QHBoxLayout;
    logButtonsLayout->addWidget(prevButton);
    logButtonsLayout->insertStretch(-1);
    logButtonsLayout->addWidget(logNumber);
    logButtonsLayout->insertStretch(-1);
    logButtonsLayout->addWidget(nextButton);

    //лог
    txtStack = new QStackedWidget(this);
    txtStack->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Expanding);
    txtStack->setFixedSize(screen.width()*PERCENT_OF_SCREEN*PERCENT_OF_SCREEN*0.7f, screen.height()*PERCENT_OF_SCREEN*0.7f);
    QTextEdit *txt = new QTextEdit(txtStack);
    txt->setReadOnly(true);
    txtStack->addWidget(txt);

    //левая панель сервера (лог и кнопки)
    QVBoxLayout *leftPanelLayout = new QVBoxLayout();
    leftPanelLayout->addWidget(txtStack);
    leftPanelLayout->addLayout(logButtonsLayout);

    //правая панель (кнопки создания и удаления кораблей)
    QPushButton *createShipButton = new QPushButton ("Добавить корабль",this);
    createShipButton->setFixedWidth(createShipButton->sizeHint().width()*1.3);
    connect(createShipButton,SIGNAL(clicked()),this,SLOT(slotNewShip()));

    deleteShipButton = new QPushButton ("Удалить корабль",this);
    deleteShipButton->setFixedWidth(createShipButton->sizeHint().width()*1.3);
    deleteShipButton->setEnabled(false);
    connect(deleteShipButton,SIGNAL(clicked(bool)),this,SLOT(slotDeleteShip()));

    messageLabel=new QLabel("",this);


    QVBoxLayout *rightPanelLayout = new QVBoxLayout;
    rightPanelLayout->addWidget(createShipButton);
    rightPanelLayout->addWidget(deleteShipButton);
    rightPanelLayout->addWidget(messageLabel);
    rightPanelLayout->insertStretch(-1);


    QHBoxLayout *mainPanelLayout = new QHBoxLayout;
    mainPanelLayout->addLayout(leftPanelLayout);
    mainPanelLayout->addLayout(rightPanelLayout);

    setLayout(mainPanelLayout);
    setFixedSize(sizeHint().width(),sizeHint().height());
}
NCSAFindBar::NCSAFindBar( Okular::Document * document, QWidget * parent )
  : QWidget( parent )
  , m_active( false )
{
    doc = document;
    if(NULL != doc)
    {
      doc->addObserver(this);
    }
    QVBoxLayout * vlay = new QVBoxLayout( this );
    QHBoxLayout * displayRow = new QHBoxLayout();
    vlay->addLayout( displayRow );
    display = new QLabel("");
    displayRow->addWidget(display);
    displayRow->insertStretch(1);
    resultComboBox = new QComboBox();
    //resultComboBox->addItems(fonts);
    displayRow->addWidget(resultComboBox);

    QHBoxLayout * lay = new QHBoxLayout();
    vlay->setMargin( 2 );
    vlay->addLayout(lay);


    QPushButton * optionsBtn = new QPushButton( this );
    optionsBtn->setText( i18n( "NCSA Options" ) );
    optionsBtn->setToolTip( i18n( "Modify search behavior" ) );
    QMenu * optionsMenu = new QMenu( optionsBtn );
    m_buildFontAct = optionsMenu->addAction( i18n( "Create custom font" ) );
    connect( m_buildFontAct, SIGNAL(triggered(bool)), this, SLOT(buildFontAct(bool)) );

    optionsBtn->setMenu( optionsMenu );
    lay->addWidget( optionsBtn );
    
    QStringList fonts = QFontDatabase().families();
    
    fontComboBox = new QComboBox();
    fontComboBox->addItems(fonts);
    lay->addWidget(fontComboBox);
    connect( fontComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeFont(int)) );
    connect( resultComboBox, SIGNAL(highlighted(int)), this, SLOT(resultComboBoxIndexChanged(int)) );

    QPalette p(palette());
    p.setColor(QPalette::Background, Qt::white);
    display->setAutoFillBackground(true);
    display->setPalette(p);
    display->setText("Lalala");
    QFont font;
    font.setPointSize(32);
    font.setBold(true);
    font.setFamily(fonts.at(16));

    display->setFont(font);
    
    searchLine = new QLineEdit();
    lay->addWidget(searchLine);
    
    connect(searchLine,SIGNAL(textChanged(QString)),this,SLOT(searchLineTextChanged(QString)));
    hide();
    
    QPushButton * searchBtn = new QPushButton( KIcon( "Search" ), i18nc( "Search using word spotting technique", "search" ), this );
    searchBtn->setToolTip( i18n( "Search using word spotting technique" ) );
    lay->addWidget( searchBtn );
    connect( searchBtn, SIGNAL(clicked()), this, SLOT(performSearch()) );

    // "activate" it only at th very end
    m_active = true;
    wordSpottingUtil = NULL;
    
}
Example #17
0
FeedbackDialog::FeedbackDialog(QWidget * parent) : QDialog(parent)
{
    setModal(true);
    setWindowFlags(Qt::Sheet);
    setWindowModality(Qt::WindowModal);
    setWindowTitle(tr("Feedback"));
    setMinimumSize(700, 460);
    resize(700, 460);
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

    netManager = NULL;
    GenerateSpecs();

    /* Top layout */

    QVBoxLayout * pageLayout = new QVBoxLayout();
    QHBoxLayout * summaryLayout = new QHBoxLayout();
    QHBoxLayout * emailLayout = new QHBoxLayout();
    QHBoxLayout * descriptionLayout = new QHBoxLayout();
    QHBoxLayout * combinedTopLayout = new QHBoxLayout();
    QHBoxLayout * systemLayout = new QHBoxLayout();

    info = new QLabel();
    info->setText(QString(
        "<style type=\"text/css\">"
        "a { color: #fc0; }"
        "b { color: #0df; }"
        "</style>"
        "<div align=\"center\"><h1>%1</h1>"
        "<h3>%2<h3>"
        "<h4>%3 <a href=\"http://hedgewars.org/kb/KnownBugs\">known bugs</a><h4>"
        "<h4>%4<h4>"
        "</div>")
        .arg(tr("Send us feedback!"))
        .arg(tr("We are always happy about suggestions, ideas, or bug reports."))
        .arg(tr("If you found a bug, you can see if it's already been reported here: "))
        .arg(tr("Your email address is optional, but necessary if you want us to get back at you."))
    );
    info->setOpenExternalLinks(true);
    pageLayout->addWidget(info);

    QVBoxLayout * summaryEmailLayout = new QVBoxLayout();

    const int labelWidth = 90;

    label_email = new QLabel();
    label_email->setText(QLabel::tr("Your Email"));
    label_email->setFixedWidth(labelWidth);
    emailLayout->addWidget(label_email);
    email = new QLineEdit();
    emailLayout->addWidget(email);
    summaryEmailLayout->addLayout(emailLayout);

    label_summary = new QLabel();
    label_summary->setText(QLabel::tr("Summary"));
    label_summary->setFixedWidth(labelWidth);
    summaryLayout->addWidget(label_summary);
    summary = new QLineEdit();
    summaryLayout->addWidget(summary);
    summaryEmailLayout->addLayout(summaryLayout);

    combinedTopLayout->addLayout(summaryEmailLayout);

    CheckSendSpecs = new QCheckBox();
    CheckSendSpecs->setText(QLabel::tr("Send system information"));
    CheckSendSpecs->setChecked(true);
    systemLayout->addWidget(CheckSendSpecs);
    BtnViewInfo = new QPushButton(tr("View"));
    systemLayout->addWidget(BtnViewInfo, 1);
    BtnViewInfo->setFixedSize(60, 30);
    connect(BtnViewInfo, SIGNAL(clicked()), this, SLOT(ShowSpecs()));
    combinedTopLayout->addLayout(systemLayout);

    combinedTopLayout->setStretch(0, 1);
    combinedTopLayout->insertSpacing(1, 20);

    pageLayout->addLayout(combinedTopLayout);

    label_description = new QLabel();
    label_description->setText(QLabel::tr("Description"));
    label_description->setFixedWidth(labelWidth);
    descriptionLayout->addWidget(label_description, 0, Qt::AlignTop);
    description = new QTextBrowser();
    description->setReadOnly(false);
    descriptionLayout->addWidget(description);
    pageLayout->addLayout(descriptionLayout);

    /* Bottom layout */

    QHBoxLayout * bottomLayout = new QHBoxLayout();
    QHBoxLayout * captchaLayout = new QHBoxLayout();
    QVBoxLayout * captchaInputLayout = new QVBoxLayout();

    QPushButton * BtnCancel = new QPushButton(tr("Cancel"));
    bottomLayout->addWidget(BtnCancel, 0);
    BtnCancel->setFixedSize(100, 40);
    connect(BtnCancel, SIGNAL(clicked()), this, SLOT(reject()));

    bottomLayout->insertStretch(1);

    label_captcha = new QLabel();
    label_captcha->setStyleSheet("border: 3px solid #ffcc00; border-radius: 4px");
    label_captcha->setText("loading<br>captcha");
    label_captcha->setFixedSize(200, 50);
    captchaLayout->addWidget(label_captcha);

    label_captcha_input = new QLabel();
    label_captcha_input->setText(QLabel::tr("Type the security code:"));
    captchaInputLayout->addWidget(label_captcha_input);
    captchaInputLayout->setAlignment(label_captcha, Qt::AlignBottom);
    captcha_code = new QLineEdit();
    captcha_code->setFixedSize(165, 30);
    captchaInputLayout->addWidget(captcha_code);
    captchaInputLayout->setAlignment(captcha_code, Qt::AlignTop);
    captchaLayout->addLayout(captchaInputLayout);
    captchaLayout->setAlignment(captchaInputLayout, Qt::AlignLeft);

    bottomLayout->addLayout(captchaLayout);
    bottomLayout->addSpacing(40);

    // TODO: Set green arrow icon for send button (:/res/Start.png)
    BtnSend = new QPushButton(tr("Send Feedback"));
    bottomLayout->addWidget(BtnSend, 0);
    BtnSend->setFixedSize(120, 40);
    connect(BtnSend, SIGNAL(clicked()), this, SLOT(SendFeedback()));

    bottomLayout->setStretchFactor(captchaLayout, 0);
    bottomLayout->setStretchFactor(BtnSend, 1);

    QVBoxLayout * dialogLayout = new QVBoxLayout(this);
    dialogLayout->addLayout(pageLayout, 1);
    dialogLayout->addLayout(bottomLayout);

    LoadCaptchaImage();
}
void JabberCreateAccountWidget::createGui(bool showButtons)
{
	QVBoxLayout *mainLayout = new QVBoxLayout(this);

	QWidget *formWidget = new QWidget(this);
	mainLayout->addWidget(formWidget);

	QFormLayout *layout = new QFormLayout(formWidget);

	QWidget *jidWidget = new QWidget(this);
	QGridLayout *jidLayout = new QGridLayout(jidWidget);
	jidLayout->setSpacing(0);
	jidLayout->setMargin(0);
	jidLayout->setColumnStretch(0, 2);
	jidLayout->setColumnStretch(2, 2);

	Username = new QLineEdit(this);
	connect(Username, SIGNAL(textEdited(QString)), this, SLOT(dataChanged()));
	jidLayout->addWidget(Username);

	QLabel *atLabel = new QLabel("@", this);
	jidLayout->addWidget(atLabel, 0, 1);

	Domain = new QComboBox();
	Domain->setEditable(true);
	connect(Domain, SIGNAL(currentIndexChanged(QString)), this, SLOT(dataChanged()));
	connect(Domain, SIGNAL(editTextChanged(QString)), this, SLOT(dataChanged()));
	jidLayout->addWidget(Domain, 0, 2);

	layout->addRow(tr("Username") + ':', jidWidget);

	NewPassword = new QLineEdit(this);
	connect(NewPassword, SIGNAL(textEdited(const QString &)), this, SLOT(dataChanged()));
	NewPassword->setEchoMode(QLineEdit::Password);
	layout->addRow(tr("Password") + ':', NewPassword);

	ReNewPassword = new QLineEdit(this);
	connect(ReNewPassword, SIGNAL(textEdited(const QString &)), this, SLOT(dataChanged()));
	ReNewPassword->setEchoMode(QLineEdit::Password);
	layout->addRow(tr("Retype Password") + ':', ReNewPassword);

	RememberPassword = new QCheckBox(tr("Remember password"), this);
	layout->addWidget(RememberPassword);

	IdentityCombo = new IdentitiesComboBox(true, this);
	connect(IdentityCombo, SIGNAL(identityChanged(Identity)), this, SLOT(dataChanged()));
	layout->addRow(tr("Account Identity") + ':', IdentityCombo);

	QLabel *infoLabel = new QLabel(tr("<font size='-1'><i>Select or enter the identity that will be associated with this account.</i></font>"), this);
	infoLabel->setWordWrap(true);
	infoLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
	infoLabel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
	layout->addRow(0, infoLabel);

	QLabel *moreOptionsLabel = new QLabel;
	moreOptionsLabel->setText(tr("More options:"));

	ExpandConnectionOptionsButton = new QPushButton(">");
	ExpandConnectionOptionsButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
	connect(ExpandConnectionOptionsButton, SIGNAL(clicked()), this, SLOT(connectionOptionsChanged()));

	QWidget *moreOptions = new QWidget;
	QHBoxLayout *moreOptionsLayout = new QHBoxLayout(moreOptions);
	moreOptionsLayout->addWidget(moreOptionsLabel);
	moreOptionsLayout->addWidget(ExpandConnectionOptionsButton);
	moreOptionsLayout->setAlignment(ExpandConnectionOptionsButton, Qt::AlignLeft);
	moreOptionsLayout->insertStretch(-1);
	moreOptions->setLayout(moreOptionsLayout);

	mainLayout->addWidget(moreOptions);

	OptionsWidget = new QWidget(this);
	QHBoxLayout *optionsLayout = new QHBoxLayout((OptionsWidget));
	QGroupBox *connectionOptions = new QGroupBox(OptionsWidget);
	optionsLayout->addWidget(connectionOptions);
	connectionOptions->setTitle(tr("Connection settings"));

	QVBoxLayout *vboxLayout2 = new QVBoxLayout(connectionOptions);
	vboxLayout2->setSpacing(6);
	vboxLayout2->setMargin(9);

	CustomHostPort = new QCheckBox(connectionOptions);
	CustomHostPort->setText(tr("Manually Specify Server Host/Port") + ':');
	vboxLayout2->addWidget(CustomHostPort);
	connect(CustomHostPort, SIGNAL(toggled(bool)), SLOT(hostToggled(bool)));

	HostPortLayout = new QHBoxLayout();
	HostPortLayout->setSpacing(6);
	HostPortLayout->setMargin(0);

	CustomHostLabel = new QLabel(connectionOptions);
	CustomHostLabel->setText(tr("Host") + ':');
	HostPortLayout->addWidget(CustomHostLabel);

	CustomHost = new QLineEdit(connectionOptions);
	HostPortLayout->addWidget(CustomHost);

	CustomPortLabel = new QLabel(connectionOptions);
	CustomPortLabel->setText(tr("Port") + ':');
	HostPortLayout->addWidget(CustomPortLabel);

	CustomPort = new QLineEdit(connectionOptions);
	CustomPort->setMinimumSize(QSize(56, 0));
	CustomPort->setMaximumSize(QSize(56, 32767));
	CustomPort->setText(QString::number(port_));
	HostPortLayout->addWidget(CustomPort);

	vboxLayout2->addLayout(HostPortLayout);

	QHBoxLayout *EncryptionLayout = new QHBoxLayout();
	EncryptionLayout->setSpacing(6);
	EncryptionLayout->setMargin(0);
	EncryptionModeLabel = new QLabel(connectionOptions);
	EncryptionModeLabel->setText(tr("Encrypt connection") + ':');
	EncryptionLayout->addWidget(EncryptionModeLabel);

	EncryptionMode = new QComboBox(connectionOptions);
	EncryptionMode->addItem(tr("Always"), 0);
	EncryptionMode->addItem(tr("When available"), 1);
	EncryptionMode->addItem(tr("Legacy SSL"), 2);
	connect(EncryptionMode, SIGNAL(activated(int)), SLOT(sslActivated(int)));
	EncryptionLayout->addWidget(EncryptionMode);

	QSpacerItem *spacerItem = new QSpacerItem(151, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
	EncryptionLayout->addItem(spacerItem);
	vboxLayout2->addLayout(EncryptionLayout);

	LegacySSLProbe = new QCheckBox(connectionOptions);
	LegacySSLProbe->setText(tr("Probe legacy SSL port"));
	vboxLayout2->addWidget(LegacySSLProbe);

	mainLayout->addWidget(OptionsWidget);

	mainLayout->addStretch(100);

	QDialogButtonBox *buttons = new QDialogButtonBox(Qt::Horizontal, this);
	mainLayout->addWidget(buttons);

	RegisterAccountButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogApplyButton), tr("Register Account"), this);
	QPushButton *cancelButton = new QPushButton(qApp->style()->standardIcon(QStyle::SP_DialogCancelButton), tr("Cancel"), this);

	buttons->addButton(RegisterAccountButton, QDialogButtonBox::ApplyRole);
	buttons->addButton(cancelButton, QDialogButtonBox::RejectRole);

	connect(RegisterAccountButton, SIGNAL(clicked(bool)), this, SLOT(apply()));
	connect(cancelButton, SIGNAL(clicked(bool)), this, SLOT(cancel()));

	if (!showButtons)
		buttons->hide();
}
Example #19
0
MintingView::MintingView(QWidget *parent) :
    QWidget(parent), model(0), mintingView(0)
{
    QHBoxLayout *hlayout = new QHBoxLayout();
    hlayout->setContentsMargins(0,0,0,0);

    QString legendBoxStyle = "background-color: rgb(%1,%2,%3); border: 1px solid black;";

    QLabel *youngColor = new QLabel(" ");
    youngColor->setMaximumHeight(15);
    youngColor->setMaximumWidth(10);
    youngColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_YOUNG.red()).arg(COLOR_MINT_YOUNG.green()).arg(COLOR_MINT_YOUNG.blue()));
    QLabel *youngLegend = new QLabel(tr("transaction is too young"));
    youngLegend->setContentsMargins(5,0,15,0);

    QLabel *matureColor = new QLabel(" ");
    matureColor->setMaximumHeight(15);
    matureColor->setMaximumWidth(10);
    matureColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_MATURE.red()).arg(COLOR_MINT_MATURE.green()).arg(COLOR_MINT_MATURE.blue()));
    QLabel *matureLegend = new QLabel(tr("transaction is mature"));
    matureLegend->setContentsMargins(5,0,15,0);

    QLabel *oldColor = new QLabel(" ");
    oldColor->setMaximumHeight(15);
    oldColor->setMaximumWidth(10);
    oldColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_OLD.red()).arg(COLOR_MINT_OLD.green()).arg(COLOR_MINT_OLD.blue()));
    QLabel *oldLegend = new QLabel(tr("transaction  has reached maximum probability"));
    oldLegend->setContentsMargins(5,0,15,0);

    QHBoxLayout *legendLayout = new QHBoxLayout();
    legendLayout->setContentsMargins(10,10,0,0);
    legendLayout->addWidget(youngColor);
    legendLayout->addWidget(youngLegend);
    legendLayout->addWidget(matureColor);
    legendLayout->addWidget(matureLegend);
    legendLayout->addWidget(oldColor);
    legendLayout->addWidget(oldLegend);
    legendLayout->insertStretch(-1);

    QLabel *mintingLabel = new QLabel(tr("Display minting probability within : "));
    mintingCombo = new QComboBox();
    mintingCombo->addItem(tr("10 min"), Minting10min);
    mintingCombo->addItem(tr("24 hours"), Minting1day);
    mintingCombo->addItem(tr("30 days"), Minting30days);
    mintingCombo->addItem(tr("90 days"), Minting90days);
    mintingCombo->setFixedWidth(120);


    hlayout->insertStretch(0);
    hlayout->addWidget(mintingLabel);
    hlayout->addWidget(mintingCombo);

    QVBoxLayout *vlayout = new QVBoxLayout(this);
    vlayout->setContentsMargins(0,0,0,0);
    vlayout->setSpacing(0);

    QTableView *view = new QTableView(this);
    vlayout->addLayout(hlayout);
    vlayout->addWidget(view);
    vlayout->addLayout(legendLayout);

    vlayout->setSpacing(0);
    int width = view->verticalScrollBar()->sizeHint().width();
    // Cover scroll bar width with spacing
#ifdef Q_WS_MAC
    hlayout->addSpacing(width+2);
#else
    hlayout->addSpacing(width);
#endif
    // Always show scroll bar
    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    view->setTabKeyNavigation(false);
    view->setContextMenuPolicy(Qt::CustomContextMenu);

    mintingView = view;

    connect(mintingCombo, SIGNAL(activated(int)), this, SLOT(chooseMintingInterval(int)));

}
void widgetKeyBoard::createKeyboard(void)
{
	QKeyPushButton	*tmp = NULL;	
	QVBoxLayout	*tmpVLayout = new QVBoxLayout;
	QHBoxLayout	*tmpLayout = new QHBoxLayout;
        QString         tmpStyle = QString::null;

        if (widgetKeyBoard::m_created == true) // tastiera già  creata: esce
		return;
        widgetKeyBoard::m_created = true; // segnala che è stata creata la tastiera
	//
        // stampa tasti numerici:
	tmpLayout->addWidget(createNewKey("\\"));
	for (short i = 49; i <= 57; i++) {
		tmpLayout->addWidget(createNewKey(QChar(i)));
	}
        tmpLayout->addWidget(createNewKey(tr("0")));
        tmpLayout->addWidget(createNewKey(tr("/")));
        tmpLayout->addWidget(createNewKey(tr("?")));
        tmpLayout->addWidget(createNewKey(tr("'")));        
        if (this->isEmbeddedKeyboard() == true)
            tmpStyle = QString(KEY_BACKSPACE_EMBEDDED);
        else
            tmpStyle = QString(KEY_BACKSPACE);
        tmp = createNewKey(tmpStyle);
        tmp->setMaximumWidth(tmp->maximumWidth() * 2);
        tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmpLayout->addWidget(tmp);
        tmpStyle = QString(KEY_CANC);
        if (this->isEmbeddedKeyboard() == true)
            tmpStyle = tmpStyle.toLower();
        tmp = createNewKey(tmpStyle);
        tmp->setMaximumWidth(tmp->maximumWidth());
        tmp->setMinimumWidth(tmp->minimumWidth());
        tmpLayout->addWidget(tmp);
#if !defined(QT_ARCH_MACOSX)
        tmpLayout->insertStretch(13, 1);
#endif
	tmpVLayout->insertLayout(0, tmpLayout);
	//
	// Stampa linea della "Q":
	tmpLayout = new QHBoxLayout;	
        QVBoxLayout *layoutReturn = new QVBoxLayout;
	tmp = createNewKey(KEY_TAB);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2 - 5);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2 - 5);
        tmpLayout->addWidget(tmp);
        tmpLayout->addWidget(createNewKey(tr("Q")));
        tmpLayout->addWidget(createNewKey(tr("W")));
        tmpLayout->addWidget(createNewKey(tr("E")));
        tmpLayout->addWidget(createNewKey(tr("R")));
        tmpLayout->addWidget(createNewKey(tr("T")));
        tmpLayout->addWidget(createNewKey(tr("Y")));
        tmpLayout->addWidget(createNewKey(tr("U")));
        tmpLayout->addWidget(createNewKey(tr("I")));
        tmpLayout->addWidget(createNewKey(tr("O")));
        tmpLayout->addWidget(createNewKey(tr("P")));
        tmpLayout->addWidget(createNewKey(tr("+")));
        tmpLayout->addWidget(createNewKey(tr("*")));
        tmpLayout->addWidget(createNewKey(tr("-")));
#if !defined(QT_ARCH_MACOSX)
        tmpLayout->insertStretch(-1, 1);
#endif
        layoutReturn->insertLayout(0, tmpLayout, 1); // inserisce la riga della "Q"
	//
	// Stampa linea della "A":
	tmpLayout = new QHBoxLayout;	
	tmp = createNewKey(KEY_CAPS);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2 + 5);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2 + 5);                
        if (this->isEmbeddedKeyboard() == true)
            tmpStyle = QString(EMBEDDED_KEYBOARD);
        tmp->setStyleSheet(QString(DEFAULT_STYLE_BUTTON) + QString(CHANGED_BACKGROUND_BUTTON) + tmpStyle); // segnalato come attivo
	tmpLayout->addWidget(tmp);
        tmpLayout->addWidget(createNewKey(tr("A")));
        tmpLayout->addWidget(createNewKey(tr("S")));
        tmpLayout->addWidget(createNewKey(tr("D")));
        tmpLayout->addWidget(createNewKey(tr("F")));
        tmpLayout->addWidget(createNewKey(tr("G")));
        tmpLayout->addWidget(createNewKey(tr("H")));
        tmpLayout->addWidget(createNewKey(tr("J")));
        tmpLayout->addWidget(createNewKey(tr("K")));
        tmpLayout->addWidget(createNewKey(tr("L")));
        tmpLayout->addWidget(createNewKey(tr("ò")));
        tmpLayout->addWidget(createNewKey(tr("à")));
        tmpLayout->addWidget(createNewKey(tr("ù")));
        tmpLayout->addWidget(createNewKey(tr("@")));
	tmpLayout->insertStretch(-1, 1);
#if !defined(QT_ARCH_MACOSX)
	layoutReturn->setSpacing(5);
#endif
        layoutReturn->insertLayout(1, tmpLayout, 1); // inserisce la riga della "A"
	//
	// inserisce il vertical layout all'interno di un horizontal:	
	tmpLayout = new QHBoxLayout;
	tmpLayout->insertLayout(0, layoutReturn, 1);
	//
	// inserisce anche il tasto invio:
	tmp = createNewKey(KEY_RETURN);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmp->setMinimumHeight(tmp->minimumHeight() * 2);
	tmp->setMaximumHeight(tmp->maximumHeight() * 2);
	tmpLayout->addWidget(tmp);
	//
        // inserisce l'horizontal all'interno del layout verticale principale:
        tmpVLayout->insertLayout(1, tmpLayout);
	//	
	// Stampa linea della "Z":
	tmpLayout = new QHBoxLayout;
        tmp = createNewKey(KEY_CUT_LEFT);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmpLayout->addWidget(tmp);
        tmpLayout->addWidget(createNewKey(tr("_")));
        tmpLayout->addWidget(createNewKey(tr("Z")));
        tmpLayout->addWidget(createNewKey(tr("X")));
        tmpLayout->addWidget(createNewKey(tr("C")));
        tmpLayout->addWidget(createNewKey(tr("V")));
        tmpLayout->addWidget(createNewKey(tr("B")));
        tmpLayout->addWidget(createNewKey(tr("N")));
        tmpLayout->addWidget(createNewKey(tr("M")));
        tmpLayout->addWidget(createNewKey(tr(",")));
        tmpLayout->addWidget(createNewKey(tr(";")));
        tmpLayout->addWidget(createNewKey(tr(":")));
        tmpLayout->addWidget(createNewKey(tr(".")));
        tmp = createNewKey(KEY_CTRL_LEFT);
	tmp->setMaximumWidth(tmp->maximumWidth() * 3 + 5);
	tmp->setMinimumWidth(tmp->minimumWidth() * 3 + 5);
	tmpLayout->addWidget(tmp);
	tmpVLayout->insertLayout(2, tmpLayout);
	//	
	// Stampa linea dello SPACE:
	tmpLayout = new QHBoxLayout;
        tmp = createNewKey(KEY_COPY);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmpLayout->addWidget(tmp);
	tmp = createNewKey(KEY_ALT);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmpLayout->addWidget(tmp);
        tmp = createNewKey(KEY_SPACE);
	tmp->setMaximumWidth(tmp->maximumWidth() * 10);
	tmp->setMinimumWidth(tmp->minimumWidth() * 10);
	tmpLayout->addWidget(tmp);
        // password echo button:
        if (this->isEmbeddedKeyboard() == true)
            tmpStyle = QString(KEY_HIDECHAR_EMBEDDED);
        else
            tmpStyle = QString(KEY_HIDECHAR);
        tmp = createNewKey(tmpStyle);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmpLayout->addWidget(tmp);
        //
        tmp = createNewKey(KEY_PASTE);
	tmp->setMaximumWidth(tmp->maximumWidth() * 2);
	tmp->setMinimumWidth(tmp->minimumWidth() * 2);
	tmpLayout->addWidget(tmp);
	tmpVLayout->insertLayout(3, tmpLayout);
#if defined (QT_ARCH_MACOSX)
        tmpVLayout->setMargin(5);
#endif
	//
        // aggancia il layout a tutto il form:
        this->setLayout(tmpVLayout);
        this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}
Example #21
0
TitleBar::TitleBar(QMainWindow *parent)
{
    // 不继承父组件的背景色
  //  setAutoFillBackground(true);
    // 使用 Highlight 作为背景色
   // setBackgroundRole(QPalette::Highlight);
    this->mainWindow=parent;

    minimize = new QToolButton(this);
    maximize = new QToolButton(this);
    close= new QToolButton(this);

    // 设置按钮图像的样式
//    QPixmap pix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton);
//    close->setIcon(pix);

//    maxPix = style()->standardPixmap(QStyle::SP_TitleBarMaxButton);
//    maximize->setIcon(maxPix);

//    pix = style()->standardPixmap(QStyle::SP_TitleBarMinButton);
//    minimize->setIcon(pix);

//    restorePix = style()->standardPixmap(QStyle::SP_TitleBarNormalButton);

    QPixmap min_pix(":/images/min.png");
    QPixmap max_pix(":/images/max.png");
    QPixmap close_pix(":/images/close.png");

    this->setStyleSheet("margin-left:5px;");
    minimize->setMask(min_pix.createHeuristicMask());
    minimize->setStyleSheet("QToolButton{border-image:url(:/images/min.png);}"
                            "QToolButton:pressed{border-image:url(:/images/min_pressed.png)}");

    maximize->setMask(max_pix.createHeuristicMask());
    maximize->setStyleSheet("QToolButton{border-image:url(:/images/max.png);}"
                            "QToolButton:pressed{border-image:url(:/images/max_pressed.png)}");

    close->setMask(close_pix.createHeuristicMask());
    close->setStyleSheet("QToolButton{border-image:url(:/images/close.png);}"
                         "QToolButton:pressed{border-image:url(:/images/close_pressed.png)}");







  minimize->setMinimumSize(23,23);
  maximize->setMinimumSize(23,23);
  close->setMinimumSize(23,23);




//    QLabel *label = new QLabel(this);
//    label->setText("Window Title");

    QHBoxLayout *hbox = new QHBoxLayout(this);

    //hbox->addWidget(label);
    hbox->addWidget(minimize);
    hbox->addWidget(maximize);
    hbox->addWidget(close);

    hbox->insertStretch(0, 50);
    hbox->setSpacing(0);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    this->setLayout(hbox);

    maxNormal = false;

    connect(close, SIGNAL( clicked(bool) ), mainWindow, SLOT(close() ) );
    connect(minimize, SIGNAL( clicked(bool) ), this, SLOT(showSmall() ) );
    connect(maximize, SIGNAL( clicked(bool) ), this, SLOT(showMaxRestore() ) );
}
Example #22
0
void Expectations::createExpPanel()
{
    Utilities::clearLayout(expLayout_);

    // Name
    QLabel* nameLabel = new QLabel("Nom :");
    name_ = new QLineEdit(exp_->name());
    QHBoxLayout* h1 = new QHBoxLayout;
    h1->addWidget(nameLabel);
    h1->addWidget(name_);
    h1->insertStretch(-1);
    expLayout_->addLayout(h1);

    // Uvs the student wishes to do
    QLabel* wantedUvsLabel = new QLabel("Uvs voulues :");
    QScrollArea* wantedUvsScroll = new QScrollArea;
    QWidget* w1 = new QWidget;
    wantedUvsScroll->setWidget(w1);
    wantedUvsScroll->setFixedWidth(110);
    wantedUvsScroll->setWidgetResizable(true);
    wantedUvsLayout_ = new QVBoxLayout;
    w1->setLayout(wantedUvsLayout_);
    QHBoxLayout* h2 = new QHBoxLayout;
    h2->addWidget(wantedUvsLabel);
    h2->addWidget(wantedUvsScroll);

    // Uvs the student does not wish to do
    QLabel* unwantedUvsLabel = new QLabel("Uvs non voulues :");
    QScrollArea* unwantedUvsScroll = new QScrollArea;
    QWidget* w2 = new QWidget;
    unwantedUvsScroll->setWidget(w2);
    unwantedUvsScroll->setFixedWidth(110);
    unwantedUvsScroll->setWidgetResizable(true);
    unwantedUvsLayout_ = new QVBoxLayout;
    w2->setLayout(unwantedUvsLayout_);
    QHBoxLayout* h3 = new QHBoxLayout;
    h3->addWidget(unwantedUvsLabel);
    h3->addWidget(unwantedUvsScroll);

    // Degrees the students wishes to enroll in
    QGroupBox* wantedDegrees = new QGroupBox("Formations envisagées");
    degreesBox_ = new QComboBox;
    const QList<Degree*> &degrees = UTManager::instance().degrees();
    degreesBox_->insertItem(0,"Choix " + degrees.first()->type());
    int count = 1;
    for(int i = 0; i < degrees.size(); i++)
    {
        if(!degrees.at(i)->parent())
        {
            degreesBox_->insertItem(count,degrees.at(i)->title());
            count++;
        }
    }
    QObject::connect(degreesBox_,SIGNAL(activated(QString)),this,SLOT(selectDegree(QString)));
    degreeLayout_ = new QHBoxLayout;
    degreeLayout_->addWidget(degreesBox_);
    degreeLayout_->insertStretch(-1);
    QPushButton* addDegreeButton = new QPushButton("Ajouter");
    QObject::connect(addDegreeButton,SIGNAL(clicked()),this,SLOT(addWantedDegree()));
    QHBoxLayout* h5 = new QHBoxLayout;
    h5->addWidget(addDegreeButton);
    h5->insertStretch(-1);
    QVBoxLayout* v1 = new QVBoxLayout;
    v1->addLayout(degreeLayout_);
    v1->addLayout(h5);
    wantedDegrees->setLayout(v1);
    for(int i = 0; i < exp_->degrees().size(); i++)
    {
        const Degree* degree = exp_->degrees()[i];
        QHBoxLayout* degreesLayout = new QHBoxLayout;
        getParentDegree(degreesLayout, degree);
        degreesLayout->insertStretch(-1);
        v1->addLayout(degreesLayout);
    }
    QHBoxLayout* deleteDegreeLayout = new QHBoxLayout;
    deleteDegree_ = new QComboBox;

    deleteDegree_->insertItem(0, "Choix du cursus");
    for(int i = 0; i < exp_->degrees().size(); i++)
    {
        deleteDegree_->insertItem(i + 1, exp_->degrees().at(i)->title());
    }

    QPushButton* deleteDegreeButton = new QPushButton("Supprimer le cursus");
    QObject::connect(deleteDegreeButton,SIGNAL(clicked()),this,SLOT(deleteDegree()));

    deleteDegreeLayout->addWidget(deleteDegree_);
    deleteDegreeLayout->insertStretch(-1);
    deleteDegreeLayout->addWidget(deleteDegreeButton);

    v1->addLayout(deleteDegreeLayout);

    v1->insertStretch(-1);

    QHBoxLayout* h4 = new QHBoxLayout;
    h4->addLayout(h2);
    h4->addLayout(h3);
    h4->insertStretch(-1);
    h4->addWidget(wantedDegrees);
    expLayout_->addLayout(h4);


    // Add semester
    QGroupBox* addSemesterBox = new QGroupBox;
    QVBoxLayout* v2 = new QVBoxLayout;
    addSemesterBox->setLayout(v2);
        // semester
    QLabel* seasonLabel = new QLabel("Semestre :");
    seasonBox_ = new QComboBox;
    seasonBox_->addItem("P");
    seasonBox_->addItem("A");
    QHBoxLayout* h6 = new QHBoxLayout;
    h6->addWidget(seasonLabel);
    h6->addWidget(seasonBox_);
        // date
    QLabel* yearLabel = new QLabel("Année :");
    yearBox_ = new QSpinBox;
    yearBox_->setValue(14);
    // button add
    QPushButton* addSemester = new QPushButton("Ajouter le semestre");
    QObject::connect(addSemester,SIGNAL(clicked()),this,SLOT(addSemester()));
    h6->addWidget(yearLabel);
    h6->addWidget(yearBox_);
    h6->addWidget(addSemester);
    h6->insertStretch(-1);

    v2->addLayout(h6);

    for(int i = 0; i < exp_->semesters().size(); i++)
    {
        QLabel* semester = new QLabel(exp_->semesters().at(i)->title());
        QHBoxLayout* h = new QHBoxLayout;
        h->addWidget(semester);
        h->insertStretch(-1);
        v2->addLayout(h);
    }

    semestersBox_ = new QComboBox;
    for(int i = 0; i < exp_->semesters().size(); i++)
    {
        semestersBox_->addItem(exp_->semesters().at(i)->title());
    }
    QPushButton* deleteSemester = new QPushButton("Supprimer le semestre");
    QObject::connect(deleteSemester,SIGNAL(clicked()),this,SLOT(deleteSemester()));
    QHBoxLayout* h7 = new QHBoxLayout;
    h7->addWidget(semestersBox_);
    h7->addWidget(deleteSemester);
    h7->insertStretch(-1);
    v2->addLayout(h7);


    expLayout_->addWidget(addSemesterBox);

    expLayout_->insertStretch(-1);

    updateWantedUvs();
    updateUnwantedUvs();
    loadSemesters();
}