AboutDialog::AboutDialog(QWidget *p, AboutDialogOptions options) : QDialog(p) { setWindowTitle(tr("About Murmur")); setMinimumSize(QSize(400, 300)); QTabWidget *qtwTab = new QTabWidget(this); QVBoxLayout *vblMain = new QVBoxLayout(this); QTextEdit *qteLicense = new QTextEdit(qtwTab); qteLicense->setReadOnly(true); qteLicense->setPlainText(License::license()); QTextEdit *qteAuthors = new QTextEdit(qtwTab); qteAuthors->setReadOnly(true); qteAuthors->setPlainText(License::authors()); QTextBrowser *qtb3rdPartyLicense = new QTextBrowser(qtwTab); qtb3rdPartyLicense->setReadOnly(true); qtb3rdPartyLicense->setOpenExternalLinks(true); QList<LicenseInfo> thirdPartyLicenses = License::thirdPartyLicenses(); foreach(LicenseInfo li, thirdPartyLicenses) { qtb3rdPartyLicense->append(QString::fromLatin1("<h3>%1 (<a href=\"%2\">%2</a>)</h3><pre>%3</pre>") .arg(Qt::escape(li.name)) .arg(Qt::escape(li.url)) .arg(Qt::escape(li.license))); }
// ---------------------------------------------------------------------- //->setWindowFlags(Qt::Window | Qt::WindowTitleHint); //->setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint); // ---------------------------------------------------------------------- void WxMain::slotActivHelp(){ // QString str = ((QPushButton*)sender())->text(); // if (str == tr("Справка")){ QTextEdit *txt = new QTextEdit; txt->setReadOnly(true); txt->setHtml( tr("<HTML>" "<BODY>" "<H2><CENTER> Справка </CENTER></H2>" "<P ALIGN=\"left\">" "<BR>" "<BR>" "<BR>" "</P>" "<H3><CENTER> Версия 1.2 </CENTER></H3>" "<H4><CENTER> Октябрьь 2013 </CENTER></H4>" "<H4><CENTER> Широков О.Ю. </CENTER></H4>" "<BR>" "</BODY>" "</HTML>" )); txt->resize(250, 200); txt->show(); // "<BODY BGCOLOR=MAGENTA>" // "<FONT COLOR=BLUE>" // "</FONT>" // } // qDebug() << tr("Справка"); return; }// End slot
void About::aboutInit() { setModal(true); resize(400, 400); setWindowTitle("About"); setWindowIcon(QIcon("icons/backupsoft.png")); QWidget *icon = new QWidget(this); icon->setStyleSheet("background-image: url(icons/backupsoft.png)"); icon->setGeometry(250 , 10, 100, 100); QLabel *title = new QLabel("BackupSoft", this); title->setFont(QFont("Helvetica", 25, 10, false)); title->setGeometry(10, 10, 200, 30); QLabel *version = new QLabel("Copyright 2010 by\nMichael Kohler and Fabian Gammenthaler\n\nVersion: 1.0", this); version->setFont(QFont("Helvetica", 8, 2, false)); version->setGeometry(10, 70, 200, 55); QTextEdit *licence = new QTextEdit(this); licence->setGeometry(10, 160, 380, 230); licence->setReadOnly(true); QFile *file = new QFile("licence.txt"); if (file->open(QIODevice::ReadOnly)) { QTextStream *stream = new QTextStream(file); licence->setText(stream->readAll()); } else { QString errorMsg = "Could not open licence.txt.. Please make sure it is existent and readable."; AlertWindow *alertWin = new AlertWindow("ERROR", "", errorMsg); alertWin->show(); } }
QWidget* AboutBox::createLicensePanel() { // Create a label to display readme.txt QTextEdit* label = new QTextEdit(); label->setReadOnly(true); QString fileName(QString::fromUtf8(m_gleInterface->getManualLocation().c_str())); fileName.resize(fileName.lastIndexOf(QDir::separator())); fileName += QDir::separator(); fileName += tr("LICENSE.txt"); GLEInterface* iface = GLEGetInterfacePointer(); std::string licenseFileTxt; bool res = iface->readFileOrGZIPTxt(fileName.toUtf8().constData(), &licenseFileTxt); if (res) { QFont font; // Set the font to be fixed pitch font.setFixedPitch(true); font.setFamily("Courier"); font.setStretch(QFont::Condensed); label->setLineWrapMode(QTextEdit::NoWrap); label->setFont(font); label->setTextColor(Qt::black); // Get the text and put it in the label label->setPlainText(licenseFileTxt.c_str()); QFontMetrics fm(font); m_minWidth = fm.width("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); } else { label->setPlainText(tr("File not found: '%1'").arg(fileName)); } return label; }
void UpgradeMessage::createPage031 () { QWidget *w = new QWidget(this); QVBoxLayout *vbox = new QVBoxLayout(w); vbox->setMargin(5); vbox->setSpacing(5); QString s = tr("This version of Qtstalker uses a new data format."); s.append(tr(" It can not read data files from previous versions.")); s.append(tr(" This means that you will start with an empty workspace.")); s.append(tr(" Your old data files have been preserved in $HOME/Qtstalker")); s.append(tr(" and can still be accessed by older Qtstalker versions.")); s.append(tr(" If you don't intend to downgrade to a previous Qtstalker")); s.append(tr(" version, then you can remove that directory.")); QTextEdit *message = new QTextEdit(w); message->setReadOnly(TRUE); message->setText(s); vbox->addWidget(message); check = new QCheckBox(tr("Do not show this message again."), w); vbox->addWidget(check); addTab(w, tr("Warning")); setOkButton(tr("&OK")); setCancelButton(tr("&Cancel")); }
void CellWidget::setLayoutItems(int num) { QVBoxLayout* layout = (QVBoxLayout*) this->layout(); if(m_numLayoutItems < num) { m_checkers.resize(num); m_editors.resize(num); for(int i = m_numLayoutItems; i < num; i++) { QCheckBox* checker = new QCheckBox(); QTextEdit* editor = new QTextEdit(); editor->setReadOnly(true); editor->setFixedHeight(20); editor->setFixedWidth(120); QHBoxLayout* child_layout = new QHBoxLayout(); child_layout->addWidget(checker); child_layout->addWidget(editor); layout->addLayout(child_layout); m_checkers[i] = checker; m_editors[i] = editor; } } else if(m_numLayoutItems > num) { for(int i = num ; i < m_numLayoutItems; i++) { m_checkers[i]->setHidden(true); //m_checkers[i]->setChecked(false); m_editors[i]->setHidden(true); } } m_numLayoutItems = num; }
AboutBox::AboutBox(QWidget* parent) : QDialog(parent) { resize( 500,300); QTextEdit* content = new QTextEdit(); content->setReadOnly(true); QString txt = "<h1>Evilpixie</h1>" "version 0.2<br/><br/>" "By Ben Campbell ([email protected])<br/><br/>" "Licensed under GPLv3<br/>" "Homepage: <a href=\"http://evilpixie.scumways.com\">http://evilpixie.scumways.com</a><br/>" "Source: <a href=\"http://github.com/bcampbell/evilpixie\">http://github.com/bcampbell/evilpixie</a>"; content->setHtml(txt); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); connect(buttonBox, SIGNAL(accepted()), this, SLOT(hide())); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(content); mainLayout->addWidget(buttonBox); setLayout(mainLayout); setWindowTitle(tr("About EvilPixie")); }
HelpWindow::HelpWindow() { resize( 600,500); QTextEdit* content = new QTextEdit(); content->setReadOnly(true); { QFile file( JoinPath(g_App->DataPath(), "help.html").c_str() ); if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { QString help_txt; help_txt = file.readAll(); content->setHtml(help_txt); } } QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok); connect(buttonBox, SIGNAL(accepted()), this, SLOT(hide())); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(content); mainLayout->addWidget(buttonBox); setLayout(mainLayout); setWindowTitle(tr("Help")); }
ShowTextDlg::ShowTextDlg(const QString &fname, bool rich, QWidget *parent, const char *name) :QDialog(parent, name, FALSE, WDestructiveClose) { QString text; QFile f(fname); if(f.open(IO_ReadOnly)) { QTextStream t(&f); while(!t.eof()) text += t.readLine() + '\n'; f.close(); } QVBoxLayout *vb1 = new QVBoxLayout(this, 8); QTextEdit *te = new QTextEdit(this); te->setReadOnly(TRUE); te->setTextFormat(rich ? QTextEdit::RichText : QTextEdit::PlainText); te->setText(text); vb1->addWidget(te); QHBoxLayout *hb1 = new QHBoxLayout(vb1); hb1->addStretch(1); QPushButton *pb = new QPushButton(tr("&OK"), this); connect(pb, SIGNAL(clicked()), SLOT(accept())); hb1->addWidget(pb); hb1->addStretch(1); resize(560, 384); }
void MainWindow::aboutLicense() { QDialog *dialog = new QDialog( this ); QFile file( ":/GPL" ); if(!file.open( QIODevice::ReadOnly | QIODevice::Text )) qCritical( "GPL LicenseFile not found" ); QTextStream out ( &file ); out.setFieldAlignment ( QTextStream::AlignCenter ); QTextEdit *qteLicense = new QTextEdit ( dialog ); qteLicense->setText ( out.readAll ()); qteLicense->setReadOnly ( 1 ); QPushButton *qpbClose = new QPushButton ( IconLoader::Load( "window-close" ), tr( "&Close" ), dialog ); connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( deleteLater())); qglDialog = new QGridLayout( dialog ); qglDialog->addWidget( qteLicense, 0, 0 ); qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight ); dialog->setLayout( qglDialog); dialog->setWindowTitle( "GNU General Public License" ); dialog->setFixedSize( 550, 400 ); dialog->exec(); }
StepPreviewDialog::StepPreviewDialog(const Step *_target, QWidget *parent) : QDialog(parent), ui(new Ui::StepPreviewDialog) { ui->setupUi(this); QTextEdit *textWidget; QPixmap pic; QLabel *disp; // set the preview widget in accordance to the type switch(_target->Type) { case Step::Text: case Step::Console: textWidget = new QTextEdit(_target->TextContent); textWidget->setReadOnly (true); ui->verticalLayout->addWidget (textWidget, 1); textWidget->show (); break; case Step::Screenshot: pic = QPixmap::fromImage (QImage(_target->ScreenshotPath)); disp = new QLabel(); disp->size ().setHeight (250); disp->size ().setWidth (430); ui->verticalLayout->addWidget (disp, 1); disp->show(); disp->setPixmap (pic.scaled(disp->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation)); break; default: break; } }
void FQTermImageOrigin::showFullExifInfo() { QString exifInfo = QString::fromStdString(exifExtractor_->extractExifInfo(model_->filePath(tree_->currentIndex()).toLocal8Bit().data())); QString comment; if ((*exifExtractor_)["UserComment"].length() > 8) { QString commentEncoding = QString::fromStdString((*exifExtractor_)["UserComment"].substr(0, 8)); if (commentEncoding.startsWith("UNICODE")) { //UTF-16 QTextCodec* c = QTextCodec::codecForName("UTF-16"); comment = c->toUnicode((*exifExtractor_)["UserComment"].substr(8).c_str()); } else if (commentEncoding.startsWith("JIS")) { //JIS X 0208 QTextCodec* c = QTextCodec::codecForName("JIS X 0208"); comment = c->toUnicode((*exifExtractor_)["UserComment"].substr(8).c_str()); } else { comment = QString::fromStdString((*exifExtractor_)["UserComment"].substr(8)); } } QTextEdit* info = new QTextEdit; info->setText(exifInfo + tr("Comment : ") + comment + "\n"); info->setWindowFlags(Qt::Dialog); info->setAttribute(Qt::WA_DeleteOnClose); info->setAttribute(Qt::WA_ShowModal); // info->setLineWrapMode(QTextEdit::NoWrap); info->setReadOnly(true); QFontMetrics fm(font()); info->resize(fm.width("Orientation : 1st row - 1st col : top - left side "), fm.height() * 20); info->show(); }
//слот - создание нового корабля void MyServer::slotNewShip(){ deleteShipButton->setEnabled(false); //создание корабля ShipItemStruct* ship = new ShipItemStruct; ship->isNew=1; shipList.append(ship); //если это первый корабль if(!shipCounter){ QTextEdit *txt = (QTextEdit*) txtStack->widget(0); txt->append("Ship created"); //shipCounter++; timer->start(500); // TIMER } //если не первый корабль else{ //создаем новый лог QTextEdit *txt = new QTextEdit; txt->setReadOnly(true); txt->append("Ship created"); txtStack->addWidget(txt); nextButton->setEnabled(true); } shipCounter++; }
void AboutDialog::displayFile(const QString &fileName, const QString &title) { QDialog *dialog = new QDialog(this); QLayout *layout = new QVBoxLayout(dialog); QTextEdit *textEdit = new QTextEdit(dialog); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, dialog); textEdit->setStyleSheet(QLatin1String("font-family: monospace")); QFile file(fileName); if (file.open(QIODevice::ReadOnly)) { QString text = QTextStream(&file).readAll(); textEdit->setPlainText(text); } textEdit->setReadOnly(true); connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(close())); buttonBox->setCenterButtons(true); layout->addWidget(textEdit); layout->addWidget(buttonBox); layout->setMargin(6); dialog->setLayout(layout); dialog->setWindowTitle(title); dialog->setWindowFlags(Qt::Sheet); dialog->resize(600, 350); dialog->exec(); }
void GOpcodeAAA::initUI(void){ QLabel* plblAAA = new QLabel("<h1><strong><center>aaa</center></strong></h1>"); QHBoxLayout* phblGeneral = new QHBoxLayout(); phblGeneral->addWidget(plblAAA); QString info_str = "Производит символьную коррекцию результата двоичного сложения байтовых ASCII-чисел," " который содержится в аккумуляторе AL.\n" "Сложение ASCII-чисел производится в два этапа: сначала байты суммируются как обычные двоичные числа," " а затем осуществляется коррекция по следующим правилам:\n" "\t1) Если младшая тетрада AL меньше или равна десятичному числу 9 и флажок AF=0, то переход к шагу 3.\n" "\t2) Если младшая тетрада AL больше десятичного числа 9 и флажок AF=1, то к содержимому AL прибавляется" " число 6, к содержимому регистра AH прибавляется единица, а флажок AF устанавливается в 1.\n" "\t3) Сбрасывается старшая тетрада аккумулятора AL.\n" "\t4) Флажок CF устанавливается в то же состояние, что и флажок AF.\n" "Флажки CF и AF устанавливаются в 1, если результат суммирования больше числа 9. " "Состояние остальных флажков не определено."; QTextEdit* info = new QTextEdit(); info->setText(info_str); info->setReadOnly(true); QVBoxLayout* pvblGeneral = new QVBoxLayout(); pvblGeneral->addWidget(info); pvblGeneral->addLayout(phblGeneral); setLayout(pvblGeneral); }
void GOpcodeAAS::initUI(void){ QLabel* plblAAS = new QLabel("<h1><strong><center>aas</center></strong></h1>"); QHBoxLayout* phblGeneral = new QHBoxLayout(); phblGeneral->addWidget(plblAAS); QString info_str = "Производит символьную коррекцию результата двоичного вычитания байтовых ASCII-чисел, " "который содержится в регистре AL.\n" "Вычитание производится в два этапа: сначала осуществляется вычитание как для обычных двоичных чисел, " "а затем результат корректируется по следующим правилам:\n" "\t1) Если младшая тетрада AL меньше или равна десятичному числу 9 и флажое AF=0, то переход к шагу 3.\n" "\t2) Если младшая тетрада AL больше десятичного числа 9 и флажок AF=1, то из содержимого AL вычитается 6, " " из содержимого AH вычитается единица, а флажок AF устанавливается в 1.\n" "\t3) Сбрасывается старшая тетрада аккумулятора AL.\n" "\t4) Флажок CF устанавливается в то же состояние, что и флажок AF.\n" "Флажки AF и CF устанавливаются в 1, если вычитаемое больше уменьшаемого (AF и CF интерпретируются как флажки заема). \n" "Состояние остальных флажков не определено.\n" "Вычитание ASCII-чисел с повышенной точностью похоже на двоичную арифметику с повышенной точностью, но после каждого " "байтового вычитания необходимо производить символьную коррекцию"; QTextEdit* info = new QTextEdit(); info->setText(info_str); info->setReadOnly(true); QVBoxLayout* pvblGeneral = new QVBoxLayout(); pvblGeneral->addWidget(info); pvblGeneral->addLayout(phblGeneral); setLayout(pvblGeneral); }
CadCommandWidget::CadCommandWidget() { // widgets QLineEdit *lEdit = new QLineEdit; QTextEdit *tEdit = new QTextEdit; QWidget *w = new QWidget; // labels QLabel *lLabel = new QLabel("Enter Command:"); QLabel *tLabel = new QLabel("Command History:"); // layouts QHBoxLayout *hBox = new QHBoxLayout; QVBoxLayout *vBox1 = new QVBoxLayout; QVBoxLayout *vBox2 = new QVBoxLayout; // setting properties tEdit->setReadOnly(true); vBox1->addWidget(lLabel); vBox1->addWidget(lEdit); vBox2->addWidget(tLabel); vBox2->addWidget(tEdit); hBox->addLayout(vBox1); hBox->addLayout(vBox2); w->setLayout(hBox); setWidget(w); }
RKReadLineDialog::RKReadLineDialog (QWidget *parent, const QString &caption, const QString &prompt, RCommand *command) : KDialogBase (parent, 0, true, caption, KDialogBase::Ok | KDialogBase::Cancel) { RK_TRACE (DIALOGS); RK_ASSERT (command); QVBox *page = makeVBoxMainWidget (); new QLabel (caption, page); int screen_width = qApp->desktop ()->width () - 2*marginHint() - 2*spacingHint (); // TODO is this correct on xinerama? QString context = command->fullOutput (); if (!context.isEmpty ()) { new QLabel (i18n ("Context:"), page); QTextEdit *output = new QTextEdit (page); output->setUndoRedoEnabled (false); output->setTextFormat (QTextEdit::PlainText); output->setCurrentFont (QFont ("Courier")); output->setWordWrap (QTextEdit::NoWrap); output->setText (context); output->setReadOnly (true); int cwidth = output->contentsWidth (); output->setMinimumWidth (screen_width < cwidth ? screen_width : cwidth); output->scrollToBottom (); output->setFocusPolicy (QWidget::NoFocus); } QLabel *promptl = new QLabel (prompt, page); promptl->setAlignment (Qt::WordBreak | promptl->alignment ()); input = new QLineEdit (QString (), page); input->setMinimumWidth (fontMetrics ().maxWidth ()*20); input->setFocus (); }
void GOpcodeNEG::initUI(void){ m_pleOp = new QLineEdit(); m_pleOp->setAlignment(Qt::AlignCenter); QLabel* plblNEG = new QLabel("<h1><strong>neg</strong></h1>"); QHBoxLayout* phblGeneral = new QHBoxLayout(); phblGeneral->addStretch(); phblGeneral->addWidget(plblNEG); phblGeneral->addWidget(m_pleOp); phblGeneral->addStretch(); QString info_str = "Изменяет знак операнда образованием дополнительного кода. Если операнд " "равен нулю, его значение не изменяется.\n" "Команда модифицирует все арифметические флажки. Флажок CF всегда устанавливается в " "нулевое состояние, за исключением случая, конда операнд равен нулю, - тогда CF=0."; QTextEdit* info = new QTextEdit(); info->setText(info_str); info->setReadOnly(true); QVBoxLayout* pvblGeneral = new QVBoxLayout(); pvblGeneral->addWidget(info); pvblGeneral->addLayout(phblGeneral); setLayout(pvblGeneral); }
void GOpcodeCMP::initUI(void){ m_pleOp1 = new QLineEdit(); m_pleOp2 = new QLineEdit(); m_pleOp1->setAlignment(Qt::AlignCenter); m_pleOp2->setAlignment(Qt::AlignCenter); QLabel* plblCMP = new QLabel("<h1><strong>cmp</strong></h1>"); QLabel* plblComma = new QLabel("<h1><strong>,</strong></h1>"); QHBoxLayout* phblGeneral = new QHBoxLayout(); phblGeneral->addStretch(); phblGeneral->addWidget(plblCMP); phblGeneral->addWidget(m_pleOp1); phblGeneral->addWidget(plblComma); phblGeneral->addWidget(m_pleOp2); phblGeneral->addStretch(); QString info_str = "Производит сравнение операндов, вычитая из первого операнда второй. При этом " "операнды остаются без изменения.\n" "Устанавливает флажки CF, AF, SF, ZF, PF, OF в соответствии с результатом операции. Причем " "флажки CF и AF становятся флажками заема и устанавливаются в 1, если вычитаемое больше уменьшаемого.\n" "При сравнении чисел повышенной точности, проще использовать команды вычитания SUB и SBB."; QTextEdit* info = new QTextEdit(); info->setText(info_str); info->setReadOnly(true); QVBoxLayout* pvblGeneral = new QVBoxLayout(); pvblGeneral->addWidget(info); pvblGeneral->addLayout(phblGeneral); setLayout(pvblGeneral); }
aboutDialog::aboutDialog() : QDialog( engine::mainWindow() ), Ui::AboutDialog() { setupUi( this ); iconLabel->setPixmap( embed::getIconPixmap( "icon", 64, 64 ) ); versionLabel->setText( versionLabel->text(). arg( LMMS_VERSION ). arg( PLATFORM ). arg( MACHINE ). arg( QT_VERSION_STR ). arg( GCC_VERSION ) ); authorLabel->setPlainText( embed::getText( "AUTHORS" ) ); licenseLabel->setPlainText( embed::getText( "COPYING" ) ); QString contText = embed::getText( "CONTRIBUTORS" ); if ( contText.length() >= 2 ) { QWidget *widget = new QWidget(); QVBoxLayout *layout = new QVBoxLayout(); QTextEdit *contWidget = new QTextEdit(); contWidget->setReadOnly(true); contWidget->setText( contText ); layout->addWidget( new QLabel( tr("Contributors ordered by number of commits:"), this ) ); layout->addWidget( contWidget ); widget->setLayout( layout ); tabWidget->insertTab( 2, widget, tr("Involved") ); } }
void MainWindow::on_actionHelp_triggered() { // generic help QTextEdit *pTxt = new QTextEdit(this); pTxt->setWindowFlags(Qt::Window); //or Qt::Tool, Qt::Dialog if you like pTxt->setReadOnly(true); pTxt->append("qPicView by Ilkka Prusi 2011"); pTxt->append(""); pTxt->append("This program is free to use and distribute. No warranties of any kind."); pTxt->append("Program uses Qt 4.7.1 under LGPL v. 2.1"); pTxt->append(""); pTxt->append("Keyboard shortcuts:"); pTxt->append(""); pTxt->append("* = resize/fit"); pTxt->append("+ = zoom in"); pTxt->append("- = zoom out"); pTxt->append("Left = previous"); pTxt->append("Right = next"); pTxt->append("Up/Down = scroll"); pTxt->append(""); pTxt->append("F = open file"); pTxt->append("F1 = help (this)"); pTxt->append("F11 = fullscreen toggle"); pTxt->append("Esc = close"); pTxt->append(""); pTxt->append("Tip: set as default program :)"); pTxt->show(); }
LicenseDialog::LicenseDialog(QWidget *parent) :QDialog(parent, Qt::WindowCloseButtonHint) { QFile file(QLatin1String(":/traceshark/LICENSE")); if (!file.open(QIODevice::ReadOnly)) qDebug() << "Warning, could not read license!\n"; QTextStream textStream(&file); QString text = textStream.readAll(); QTextEdit *textEdit = new QTextEdit(); textEdit->setAcceptRichText(false); textEdit->setPlainText(text); textEdit->setReadOnly(true); textEdit->setLineWrapMode(QTextEdit::NoWrap); QVBoxLayout *vlayout = new QVBoxLayout; setLayout(vlayout); vlayout->addWidget(textEdit); QHBoxLayout *hlayout = new QHBoxLayout; vlayout->addLayout(hlayout); hlayout->addStretch(); QPushButton *button = new QPushButton(tr("OK")); hlayout->addWidget(button); hlayout->addStretch(); setModal(true); updateSize(); hide(); tsconnect(button, clicked(), this, hide()); }
void ChatWindow::connecte() { ui->splitter->show(); Serveur *serveur = new Serveur; QTextEdit *textEdit = new QTextEdit; ui->hide3->hide(); ui->tab->addTab(textEdit, "Console/PM"); ui->tab->setTabToolTip(ui->tab->count() - 1, "irc.freenode.net"); // current tab is now the last, therefore remove all but the last for (int i = ui->tab->count(); i > 1; --i) { ui->tab->removeTab(0); } serveurs.insert("irc.freenode.net", serveur); serveur->pseudo = ui->editPseudo->text(); serveur->serveur = "irc.freenode.net"; serveur->port = 6667; serveur->affichage = textEdit; serveur->tab = ui->tab; serveur->userList = ui->userView; serveur->parent = this; textEdit->setReadOnly(true); connect(serveur, SIGNAL(joinTab()), this, SLOT(tabJoined())); connect(serveur, SIGNAL(tabJoined()), this, SLOT(tabJoining())); serveur->connectToHost("irc.freenode.net", 6667); ui->tab->setCurrentIndex(ui->tab->count() - 1); }
void GOpcodeSBB::initUI(void){ m_pleOp1 = new QLineEdit(); m_pleOp2 = new QLineEdit(); m_pleOp1->setAlignment(Qt::AlignCenter); m_pleOp2->setAlignment(Qt::AlignCenter); QLabel* plblSBB = new QLabel("<h1><strong>sbb</strong></h1>"); QLabel* plblComma = new QLabel("<h1><strong>,</strong></h1>"); QHBoxLayout* phblGeneral = new QHBoxLayout(); phblGeneral->addStretch(); phblGeneral->addWidget(plblSBB); phblGeneral->addWidget(m_pleOp1); phblGeneral->addWidget(plblComma); phblGeneral->addWidget(m_pleOp2); phblGeneral->addStretch(); QString info_str = "Производит вычитание второго операнда из первого. Из полученной разности вычитается " "значение флажка CF, установленного предыдущими операциями. Полученный результат заносится на " "место первого операнда.\n" "Устанавливает флажки CF, AF, SF, ZF, PF, OF в соответствии с результатом операции. Причем " "флажки CF и AF становятся флажками заема и устанавливаются в 1, если вычитаемое больше уменьшаемого.\n" "Наличие заема и переполнение определяется по тем же признакам, что и для команды SUB.\n" "Команда SBB используется при вычитании с повышенной точностью, т.к. учитывает заем."; QTextEdit* info = new QTextEdit(); info->setText(info_str); info->setReadOnly(true); QVBoxLayout* pvblGeneral = new QVBoxLayout(); pvblGeneral->addWidget(info); pvblGeneral->addLayout(phblGeneral); setLayout(pvblGeneral); }
// ============================================================================ // Help button handler void GameUIMain::on_buttonHelp_clicked() { QString help = "Controls\n\n" "Mouse Up/Down\t- elevator\n" "Mouse Wheel\t- throttle\n" "Mouse Left Button\t- fire gun\n" "Mouse Right Button\t- release bomb\n" "Page Up/Page Down\t- zoom in/out\n" "F/V\t- flaps\n" "Space\t- flip/turn\n" "B\t- wheel brake\n" "A\t- toggle autopilot\n" "P\t- pause"; GameUIDialog* pHelpDialog = new GameUIDialog( scene() ); pHelpDialog->setWindowFlags( Qt::WindowSystemMenuHint | pHelpDialog->windowFlags() ); pHelpDialog->setWindowTitle( "Help" ); pHelpDialog->setLayout( new QVBoxLayout ); pHelpDialog->setSizeGripEnabled( true ); connect( this, SIGNAL(destroyed()), pHelpDialog, SLOT(deleteLater()) ); QTextEdit *pHelp = new QTextEdit( pHelpDialog ); pHelpDialog->layout()->addWidget( pHelp ); pHelp->setText( help ); pHelp->setReadOnly( true ); scene()->addWindow( pHelpDialog, 1.0 ); pHelpDialog->setFocus(); }
void StartupView::showDetailsForItem( const QModelIndex & index ) { QLayout * layout = m_projectDetailView->layout(); for( int i = 0; i < layout->count(); i++ ) { delete layout->itemAt(i)->widget(); layout->removeItem(layout->itemAt(i)); } QString name = m_templateListModel->data(index,Qt::ToolTipRole).toString(); QString description = m_templateListModel->data(index,Qt::WhatsThisRole).toString(); if( ! name.isEmpty() ) { QLabel * nameLabel = new QLabel(name); nameLabel->setStyleSheet("QLabel { font: bold }"); layout->addWidget(nameLabel); } if( ! description.isEmpty() ) { QTextEdit * descriptionLabel = new QTextEdit(description); descriptionLabel->setStyleSheet("QTextEdit { border: none; }"); descriptionLabel->setReadOnly(true); layout->addWidget(descriptionLabel); } }
void GOpcodeJMP::initUI(void){ m_pleOp = new QLineEdit(); m_pleOp->setAlignment(Qt::AlignCenter); QLabel* plblJMP = new QLabel("<h1><strong>jmp</strong></h1>"); QHBoxLayout* phblGeneral = new QHBoxLayout(); phblGeneral->addStretch(); phblGeneral->addWidget(plblJMP); phblGeneral->addWidget(m_pleOp); phblGeneral->addStretch(); QString info_str = "Осуществляет безусловный переход, модифицируя указатель команд IP " "(при переходе типа NEAR) или пару регистров CS:IP (при переходе типа FAR).\n" "Старое значение регистров IP и CS теряется.\n" "Регистр флажков не модифицируется."; QTextEdit* info = new QTextEdit(); info->setText(info_str); info->setReadOnly(true); QVBoxLayout* pvblGeneral = new QVBoxLayout(); pvblGeneral->addWidget(info); pvblGeneral->addLayout(phblGeneral); setLayout(pvblGeneral); }
void MainWindow::aboutCredits() { QDialog *dialog = new QDialog( this ); QTextEdit *qteCreditsWritten = new QTextEdit( dialog ); qteCreditsWritten->setReadOnly( 1 ); qteCreditsWritten->setLineWrapMode( QTextEdit::NoWrap ); qteCreditsWritten->setText( "Tim Kleinschmidt <*****@*****.**>" ); QTextEdit *qteCreditsArtwork = new QTextEdit( dialog ); qteCreditsArtwork->setReadOnly( 1 ); qteCreditsArtwork->setLineWrapMode( QTextEdit::NoWrap ); qteCreditsArtwork->setText( "Elementary Theme\n" ); QTabWidget *qtwCredits = new QTabWidget( dialog ); qtwCredits->addTab( qteCreditsWritten, tr( "Written by" )); qtwCredits->addTab( qteCreditsArtwork, tr( "Artwork by" )); qtwCredits->setElideMode( Qt::ElideRight ); QPushButton *qpbClose = new QPushButton( IconLoader::Load( "window-close"), tr( "&Close" ), dialog ); connect( qpbClose, SIGNAL( clicked()), dialog, SLOT( close())); qglDialog = new QGridLayout( dialog ); qglDialog->addWidget( qtwCredits, 0, 0,Qt::AlignCenter ); qglDialog->addWidget( qpbClose, 1, 0, Qt::AlignRight ); dialog->setWindowTitle( tr( "Credits" )); dialog->setLayout( qglDialog ); dialog->setFixedSize( 250, 200 ); dialog->exec(); }
BTAboutModuleDialog::BTAboutModuleDialog(QWidget* parent, CSwordModuleInfo* info) : QDialog(parent) { //Set the flag to destroy when closed - otherwise eats memory setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("Information About") + QString(" ") + info->name()); resize(650, 400); QVBoxLayout* vboxLayout = new QVBoxLayout(this); QTextEdit* textEdit = new QTextEdit(this); textEdit->setReadOnly(true); textEdit->setTextInteractionFlags(Qt::TextSelectableByMouse); vboxLayout->addWidget(textEdit); textEdit->setHtml(info->aboutText()); QDialogButtonBox* buttonBox = new QDialogButtonBox(this); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Close); vboxLayout->addWidget(buttonBox); QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); }