Ma’lumotlar va jarayonlarni turli ko’rinishda tasvirlash usullari. Ma’ruza Mavzu bo’limlari - Ma’lumotlar va jarayonlarni turli ko’rinishda tasvirlash.
- Qt dasturlash muhitida TreeWidjet, LinkedList va ProgressBar vidjetlari, ularning xossa va hodisalari.
ObjectName-Widjet nomi
Text- ko’rinadigan matn
alignment-Matnni Gor va Ver joylashishini sozlash
wordWrap-ko’p satrli namoyish
Font-Shrift nomi
Cursor-kursor ko’rinishi
tooltip-sichqoncha borganda ko’rinadigan matn
StatusTip-sichqoncha borganda status satrda ko’rinadigan matn
StyleSheet-matnni bezash,rang,fon
ObjectName-Widjet nomi
Text- ko’rinadigan matn
alignment-Matnni Gor va Ver joylashishini sozlash
inputMask-kiritish qoidalarini o’rnatish
Font-Shrift nomi
Cursor-kursor ko’rinishi
tooltip-sichqoncha borganda ko’rinadigan matn
StatusTip-sichqoncha borganda status satrda ko’rinadigan matn
StyleSheet-matnni bezash,rang,fon
placeHolderText-eslatma matn
Clearbuttonenabled-tozalsh tugmasini yoqish
Oynaga matn joylashtirish Oynaga matn joylashtirish
ui->QLabel->setText(“Bu vizual dasturlash”);
String s= QLabel->Text();
ui->QEdit->setText(“Bu o’zgaradigan matn”);
String s= QEdit->Text();
ui->listWidget->addItem("Ruyxat1");
ui->plainTextEdit->setPlainText("Kup satrli matn");
QLabel* plbl =new QLabel("http://www.bhv.ru");
lbl.setOpenExternalLinks(true);
Satrlarni tipini o’zgartirish
QString s1 = "12";
QString s2 = "15";
QString s3, s4;
// toInt() satrni butunga aylantirish.toFloat(), toDouble()
s1.toInt() + s2.toInt();
int n1 = 30;
int n2 = 40;
// setNum() yordamida butun sonni Qstring tipidagi satrga aylantirish
s3.setNum(n1) + s4.setNum(n2) ;
Oynaga rasm joylashtirish
Pixmap xususiyatidan Выбрать файл
Oynaga rasm joylashtirish
scaledContents xususiyati rasmni ko’rinadigan qilish
Oynaga rasm joylashtirish
QPixmap pixmap("C://file.jpg");
ui->label->setPixmap(pixmap);
QPixmap pix(":/1.png");
ui->label->setStyleSheet("border-image:url(:/2.png);");
ui->label->setPixmap(pix);
treeWidget vidjeti
DARAXTGA MALUMOT joylashtirish
QTreeWidgetItem *topLevelItem=new QTreeWidgetItem(ui->treeWidget);
ui->treeWidget->addTopLevelItem(topLevelItem);
topLevelItem->setText(0,“Element");
QTreeWidgetItem *item=new QTreeWidgetItem(topLevelItem);
item->setText(0,“Element ichidagi element");
Malumotlarni jadval ko’rinishida ifodalash Malumotlarni jadval ko’rinishida ifodalash
ui->tableWidget_2->setColumnCount(3);
ui->tableWidget_2->setRowCount(2);
for(int row = 0; rowtableWidget_2->rowCount(); row++)
for(int column = 0; columntableWidget_2->columnCount(); column++)
ui->tableWidget_2->setItem(row, column, new QTableWidgetItem());
Malumotlarni jadval ko’rinishida ifodalash
for(int row = 0; row < ui->tableWidget->rowCount(); row++)
for(int column = 0; column < ui->tableWidget->columnCount(); column++) {
QTableWidgetItem *item = new QTableWidgetItem(); >setText(QString("%1_%2").arg(row).arg(column)); ui->tableWidget->setItem(row, column, item); } }
Jarayonlarni kursatish progressbar
ProgressBar->Value()
ProgressBar-> Setvalue(45);
ProgressBar->setOrientation(Horizontal|Vertical)
vazifalar - LineEdit da kiritilgan matnni Label da katta xarflarda chiqaruvchi Tugma (PushButton)yarating.
- Tugma (PushButton) bosilganda Label da biror rasmni chiqaruvchi kod yozing.
- LineEdit da(1-100) kiritilgan qiymatni ProgressBar da Tugma (PushButton) yordamida chiqaring
- Satrlari va ustunlari soni LineEdit da va LineEdit 2da kiritilib, Tugma (PushButton) bosilganda kiritilgan qiymatlarga mos jadval yaratish dasturini yozing.
Do'stlaringiz bilan baham: |