当前位置: 首页>>代码示例>>C++>>正文


C++ QTextEdit::setGeometry方法代码示例

本文整理汇总了C++中QTextEdit::setGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextEdit::setGeometry方法的具体用法?C++ QTextEdit::setGeometry怎么用?C++ QTextEdit::setGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTextEdit的用法示例。


在下文中一共展示了QTextEdit::setGeometry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: aboutInit

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();
  }
}
开发者ID:MichaelKohler,项目名称:BackupSoft,代码行数:34,代码来源:about.cpp

示例2: newTab

void Gui::newTab(QListWidgetItem *_item)
{
	for (int i = 0; i < _tabs->count(); ++i)
        if (_tabs->tabText(i) == _item->text()) return;
    QTextEdit *outputArea = new QTextEdit;
    outputArea->setReadOnly(true);
	_outputAreas.append(outputArea);
	outputArea->setGeometry(0,0,395,230);
    _tabs->addTab(outputArea,_item->text());
}
开发者ID:suratovvlad,项目名称:videostream,代码行数:10,代码来源:gui_qt.cpp

示例3: privateMessage

void Gui::privateMessage(const QString &receiver, const QString &message)
{
#ifdef DEBUG
	qDebug() << "You got the private message";
#endif
	QTextEdit* outputArea = NULL;
	bool isNeededTab = false;
	for (int i = 0; i < _tabs->count(); ++i)
		if (_tabs->tabText(i) == receiver) 
		{
			_outputAreas.at(i)->append(receiver + ": " + message);
			isNeededTab = true;
			break;
		}
	if (isNeededTab) return;
	outputArea = new QTextEdit;
	outputArea->setReadOnly(true);
	_tabs->addTab(outputArea, receiver);
	_outputAreas.append(outputArea);
	outputArea->setGeometry(0,0,395,230);
	outputArea->append(receiver + ": " + message);
}
开发者ID:suratovvlad,项目名称:videostream,代码行数:22,代码来源:gui_qt.cpp

示例4: initDisplay


//.........这里部分代码省略.........
    LAYOUT(time_x, time_y, 0, vs);
    tw->layout  << CELL(0,0) << CELL(0,1) << CELL(0,2) << CELL(0,3);
    tw->objName = "Seconds";
    tw->objText << "10" << "10" << "25" << "30";
    tw->sizes   << QSize(box_w, box_h);
    tw->connect = false;
    pTimes      = new TEditGroup <QLineEdit>(tw, this);
    for(index = 0; index < pTimes->widgetList.size(); index++)
        pTimes->widgetList[index]->setInputMask("00");

    // Layout the Grade Level radiobuttons.
    //
    tw = new Twidget;
    int gl_x = time_x + box_w + hs - 10;
    int gl_y = time_y;
    LAYOUT(gl_x, gl_y, 0, vs);
    tw->layout << CELL(0,0) << CELL(0,1) << CELL(0,2) << CELL(0,3);
    tw->sizes << QSize(box_w - 10, box_h);
    tw->objText << "1" << "2" << "3" <<"4";
    tw->connect = true;
    tw->grouped = true;
    pGradeLevel = new TButtonGroup <QRadioButton>(tw, this);
    pGradeLevel->widgetList[gl_3]->setChecked(true);
    connect(pGradeLevel->buttonGroup, SIGNAL(buttonClicked(int)),
            this, SLOT(onGradeLevel(int)));

    // Layout the UserName box and its label
    //
    int userName_x = tests_x;
    int userName_y = tests_y + text_h + (4 * vs);
    int userNameEd_x = userName_x + text_w;
    int userNameEd_w = 250;
    userNameLabel = new QLabel(this);
    userNameLabel->setGeometry(userName_x, userName_y, text_w, text_h);
    userNameLabel->setText("Your Name:");
    userNameEdit = new QLineEdit(this);
    userNameEdit->setGeometry(userNameEd_x, userName_y, userNameEd_w, box_h);
    userNameEdit->setText("");
    userNameEdit->setCursorPosition(0);
    connect(userNameEdit, SIGNAL(returnPressed()), this, SLOT(onUserName()));

    // Create and connect the Start button.
    // Because this pushbutton's parent is QDialog, it will have its
    // autoDefault property set when instantiated. This can cause some very
    // confusing behavior if you don't know this. See "autoDefault" in the
    // QPushButton class reference. We will explicitly set this property
    // to FALSE for this button, and also set its "default" property to
    // FALSE.
    //
    const int pbw = 100;
    const int pbhs = 110;
    int goButton_x = tests_x+10;
    int goButton_y = userName_y + vs + 6;
    goButton = new QPushButton("Start", this);
    goButton->setGeometry(goButton_x, goButton_y, pbw, box_h);
    goButton->setAutoDefault(false);
    goButton->setDefault(false);
    connect(goButton, SIGNAL(clicked()), this, SLOT(onGo()));

    // Create and connect the stop button.
    //
    int stopButton_x = goButton_x + pbhs;
    int stopButton_y = goButton_y;
    stopButton = new QPushButton("Stop", this);
    stopButton->setGeometry(stopButton_x, stopButton_y, pbw, box_h);
    stopButton->setAutoDefault(false);
开发者ID:TemanS,项目名称:mathtest,代码行数:67,代码来源:mathtest.cpp


注:本文中的QTextEdit::setGeometry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。