int main(int argc, char *argv[])
{
MainWindow w;
w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
w.setStyleSheet("background-color: Black;");
w.startcomthread();
w.show();
txt->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
txt->setFocus();
txt->setStyleSheet("background-color: rgb(255, 255, 255,200);");
txt->setGeometry(10,20,100,30);
txt->setText("Text 1");
Qt::LeftButton,
Qt::LeftButton,
Qt::NoModifier);
Qt::LeftButton,
Qt::LeftButton,
Qt::NoModifier);
txt->show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
w.setStyleSheet("background-color: Black;");
w.startcomthread();
w.show();
QTextEdit *txt = new QTextEdit();
txt->setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
txt->setFocus();
txt->setStyleSheet("background-color: rgb(255, 255, 255,200);");
txt->setGeometry(10,20,100,30);
txt->setText("Text 1");
QCursor::setPos((txt->pos()+=QPoint(10,10)));
QMouseEvent * event1 = new QMouseEvent ((QEvent::MouseButtonPress), QPoint(10,10),
Qt::LeftButton,
Qt::LeftButton,
Qt::NoModifier);
qApp->postEvent((QObject*)txt,(QEvent *)event1);
QMouseEvent * event2 = new QMouseEvent ((QEvent::MouseButtonRelease), QPoint(10,10),
Qt::LeftButton,
Qt::LeftButton,
Qt::NoModifier);
qApp->postEvent((QObject*)txt,(QEvent *)event2);
txt->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks