OLD개발이야기/Qt
qtablewidget / text color/ bg color
//model 읽는 작업이고 QString temp=model->index(1,1).data().toString(); QStandardItem * colorItem = new QStandardItem(temp); // colorItem->setData(Qt::AlignCenter,Qt::TextAlignmentRole); colorItem->setData(QVariant(QBrush(Qt::red)), Qt::BackgroundRole); model->setItem(1,1,colorItem); // 0번째 컬럼을 클리어하고 체크박스를 넣어야 함 ----- QStandardItem * colorItem = new QStandardItem(" put the text" );----- QString temp=m..
QT: cell클릭 말고, 하나의 셀을 클릭했을 때 전체 row 받고 싶을 때
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ShowTable(); ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); } ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
[translation]QT: why delete() delete everything in QlineText?
http://www.qtcentre.org/threads/45795-Deleting-characters-in-QLineEdit-widget void BackspaceKeyNotification(){if(qlineedit1->hasFocus()){qlineedit1->backspace();}else if(qlineedit2->hasFocus()){qlineedit2->backspace();}} 이런식으로 작성했는데 왜 backspace() 함수를 쓰면 다 지워지나요 ? A: this is most probably because on a change you select all text on the line edit. Thus the whole is being deleted when you call QLine..
[solved] QT - Push button image / label image
It was really hard to get the answer.. I just watched lots of videos.. got the answer over the errors... [ Simple way ] label -> Pix map -> choose file or choose resource. push button -> click right side of mouse and edit stylesheet. -> Image-background image. // If you want to set an icon for the button, go to the mainwindow.cpp and insert some
[solved]Qt Creator: Resource root is empty, not shown in stylesheet
Even though you added the images to the prefix.It's not shown in stylesheet. In this case, I chose the pushbutton's stylesheet.and chose the background-image.But nothing shown up.!And refresh button is not working....Finally, I figured out... you should reopen the Qt Program. done! I can see the images .