Example #1
0
Controllers::Controllers(QGraphicsItem *parent) :
    Layer(parent),
    m_boundingRect(0,0,0,0)
{
    setFlag(QGraphicsItem::ItemHasNoContents);
    textItem = new QGraphicsTextItem(this);
    textItem->setPos(0,0);
    textItem->setDefaultTextColor(Qt::green);
    textItem->setZValue(1000);

    QPushButton * btPlus = new QPushButton("+");
    QPushButton * btMinus = new QPushButton("-");
    btPlus->resize(50,50);
    btMinus->resize(50,50);
    plusButtomItem =  new QGraphicsProxyWidget(this);
    minusButtomItem = new QGraphicsProxyWidget(this);
    plusButtomItem->setWidget(btPlus);
    minusButtomItem->setWidget(btMinus);

    plusButtomItem->setPos(10, 50);
    minusButtomItem->setPos(10,110);

    connect(btPlus, SIGNAL(clicked()), this, SLOT(onPlusPressed()));
    connect(btMinus, SIGNAL(clicked()), this, SLOT(onMinusPressed()));
}
Example #2
0
int main ( int argc, char *argv[] )
{
    QApplication app ( argc, argv );
    QPushButton hello ( "Hello world" );
    hello.resize ( 100, 30 );
    hello.show ();
    return app.exec ();
}
void CreateMsgButton(QMainWindow* window)
{
	QMessageBox* message = new QMessageBox(window);
	message->setText("Message text");
  
  	QPushButton* button = new QPushButton("Message", window);
	button->move(85, 40);
	button->resize(80, 25);
	button->show();
  	QObject::connect(button, SIGNAL(released()), message, SLOT(exec()));
}
Example #4
0
egx_wnd_t egx_pushbutton_create_(int res_id,char *name,egx_uint32_t style,int x,int y,int width,int height,egx_wnd_t parent)
{
	QPushButton *button = new QPushButton((QWidget*)(parent));
	button->setText(QString::fromLocal8Bit(name));
	if(x == 0 || y == 0){
		button->resize(width,height);
	}else{
		button->setGeometry(x,y,width,height);
	}
	return HWND_TO_GUIWND(button);
}
Example #5
0
void RunGame::updateImage()
{
    // 获得 widget 的大小
    int widgetWidth = ui->widget->width();
    int widgetHeight = ui->widget->height();

    // 获得图片可能的尺寸
    int imageWidth = widgetWidth / m_colNumber;
    int imageHeight = widgetHeight / m_rowNumber;

    // 使用最小的尺寸
    if (imageWidth > imageHeight)
    {
        imageWidth = imageHeight;
    }
    imageHeight = imageWidth;

    // 获得top与left坐标
    int x = (widgetWidth - imageWidth * m_colNumber) / 2;
    int y = (widgetHeight - imageHeight * m_rowNumber) / 2;

    m_imageBtnWidth = imageWidth;
    m_imageBtnHeight = imageHeight;
    m_imageBtnTop = y;
    m_imageBtnLeft = x;

    for (int i = 0; i < m_colNumber; i++)
    {
        for (int j = 0; j < m_rowNumber; j++)
        {
            int value = m_core.GetCell(j+1, i+1);
            if (CELL_NO_HAS_IMAGE != value)
            {
                QPushButton * btn = m_imageBtns[j*m_colNumber + i];
                btn->setFocusPolicy(Qt::NoFocus);
                btn->resize(QSize(imageWidth, imageHeight));
                btn->move(x + imageWidth * i, y + imageHeight * j);

                btn->setProperty(BTN_IMAGE_VALUE, value);
                QPixmap image;
                QString imageFile = QString("%1.png").arg(value);
                image.load(m_imageFileFamily + imageFile);
                btn->setIcon(image);
                btn->setIconSize(QSize(imageWidth - 6, imageHeight - 6));
                btn->show();
                connect(btn, SIGNAL(clicked()), this, SLOT(on_btn_image_clicked()));
            }
        }
    }

}
Example #6
0
int main(int argc, char *argv[])
{
  QApplication app(argc, argv);
//-----------------------
           QWidget MainWindows;
           MainWindows.setStyleSheet(
                                                    " QWidget   { font-size: 17px;  color :#65ED64; background-color: #777777;  border: 7px solid #64EB8D; }"
                                                  );
//-----------------------

           QLabel      *ptLabel         = new QLabel(&MainWindows);
           QPushButton *ptButton    = new QPushButton(&MainWindows);
           Counter     counter;

  ptLabel->move(25,25);
  ptLabel->setText(" T");
  ptLabel->resize(150,150);
  ptLabel->setStyleSheet(
                              "QLabel   { font-size: 80px;  color :#65ED64; background-color: #0C9F1D;  border: 7px solid #64EB8D; }"
                              );

  ptButton->move(180,25);
  ptButton->setText("  Add   ");
   ptButton->resize(150,150);
  ptButton->setStyleSheet(
                            "QPushButton   { font-size: 40px;  color :#65ED64; background-color: #0C9F1D;  border: 7px solid #64EB8D; }"
                             );
//  label.show();
//  button.show();

  QObject::connect(ptButton, SIGNAL(clicked()),
                   &counter, SLOT(slotInc())
                   );
  QObject::connect(&counter, SIGNAL(counterChanged(int)),
                   ptLabel, SLOT(setNum(int))
                   );
  QObject::connect(&counter, SIGNAL(goodbye()),
                   &app, SLOT(quit())
                   );

MainWindows.resize(350, 200);
MainWindows.show();

  return app.exec();
}
void ctkExampleDicomAppLogic::do_something()
{
  QPushButton *button = new QPushButton("Button from App");
  try
  {
    QRect preferred(50,50,100,100);
    qDebug() << "  Asking:getAvailableScreen";
    QRect rect = host->getAvailableScreen(preferred);
    qDebug() << "  got sth:" << rect.top();
    button->move(rect.topLeft());
    button->resize(rect.size());
  }
  catch (const std::runtime_error& e)
  {
    qCritical() << e.what();
  }
  button->show();
}
Example #8
0
//! [0]
int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    QPushButton button;
    QStateMachine machine;
