MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    setCentralWidget( ui->textEdit );
    ui->textEdit->setAcceptDrops( false );
    setAcceptDrops( true );

    _defaultTitle = windowTitle();

    ui->textEdit->setStyleSheet( "selection-color: white; selection-background-color: #3399ff;" );

    _pageSetupDialog = new QPageSetupDialog( this );

    connect( ui->textEdit, SIGNAL( undoAvailable( bool ) ),
             ui->action_Undo, SLOT( setEnabled( bool ) ) );
    connect( ui->textEdit, SIGNAL( redoAvailable(bool) ),
             ui->action_Redo, SLOT( setEnabled( bool ) ) );

    ui->textEdit->undoAvailable( false );
    ui->textEdit->redoAvailable( false );

    connect( ui->textEdit, SIGNAL( copyAvailable( bool ) ),
             ui->action_Trim, SLOT( setEnabled( bool ) ) );
    connect( ui->textEdit, SIGNAL( copyAvailable( bool ) ),
             ui->action_Copy, SLOT( setEnabled( bool ) ) );
    connect( this, SIGNAL( pasteAvailable( bool ) ),
             ui->action_Paste, SLOT( setEnabled( bool ) ) );
    connect( ui->textEdit, SIGNAL( copyAvailable( bool ) ),
             ui->action_deL, SLOT( setEnabled( bool ) ) );

    ui->textEdit->copyAvailable( false );

    _Initialize_rightClickMenu();

    _searchDialog = new SearchDialog( this, ui->textEdit );

    connect( ui->action_lineWrap, SIGNAL( toggled( bool ) ),
             ui->action_Goto, SLOT( setDisabled( bool ) ) );
    connect( ui->action_lineWrap, SIGNAL( toggled( bool ) ),
             ui->action_Statusbar, SLOT( setDisabled( bool ) ) );

    ui->statusBar->setHidden( true );
    _statusLabel = new QLabel;
    ui->statusBar->addPermanentWidget( _statusLabel );

    on_textEdit_cursorPositionChanged();
    on_textEdit_textChanged();

    _About = new About( this );
}
Exemple #2
0
QLayout *playlistItemText::createTextController(QWidget *parentWidget)
{
  Q_UNUSED(parentWidget);

  // Absolutely always only call this function once!
  assert(!controlsCreated);

  ui.setupUi( propertiesWidget );
  
  // Set the text
  ui.textEdit->setPlainText(text);
    
  on_textEdit_textChanged();

  // Connect signals
  connect(ui.selectFontButton, SIGNAL(clicked()), this, SLOT(on_selectFontButton_clicked()));
  connect(ui.selectColorButton, SIGNAL(clicked()), this, SLOT(on_selectColorButton_clicked()));
  connect(ui.textEdit, SIGNAL(textChanged()), this, SLOT(on_textEdit_textChanged()));

  controlsCreated = true;
  return ui.topVBoxLayout;
}
Exemple #3
0
int Dialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: on_textEdit_textChanged(); break;
        case 1: on_pushButton_clicked(); break;
        case 2: on_pushButton_2_clicked(); break;
        case 3: on_label_linkActivated((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}
Exemple #4
0
 void DeppointCardPage::connectDataAwareWidgets()
 {
   
   typedef QWidgetList::const_iterator const_iterator;
   
   for (const_iterator it = dataAwareWidgets_.begin(), end = dataAwareWidgets_.end(); it != end; ++it)
   {
     QWidget* widget = *it;        
     if (QLineEdit* edit = qobject_cast<QLineEdit*>(widget))
     {
       QObject::connect(edit, SIGNAL(textEdited(const QString&)), SLOT(on_lineEdit_textEdited(const QString&)));
     }
     else if (QTextEdit* edit = qobject_cast<QTextEdit*>(widget))
     {
       QObject::connect(edit, SIGNAL(textChanged()), SLOT(on_textEdit_textChanged()));
     }
   }
 }
Exemple #5
0
void BankCardPage::connectDataAwareWidgets(const QWidgetList& widgets)
{  
  typedef QWidgetList::const_iterator const_iterator;
      
  for (const_iterator i = widgets.begin(), end = widgets.end(); i != end; ++i)
  {
    QWidget* widget = *i;        
    if (QLineEdit* edit = qobject_cast<QLineEdit*>(widget))
    {
      QObject::connect(edit, SIGNAL(textEdited(const QString&)), 
          SLOT(on_lineEdit_textEdited(const QString&)));
    }
    else if (QTextEdit* edit = qobject_cast<QTextEdit*>(widget))
    {
      QObject::connect(edit, SIGNAL(textChanged()), 
          SLOT(on_textEdit_textChanged()));
    }
  }
}
InfoTemplate::InfoTemplate(QWidget *parent) :
    QWidget(parent)
{
    widget1 = new QWidget();
    widget2 = new QWidget();
    widget3 = new QWidget();

    // widget 1 initialization

    QVBoxLayout* widget1_vlayout=  new QVBoxLayout(widget1);
    QHBoxLayout* widget1_vlayout_hlayout = new QHBoxLayout();
    qDebug()<<"2";

    addButton = new QPushButton("Add");
    lineEdit = new QLineEdit();
    removeButton = new QPushButton("Remove");

    widget1_vlayout_hlayout->addWidget(lineEdit);
    widget1_vlayout_hlayout->addWidget(addButton);

    itemList = new QListWidget();

    widget1_vlayout->addLayout(widget1_vlayout_hlayout);
    widget1_vlayout->addWidget(itemList);
    widget1_vlayout->addWidget(removeButton);

    // widget 2 initialization

    QVBoxLayout* widget2_vlayout=  new QVBoxLayout(widget2);
    textEdit = new QPlainTextEdit();


    qDebug()<<"3";
    widget2_vlayout->addWidget(textEdit);

    // widget 3 initialization
    phoneBody = new QLabel(widget3);
    QVBoxLayout* widget3_vlayout=  new QVBoxLayout(widget3);


    phoneBody->setFixedSize(327,639);
    phoneBody->setStyleSheet("background-image: url(:/images/phone.png)");

    phoneWidget = new QStackedWidget(phoneBody);
    phoneWidget->setStyleSheet("background: black; color: white; font-size: 30px");
    phoneWidget->setGeometry(30,95,270,447);

    backButton = new QPushButton("<-");
    backButton->setFixedWidth(phoneWidget->width());

    generateButton = new QPushButton("Generate Application");
    generateButton->setFixedWidth(phoneWidget->width());

    widget3_vlayout->addWidget(phoneBody);
    widget3_vlayout->addWidget(backButton);
    widget3_vlayout->addWidget(generateButton);

    screen1 = new QWidget();
    screen2 = new QWidget();
    phoneWidget->addWidget(screen1);
    phoneWidget->addWidget(screen2);

    itemList_phone = new QListWidget(screen1);
    itemList_phone->setStyleSheet( "QListWidget::item { color: white; border-bottom: 0.5px solid #333333; }") ;
    itemList_phone->setFixedSize(phoneWidget->size());


    textLabel_phone= new QLabel(screen2);
    textLabel_phone->setFixedSize(phoneWidget->size());
    textLabel_phone->setAlignment(Qt::AlignTop);
//    textLabel_phone->setStyleSheet("background: yellow");
    textLabel_phone->setFixedSize(phoneWidget->size());
    textLabel_phone->setStyleSheet("background: black; color: white; font-size: 20px");
    textLabel_phone->setWordWrap(true);

    phoneWidget->setCurrentIndex(0);

    ///
    QHBoxLayout* hlayout = new QHBoxLayout(this);

    hlayout->addWidget(widget1);
    hlayout->addWidget(widget2);
    hlayout->addWidget(widget3);




    iProcess = new QProcess(this);

    // Signal and slots

    connect(addButton, SIGNAL(clicked()), this, SLOT(on_addButton_cicked()));
    connect(removeButton, SIGNAL(clicked()), this, SLOT(on_removedButton_cicked()));
    connect(itemList, SIGNAL(currentRowChanged(int)), this, SLOT(on_itemList_selected()));
    connect(textEdit, SIGNAL(textChanged()), this, SLOT(on_textEdit_textChanged()));
    connect(backButton, SIGNAL(clicked()), this, SLOT(on_backButton_clicked()));
    connect(itemList_phone, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(on_itemList_phone_selected()));
    connect(generateButton, SIGNAL(clicked()), this, SLOT(on_generateButton_clicked()));
}
void MainWindow::on_spinBoxFontHeight_valueChanged(int)
{
    on_textEdit_textChanged();
    send_textedit_text();
}