ok, thanks for these answers.
I'm not English native so I have a few difficulties to read the documentation, sorry to bother you with my questions.
I read (though quite fast) the whole page regarding the QTextEdit class but I didn't find how to access/modify the contents of the text.
Regarding the size of the table, what I mean is that sometimes some blank zones appear, and sometimes there's a need to scroll to see the contents.
Here is my code (please tell me if/how I can make it better) :
int main(int argc, char *argv[])
{
fenetre->setFixedSize(300,600);
table->setFixedSize(400,400);
for (int row = 0; row < 3; row++)
{
for (int column = 0; column < 2; column++)
{
// set the special features of each item
item->setText("item foogyfyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy");
table->setItem(row,column,item);
}
}
fenetre->show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *fenetre = new QWidget ();
fenetre->setFixedSize(300,600);
QTableWidget *table = new QTableWidget(3, 2, fenetre);
table->setFixedSize(400,400);
table->setEditTriggers(QAbstractItemView::NoEditTriggers);
for (int row = 0; row < 3; row++)
{
for (int column = 0; column < 2; column++)
{
QTableWidgetItem *item = new QTableWidgetItem();
// set the special features of each item
item->setText("item foogyfyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy");
table->setItem(row,column,item);
}
}
fenetre->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
If I do this :
fenetre->setFixedSize(300,600);
table->setFixedSize(200,200);
QWidget *fenetre = new QWidget ();
fenetre->setFixedSize(300,600);
QTableWidget *table = new QTableWidget(3, 2, fenetre);
table->setFixedSize(200,200);
To copy to clipboard, switch view to plain text mode
I get a scrollbar ;
and if I do this :
fenetre->setFixedSize(300,600);
table->setFixedSize(400,400);
QWidget *fenetre = new QWidget ();
fenetre->setFixedSize(300,600);
QTableWidget *table = new QTableWidget(3, 2, fenetre);
table->setFixedSize(400,400);
To copy to clipboard, switch view to plain text mode
or this
fenetre->setFixedSize(300,600);
//table->setFixedSize(200,200);
QWidget *fenetre = new QWidget ();
fenetre->setFixedSize(300,600);
QTableWidget *table = new QTableWidget(3, 2, fenetre);
//table->setFixedSize(200,200);
To copy to clipboard, switch view to plain text mode
I get blank zones
I guessed I'd have to do a new class to make the line count appear as well.
I have no idea how big this project is though.
Can you give me a hint ? I mean, if it takes 100 code lines to implement this feature, I will drop it. Can you help me to do it please ?
Thanks.
Bookmarks