//! [0]

//! [1]
    QState *off = new QState();
    off->assignProperty(&button, "text", "Off");
    off->setObjectName("off");

    QState *on = new QState();
    on->setObjectName("on");
    on->assignProperty(&button, "text", "On");
//! [1]

//! [2]
    off->addTransition(&button, SIGNAL(clicked()), on);
    on->addTransition(&button, SIGNAL(clicked()), off);
//! [2]

//! [3]
    machine.addState(off);
    machine.addState(on);
//! [3]

//! [4]
    machine.setInitialState(off);
    machine.start();
//! [4]

//! [5]
#if defined(Q_OS_SYMBIAN)
    button.showMaximized();
#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
    button.show();
#else
    button.resize(100, 50);
    button.show();
#endif
    return app.exec();
}
Example #9
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    //luncher w;
    //w.show();

    QPushButton quit ("Quit");

    quit.resize(130,80);

    quit.setFont(QFont("Comic Sans Ms",15, QFont::Bold , QFont::italic()));

    QObject::connect(&quit , SIGNAL(clicked()), &a, SLOT(quit()));


    quit.show();

    
    return a.exec(); //code retour de l'application. nécessaire
}
// add a button
QPushButton *
QTACDraw::addButton (QString text)
{
    QFont fnt;
    QPushButton *btn;
    QString stylesheet;

    stylesheet =
        "background: transparent; border: 1px solid transparent;border-color: darkgray;";

    btn = new QPushButton (text, this);
    btn->resize (button_width, button_height);
    fnt = btn->font ();
    fnt.setPixelSize (16);
    fnt.setBold (true);
    btn->setFont (fnt);
    btn->setStyleSheet (stylesheet);
    btn->setAutoFillBackground (false);
    btn->setFocusPolicy (Qt::NoFocus);
    Button += btn;
    return btn;
}
Example #11
0
// QTabBar::setTabButton(index, closeSide, closeButton);
void tst_QTabBar::tabButton()
{
    QFETCH(QTabBar::ButtonPosition, position);
    QTabBar::ButtonPosition otherSide = (position == QTabBar::LeftSide ? QTabBar::RightSide : QTabBar::LeftSide);

    QTabBar tabbar;
    tabbar.resize(500, 200);
    tabbar.show();
    QTRY_VERIFY(tabbar.isVisible());

    tabbar.setTabButton(-1, position, 0);
    QVERIFY(tabbar.tabButton(-1, position) == 0);
    QVERIFY(tabbar.tabButton(0, position) == 0);

    tabbar.addTab("foo");
    QCOMPARE(tabbar.count(), 1);
    tabbar.setTabButton(0, position, 0);
    QVERIFY(tabbar.tabButton(0, position) == 0);

    QPushButton *button = new QPushButton;
    button->show();
    button->setText("hi");
    button->resize(10, 10);
    QTRY_VERIFY(button->isVisible());
    QTRY_VERIFY(button->isVisible());

    tabbar.setTabButton(0, position, button);

    QCOMPARE(tabbar.tabButton(0, position), static_cast<QWidget *>(button));
    QTRY_VERIFY(!button->isHidden());
    QVERIFY(tabbar.tabButton(0, otherSide) == 0);
    QCOMPARE(button->parent(), static_cast<QObject *>(&tabbar));
    QVERIFY(button->pos() != QPoint(0, 0));

    QPushButton *button2 = new QPushButton;
    tabbar.setTabButton(0, position, button2);
    QVERIFY(button->isHidden());
}
Example #12
0
//! [0]
int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    QPushButton button;
    QStateMachine machine;
