예제 #1
0
xMemFinder::xMemFinder(QWidget* p):QDialog(p) {
	ui.setupUi(this);

	connect(ui.leBytes, SIGNAL(textEdited(QString)),this,SLOT(onBytesEdit()));
	connect(ui.leText, SIGNAL(textEdited(QString)),this,SLOT(onTextEdit()));
	connect(ui.pbFind, SIGNAL(clicked(bool)),this,SLOT(doFind()));
}
예제 #2
0
WizTitleEdit::WizTitleEdit(QWidget *parent)
    : QLineEdit(parent)
    , c(NULL)
    , m_separator('@')
{    
    setContentsMargins(0, 0, 0, 0);
    setAlignment(Qt::AlignLeft | Qt::AlignBottom);
    setAttribute(Qt::WA_MacShowFocusRect, false);
    setFrame(false);

    connect(this, SIGNAL(returnPressed()), SLOT(onTitleReturnPressed()));
    connect(this, SIGNAL(editingFinished()), SLOT(onTitleEditingFinished()));
    connect(this, SIGNAL(textEdited(QString)), SLOT(onTextEdit(QString)));
    connect(this, SIGNAL(textChanged(QString)), SLOT(onTextChanged(QString)));
    QFont f = font();
    f.setPixelSize(WizSmartScaleUI(14));
    setFont(f);
}
예제 #3
0
파일: Area.cpp 프로젝트: GrasJulien/appli
Area::Area(QWidget *parent, QString path) :
    QWidget(parent)
{
    this->path = path;

    // call the constructors of all the areas
    this->textArea = new TextArea(this);
    this->textArea->setReadOnly(false);
    this->myArea = new MyArea(this, this->path);
    this->treeArea = new TreeArea(this);
    this->indicatorEdit = new TextArea(this);
    this->listOldText = new QStringList();

    //Add text coloration (lie le TextArea)
    colorerSequences = new ColorerSequences(textArea->document());

    // treeArea: create widgets containing the buttons
    this->treeButtonArea = new QWidget(this);
    this->treeButtonArea->setMinimumWidth(12);
    this->treeButtonArea->setMaximumWidth(12);
    this->textButtonArea = new QWidget(this);
    this->textButtonArea->setMinimumWidth(12);
    this->textButtonArea->setMaximumWidth(12);

    // create the buttons
    this->leftButton = new QPushButton("<", this->treeButtonArea);
    this->leftButton->setMaximumWidth(12);
    this->leftButton->setMinimumHeight(70);
    QVBoxLayout *layoutLeft = new QVBoxLayout;
    layoutLeft->addWidget(leftButton);
    layoutLeft->setContentsMargins(0,0,0,0);
    this->treeButtonArea->setLayout(layoutLeft);

    this->rightButton = new QPushButton(">", this->textButtonArea);
    this->rightButton->setMaximumWidth(12);
    this->rightButton->setMinimumHeight(70);
    this->rightExpandButton = new QPushButton("<", this->textButtonArea);
    this->rightExpandButton->setMaximumWidth(12);
    this->rightExpandButton->setMinimumHeight(70);
    QVBoxLayout *layoutRight = new QVBoxLayout;
    layoutRight->addWidget(this->rightButton);
    layoutRight->addWidget(this->rightExpandButton);
    layoutRight->setContentsMargins(0,0,0,0);
    this->textButtonArea->setLayout(layoutRight);

    this->saveTextEdit = new QPushButton("Update",this);
    this->saveTextEdit->setFixedSize(QSize(80,30));
    this->saveTextEdit->setVisible(false);
    this->saveTextEdit->setEnabled(false);
    this->saveTextEdit->setShortcut(QKeySequence((Qt::CTRL + Qt::Key_E)));

    this->cancelTextEdit = new QPushButton("Cancel",this);
    this->cancelTextEdit->setFixedSize(QSize(80,30));
    this->cancelTextEdit->setVisible(false);
    this->cancelTextEdit->setEnabled(false);

    //indicatorEdit preferences

    this->indicatorEdit->setReadOnly(true);
    this->indicatorEdit->changeBackgroundColor(QColor("#F1F1F1"));
    this->indicatorEdit->setFixedSize(QSize(200,27));
    this->indicatorEdit->setTextColor(QColor(228,26,4));
    this->indicatorEdit->setCurrentFont(QFont("TypeWriter",10));
    this->indicatorEdit->setFontWeight(5);
    this->indicatorEdit->setFrameShape(QTextEdit::NoFrame);
    this->indicatorEdit->setFrameShadow(QTextEdit::Plain);
    this->indicatorEdit->setPlainText("Edition...");
    this->indicatorEdit->setVisible(false);
    //Press CTRL+E to save or CTRL+ESC to cancel

    // set the global layout
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(this->treeArea);
    layout->addWidget(this->treeButtonArea);
    layout->addWidget(this->myArea);
    layout->addWidget(this->textButtonArea);

    QVBoxLayout *VLayout = new QVBoxLayout;
    VLayout->addWidget(this->indicatorEdit);
    VLayout->addWidget(this->textArea);

    QHBoxLayout *options = new QHBoxLayout;
    options->addWidget(this->saveTextEdit);
    options->addWidget(this->cancelTextEdit);

    VLayout->addLayout(options);

    QHBoxLayout *global = new QHBoxLayout;
    global->addLayout(layout);
    global->addLayout(VLayout);

    this->setLayout(global);

    // connect
    QObject::connect(this->leftButton, SIGNAL(clicked()), this, SLOT(hideOrShowTree()));
    QObject::connect(this->rightButton, SIGNAL(clicked()), this, SLOT(hideOrShowText()));
    QObject::connect(this->rightExpandButton, SIGNAL(clicked()), this, SLOT(expandOrReduceText()));
    QObject::connect(this->cancelTextEdit, SIGNAL(clicked()), this, SLOT(cancelEdit()));
    QObject::connect(this->textArea, SIGNAL(textChanged()), this->textArea, SLOT(onTextEdit()));
    QObject::connect(this->saveTextEdit, SIGNAL(clicked()), this, SLOT(saveEdit()));
    QObject::connect(this->textArea, SIGNAL(textChanged()), this, SLOT(onTextEdit()));    
    QObject::connect(this, SIGNAL(edition()), this, SLOT(showToolTip()));
    QObject::connect(this, SIGNAL(makeTempXML()), this, SLOT(tempXMLfile()));

    // initialization
    this->textArea->setHidden(true);
    this->rightButton->setText("<");
    this->rightExpandButton->hide();
    this->saveTextEdit->setDefault(false);
    this->cancelTextEdit->setDefault(false);
}