SHARE
TWEET

Untitled

a guest Jun 20th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. QString get_note_description_html(int note_num){
  2.     QString data;
  3.     QFile file(":/html/1.htm"); // тут вписывай путь к html с описанием
  4.     if(!file.open(QIODevice::ReadOnly)) {
  5.         qDebug()<<"filenot opened"<<endl;
  6.     }
  7.     else
  8.     {
  9.         qDebug()<<"file opened"<<endl;
  10.         data = QString::fromLocal8Bit(file.readAll());
  11.     }
  12.     return data;
  13. }
  14.  
  15.  
  16. QPixmap  get_note_image(int note_num){
  17.        QPixmap note_pixmap(":/imgs/3.PNG"); // тут вписывай путь к файлу ресурсов
  18.        return note_pixmap;
  19. }
  20.  
  21. void formPriactice::on_btn_next_note_clicked()
  22. {
  23.  
  24.     ui->textBrowser->setHtml(get_note_description_html(13)); //обращение к виджету типа "textBrowser"
  25.     ui->lbl_illustration_1->setPixmap(get_note_image(13)); // обращение к label
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top