//! [0]

//! [1]
    QState *off = new QState();
    off->assignProperty(&button, "text", "Off");
    off->setObjectName("off");

    QState *on = new QState();
    on->setObjectName("on");
    on->assignProperty(&button, "text", "On");
//! [1]

//! [2]
    off->addTransition(&button, SIGNAL(clicked()), on);
    on->addTransition(&button, SIGNAL(clicked()), off);
//! [2]

//! [3]
    machine.addState(off);
    machine.addState(on);
//! [3]

//! [4]
    machine.setInitialState(off);
    machine.start();
//! [4]

//! [5]
    button.resize(100, 50);
    button.show();
    return app.exec();
}
void CConfigJogDialog::initLayout(void)
{
    static const char *strLut[] = {
        "JointVelocity",
        "JointAcceleration",
        "ServoVelocity",
        "ServoAcceleration",
        "LinearVelocity",
        "LinearAcceleration",
        "VelocityRatio"
    };
    static const char *unitLut[] = {
        "°/s",
        "°/(s·s)",
        "°/s",
        "°/(s·s)",
        "mm/s",
        "mm/(s·s)",
        "%"
    };
    static const char *toolTipLut[] = {
        "Velocity of single joint",
        "Acceleration of single joint",
        "Velocity of the servo",
        "Acceleration of the servo",
        "Velocity of single axis",
        "Acceleration of single axis",
        "Ratio of the velocity"
    };

    QFont font("微软雅黑", 8);

    COptions::JogParams jogParams;
    COptions::instance()->getJogParams(&jogParams);
    float *params = (float *)&jogParams;

    int i = 0;
    for (i = 0; i < 6; i++) {
        QLabel *label = new QLabel(this);
        label->move(10, 10 + i * 40);
        label->resize(150, 30);
        label->setFont(font);
        label->setText(strLut[i]);

        QLineEdit *lineEdit = new QLineEdit(this);
        lineEdit->move(180, 10 + i * 40);
        lineEdit->resize(100, 30);
        lineEdit->setFont(font);
        lineEdit->setToolTip(toolTipLut[i]);
        lineEdit->setText(QString("%1").arg(params[i]));
        paramWidgetList << lineEdit;

        label = new QLabel(this);
        label->move(300, 10 + i * 40);
        label->resize(50, 20);
        label->setFont(font);
        label->setText(unitLut[i]);
    }

    QPushButton *sendBtn = new QPushButton(this);
    sendBtn->move(280, 10 + i * 40);
    sendBtn->resize(120, 50);
    sendBtn->setFont(font);
    sendBtn->setText("Send");
    connect(sendBtn, SIGNAL(clicked()), this, SLOT(onSendBtnClicked()));
}
Example #14
0
void AvatarEditor::RebuildEditView()
{
    if (!avatar_widget_)
        return;

    // Activate/deactivate export button based on whether export currently supported
    QPushButton *button = avatar_widget_->findChild<QPushButton *>("but_export");
    if (button)
        button->setEnabled(rexlogicmodule_->GetAvatarHandler()->AvatarExportSupported());

    QWidget* mat_panel = avatar_widget_->findChild<QWidget *>("panel_materials");
    QWidget* attachment_panel = avatar_widget_->findChild<QWidget *>("panel_attachments");
    if (!mat_panel || !attachment_panel)
        return;

    Scene::EntityPtr entity = rexlogicmodule_->GetAvatarHandler()->GetUserAvatar();
    if (!entity)
        return;
    EC_AvatarAppearance* appearance = entity->GetComponent<EC_AvatarAppearance>().get();
    if (!appearance)
        return;

    int width = 308-10;
    int tab_width = 302-10;
    int itemheight = 20;

    // Materials
    ClearPanel(mat_panel);
    const AvatarMaterialVector& materials = appearance->GetMaterials();
    mat_panel->resize(width, itemheight * (materials.size() + 1));

    for (uint y = 0; y < materials.size(); ++y)
    {
        QPushButton* button = new QPushButton("Change", mat_panel);
        button->setObjectName(QString::fromStdString(ToString<int>(y))); // Material index
        button->resize(50, 20);
        button->move(width - 50, y*itemheight);
        button->show();

        QObject::connect(button, SIGNAL(clicked()), this, SLOT(ChangeTexture()));
        // If there's a texture name, use it, because it is probably more understandable than material name
        std::string texname = materials[y].asset_.name_;
        if (materials[y].textures_.size())
            texname = materials[y].textures_[0].name_;

        QLabel* label = new QLabel(QString::fromStdString(texname), mat_panel);
        label->resize(200,20);
        label->move(0, y*itemheight);
        label->show();
    }

    // Attachments
    ClearPanel(attachment_panel);
    const AvatarAttachmentVector& attachments = appearance->GetAttachments();
    attachment_panel->resize(width, itemheight * (attachments.size() + 1));

    for (uint y = 0; y < attachments.size(); ++y)
    {
        QPushButton* button = new QPushButton("Remove", attachment_panel);
        button->setObjectName(QString::fromStdString(ToString<int>(y))); // Attachment index
        button->resize(50, 20);
        button->move(width - 50, y*itemheight);
        button->show();

        QObject::connect(button, SIGNAL(clicked()), this, SLOT(RemoveAttachment()));

        std::string attachment_name = attachments[y].name_;
        // Strip away .xml from the attachment name for slightly nicer display
        std::size_t pos = attachment_name.find(".xml");
        if (pos != std::string::npos)
            attachment_name = attachment_name.substr(0, pos);

        QLabel* label = new QLabel(QString::fromStdString(attachment_name), attachment_panel);
        label->resize(200,20);
        label->move(0, y*itemheight);
        label->show();
    }

    // Modifiers
    QTabWidget* tabs = avatar_widget_->findChild<QTabWidget *>("tab_appearance");
    if (!tabs)
        return;
    for (;;)
    {
        QWidget* tab = tabs->widget(0);
        if (!tab)
            break;
        tabs->removeTab(0);
        delete tab;
    }

    const MasterModifierVector& master_modifiers = appearance->GetMasterModifiers();
    // If no master modifiers, show the individual morph/bone controls
    if (!master_modifiers.size())
    {
        QWidget* morph_panel = GetOrCreateTabScrollArea(tabs, "Morphs");
        QWidget* bone_panel = GetOrCreateTabScrollArea(tabs, "Bones");
        if (!morph_panel || !bone_panel)
            return;

        const BoneModifierSetVector& bone_modifiers = appearance->GetBoneModifiers();
        const MorphModifierVector& morph_modifiers = appearance->GetMorphModifiers();
        morph_panel->resize(tab_width, itemheight * (morph_modifiers.size() + 1));
        bone_panel->resize(tab_width, itemheight * (bone_modifiers.size() + 1));

        for (uint i = 0; i < bone_modifiers.size(); ++i)
        {
            QScrollBar* slider = new QScrollBar(Qt::Horizontal, bone_panel);
            slider->setObjectName(QString::fromStdString(bone_modifiers[i].name_));
            slider->setMinimum(0);
            slider->setMaximum(100);
            slider->setPageStep(10);
            slider->setValue(bone_modifiers[i].value_ * 100.0f);
            slider->resize(150, 20);
            slider->move(tab_width - 150, i * itemheight);
            slider->show();

            QObject::connect(slider, SIGNAL(valueChanged(int)), this, SLOT(BoneModifierValueChanged(int)));

            QLabel* label = new QLabel(QString::fromStdString(bone_modifiers[i].name_), bone_panel);
            label->resize(100,20);
            label->move(0, i * itemheight);
            label->show();
        }

        for (uint i = 0; i < morph_modifiers.size(); ++i)
        {
            QScrollBar* slider = new QScrollBar(Qt::Horizontal, morph_panel);
            slider->setObjectName(QString::fromStdString(morph_modifiers[i].name_));
            slider->setMinimum(0);
            slider->setMaximum(100);
            slider->setPageStep(10);
            slider->setValue(morph_modifiers[i].value_ * 100.0f);
            slider->resize(150, 20);
            slider->move(tab_width - 150, i * itemheight);
            slider->show();

            QObject::connect(slider, SIGNAL(valueChanged(int)), this, SLOT(MorphModifierValueChanged(int)));

            QLabel* label = new QLabel(QString::fromStdString(morph_modifiers[i].name_), morph_panel);
            label->resize(100,20);
            label->move(0, i * itemheight);
            label->show();
        }
    }
Example #15
0
Piano::Piano(QWidget *parent) :
    QWidget(parent)
{
    init_log();
    QPalette Pal(palette());
    Pal.setColor(QPalette::Background, QColor::fromRgb(240, 240, 240));
    setAutoFillBackground(true);
    setPalette(Pal);

    showing = false; //displaying the scorebox

    b_names_dip = false;
    b_racc_disp = false;
    notes = new QVector<Touche*>();
    notes_jouees = new QVector<QString>();
    setFixedSize(800, 310);

    QPushButton *raccButt= new QPushButton(QString(""),this);
    raccButt->setToolTip(QString("Affiche les raccourcis clavier pour le piano"));
    QPushButton *noteNames = new QPushButton(QString(""),this);
    noteNames->setToolTip(QString("Affiche le nom des notes sur le piano"));

    QCheckBox *checkB = new QCheckBox(QString("options affichage"),this);
    checkB->setToolTip(QString("Affiche/cache les options d'affiche du piano"));
    QPushButton *retour = new QPushButton(QString(""),this);
    checkB->setChecked(true);
    retour->move(740,0);
    retour->setStyleSheet("border-image: url(:/new/prefix1/undo.png)");
    retour->setToolTip(QString("Annule la dernière note jouée"));
    retour->resize(50,50);
    QPushButton *solution = new QPushButton(QString("Solution"),this);
    solution->setToolTip(QString("Aide: Indique la note suivante sur le piano"));
    solution->move(0,10);
    checkB->move(0,282);
    Touche* doM = new Touche(this, QString("tab"),QString("Do"));
    int sizeT= 38;//doM->width();
    //QMessageBox::information(new QWidget(),QString("taille "),QString::number(sizeT));

    int hauteur = 100;
    int nT =3;
    raccButt->move(0,hauteur+50);
    raccButt->setFixedSize(140,50);
    raccButt->setStyleSheet("border-image: url(:/img/clavier.svg.png);"
                            );



    noteNames->move(660,hauteur +50);
    noteNames->setFixedSize(140,50);
    noteNames->setStyleSheet("border-image: url(:/img/doremi);"
                            "border-width: 2px;");

    doM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* reM = new Touche(this, QString("A"),QString("Ré"));
    reM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* miM = new Touche(this, QString("Z"),QString("Mi"));
    miM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* faM = new Touche(this, QString("E"),QString("Fa"));
    faM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* solM = new Touche(this, QString("R"),QString("Sol"));
    solM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* laM = new Touche(this, QString("T"),QString("La"));
    laM->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* siM = new Touche(this, QString("Y"),QString("si"));
    siM->move(sizeT*nT,hauteur);
    nT+=1;

    Touche* dom = new Touche(this, QString("U"),QString("Do"));
    dom->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* rem = new Touche(this, QString("I"),QString("Ré"));
    rem->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* mim = new Touche(this, QString("O"),QString("Mi"));
    mim->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* fam = new Touche(this, QString("P"),QString("Fa"));
    fam->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* solm = new Touche(this, QString(/*"dead_circumflex"*/"16781906"),QString("Sol"));
    solm->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* lam = new Touche(this, QString("$"),QString("La"));
    lam->move(sizeT*nT,hauteur);
    nT+=1;
    Touche* sim = new Touche(this, QString("Return"),QString("si"));
    sim->move(sizeT*nT,hauteur);


    nT=4;


    Touche* doMD = new Touche(this, QString("&"),QString("Do#"));
    doMD->black();
    doMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* reMD = new Touche(this, QString("é"),QString("Ré#"));
    reMD->black();
    reMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=2;
    Touche* faMD = new Touche(this, QString("'"),QString("Fa#"));
    faMD->black();
    faMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* solMD = new Touche(this, QString("("),QString("Sol#"));
    solMD->black();
    solMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* laMD = new Touche(this, QString("-"),QString("La#"));
    laMD->black();
    laMD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=2;

    Touche* domD = new Touche(this, QString("_"),QString("Do#"));
    domD->black();
    domD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* remD = new Touche(this, QString("ç"),QString("Ré#"));
    remD->black();
    remD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=2;
    Touche* famD = new Touche(this, QString(")"),QString("Fa#"));
    famD->black();
    famD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* solmD = new Touche(this, QString("="),QString("Sol#"));
    solmD->black();
    solmD->move(sizeT*nT-sizeT/4,hauteur);
    nT+=1;
    Touche* lamD = new Touche(this, QString("Backspace"),QString("La#"));
    lamD->black();
    lamD->move(sizeT*nT-sizeT/4,hauteur);







     QObject::connect(doM, SIGNAL(clicked()), this, SLOT(play_doM()));notes->append(doM);
     QObject::connect(reM, SIGNAL(clicked()), this, SLOT(play_reM()));notes->append(reM);
     QObject::connect(miM, SIGNAL(clicked()), this, SLOT(play_miM()));notes->append(miM);
     QObject::connect(faM, SIGNAL(clicked()), this, SLOT(play_faM()));notes->append(faM);
     QObject::connect(solM, SIGNAL(clicked()), this, SLOT(play_solM()));notes->append(solM);
     QObject::connect(laM, SIGNAL(clicked()), this, SLOT(play_laM()));notes->append(laM);
     QObject::connect(siM, SIGNAL(clicked()), this, SLOT(play_siM()));notes->append(siM);

     QObject::connect(dom, SIGNAL(clicked()), this, SLOT(play_dom()));notes->append(dom);
     QObject::connect(rem, SIGNAL(clicked()), this, SLOT(play_rem()));notes->append(rem);
     QObject::connect(mim, SIGNAL(clicked()), this, SLOT(play_mim()));notes->append(mim);
     QObject::connect(fam, SIGNAL(clicked()), this, SLOT(play_fam()));notes->append(fam);
     QObject::connect(solm, SIGNAL(clicked()), this, SLOT(play_solm()));notes->append(solm);
     QObject::connect(lam, SIGNAL(clicked()), this, SLOT(play_lam()));notes->append(lam);
     QObject::connect(sim, SIGNAL(clicked()), this, SLOT(play_sim()));notes->append(sim);

     QObject::connect(doMD, SIGNAL(clicked()), this, SLOT(play_doMD()));notes->append(doMD);
     QObject::connect(reMD, SIGNAL(clicked()), this, SLOT(play_reMD()));notes->append(reMD);

     QObject::connect(faMD, SIGNAL(clicked()), this, SLOT(play_faMD()));notes->append(faMD);
     QObject::connect(solMD, SIGNAL(clicked()), this, SLOT(play_solMD()));notes->append(solMD);
     QObject::connect(laMD, SIGNAL(clicked()), this, SLOT(play_laMD()));notes->append(laMD);

     QObject::connect(domD, SIGNAL(clicked()), this, SLOT(play_domD()));notes->append(domD);
     QObject::connect(remD, SIGNAL(clicked()), this, SLOT(play_remD()));notes->append(remD);

     QObject::connect(famD, SIGNAL(clicked()), this, SLOT(play_famD()));notes->append(famD);
     QObject::connect(solmD, SIGNAL(clicked()), this, SLOT(play_solmD()));notes->append(solmD);
     QObject::connect(lamD, SIGNAL(clicked()), this, SLOT(play_lamD()));notes->append(lamD);


     QObject::connect(raccButt, SIGNAL(clicked()), this, SLOT(display_racc()));
     QObject::connect(noteNames, SIGNAL(clicked()), this, SLOT(display_names()));
     QObject::connect(checkB, SIGNAL(toggled(bool)), this, SLOT(checking(bool)));
     QObject::connect(retour, SIGNAL(clicked()), this, SLOT(retour_arriere()));



}
void ProgressListDelegate::updateItemWidgets(const QList<QWidget*> widgets,
        const QStyleOptionViewItem &option,
        const QPersistentModelIndex &index) const
{
    if (!index.isValid()) {
        return;
    }

    QPushButton *pauseResumeButton = static_cast<QPushButton*>(widgets[0]);

    QPushButton *cancelButton = static_cast<QPushButton*>(widgets[1]);
    cancelButton->setToolTip(i18n("Cancel"));

    QProgressBar *progressBar = static_cast<QProgressBar*>(widgets[2]);
    QPushButton *clearButton = static_cast<QPushButton*>(widgets[3]);

    int percent = d->getPercent(index);

    cancelButton->setVisible(percent < 100);
    pauseResumeButton->setVisible(percent < 100);
    clearButton->setVisible(percent > 99);

    KJob::Capabilities capabilities = (KJob::Capabilities) index.model()->data(index, JobView::Capabilities).toInt();
    cancelButton->setEnabled(capabilities & KJob::Killable);
    pauseResumeButton->setEnabled(capabilities & KJob::Suspendable);


    JobView::JobState state = (JobView::JobState) index.model()->data(index, JobView::State).toInt();
    switch (state) {
    case JobView::Running:
        pauseResumeButton->setToolTip(i18n("Pause"));
        pauseResumeButton->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-pause")));
        break;
    case JobView::Suspended:
        pauseResumeButton->setToolTip(i18n("Resume"));
        pauseResumeButton->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start")));
        break;
    default:
        Q_ASSERT(0);
        break;
    }

    QSize progressBarButtonSizeHint;



    if (percent < 100) {
        QSize cancelButtonSizeHint = cancelButton->sizeHint();

        cancelButton->move(option.rect.width() - d->separatorPixels - cancelButtonSizeHint.width(),
                           option.rect.height() - d->separatorPixels - cancelButtonSizeHint.height());

        QSize pauseResumeButtonSizeHint = pauseResumeButton->sizeHint();


        pauseResumeButton->move(option.rect.width() - d->separatorPixels * 2 - pauseResumeButtonSizeHint.width() - cancelButtonSizeHint.width(),
                                option.rect.height() - d->separatorPixels - pauseResumeButtonSizeHint.height());

        progressBarButtonSizeHint = pauseResumeButtonSizeHint;
    } else {
        progressBarButtonSizeHint = clearButton->sizeHint();
        clearButton->resize(progressBarButtonSizeHint);

        clearButton->move(option.rect.width() - d->separatorPixels - progressBarButtonSizeHint.width(),
                          option.rect.height() - d->separatorPixels - progressBarButtonSizeHint.height());
    }
    progressBar->setValue(percent);

    QFontMetrics fm(QApplication::font());
    QSize progressBarSizeHint = progressBar->sizeHint();

    progressBar->resize(QSize(option.rect.width() - d->getCurrentLeftMargin(fm.height()) - d->rightMargin, progressBarSizeHint.height()));

    progressBar->move(d->getCurrentLeftMargin(fm.height()),
                      option.rect.height() - d->separatorPixels * 2 - progressBarButtonSizeHint.height() - progressBarSizeHint.height());
}